Hi, I'm trying to implement in Jena rules some behavior such as "If there is no value for property P, then property Q = v1, else property Q = v2". Since I need Jena to react "live" to triples adding and removal, I use it in FORWARD_RETE.
I'm using the buildIn "noValue(?x, ?p)" as following : @prefix test: <http://myURL/mySpace#> @prefix owl: <http://www.w3.org/2002/07/owl> @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> @prefix xs: <http://www.w3.org/2001/XMLSchema#> [rule1: (?icon rdf:type test:Icon), noValue(?icon, test:imagePath) -> (?icon test:scale "1"^^xsd:double)] [rule2: (?icon rdf:type test:Icon), (?icon test:imagePath ?value) -> (?icon test:scale "2"^^xsd:double)] First of all, am I right if I say that with such rules, I will have the 2 triples (http://myURL/mySpace#myIcon http://myURL/mySpace#scale '1'^^http://www.w3.org/2001/XMLSchema#double) and (http://myURL/mySpace#myIcon http://myURL/mySpace#scale '2'^^http://www.w3.org/2001/XMLSchema#double) … if I add my triples in that order : 1) (http://myURL/mySpace#myIcon rdf:type http://myURL/mySpace#Icon) 2) (http://myURL/mySpace#myIcon http://myURL/mySpace#imagePath 'path'^^http://www.w3.org/2001/XMLSchema#string) And the reason is that when I add my second triple, the buildIn "noValue" don't "react" like if one would remove a value matching with it, and hence the rule don't remove its deduced triple. Am I also right if I say that the only way to do it with a FORWARD_RETE is to use a "remove" builtIn in my rule2 ? Thank you, Chris. Christophe FAGOT, PhD - Product owner, informatique :: intactile DESIGN :: création industrielle en Interface Homme Machine [ IHM ] :: 20 rue du carré du roi :: 34000 MONTPELLIER :: France :: +33 (0)4 67 52 88 61 :: +33 (0)9 50 12 05 66 :: [email protected] :: http://www.intactile.com Hugh MacLeod : "It's not what the software does, it's what the user does" Les informations contenues dans cet email et ses documents attachés sont confidentielles. Elles sont exclusivement adressées aux destinataires explicitement désignés ci-dessus et ne peuvent être divulguées sans consentement de son auteur. Si vous n'êtes pas le destinataire de cet email vous ne devez pas employer, révéler, distribuer, copier, imprimer ou transmettre le contenu de cet email et devez le détruire immédiatement.
