Dear Jena experts, our team is developing a game where the game status is represented by an ontology and the game logic is represented by rules. We want to use the Jena reasoning in the first place and maybe switch to a reasoner later on.
Currently I am looking for a rule that creates new NAMED individuals. my 1st try was: @prefix pre: <http://anarxim.net/world/test.owl#>. [growTree:(?a rdf:type pre:AppleSeed) (?b rdf:type pre:Soil) (?c rdf:type pre:Water)(?b pre:contains ?a) (?b pre:contains ?c) (?s rdf:type pre:Sun) (?s pre:shinesOn ?b) makeTemp(?tree) -> print ('tree name: ' + ?tree) (?tree rdf:type pre:AppleTree) (?tree rdf:about pre:tree1)] Although i get same cryptic string from the print statement: 'tree name: ' + -7c9954a7:1406f1f250f:-7ffc 'tree name: ' + -7c9954a7:1406f1f250f:-7ffb Jena throws an exception when I try to use rdf:about in a triple. Exception in thread "main" com.hp.hpl.jena.shared.InvalidPropertyURIException: rdf:about My 2nd try was to use makeInstance in a backward rule. @prefix pre: <http://anarxim.net/world/test.owl#>. [growTree: makeInstance(?b, pre:hasOntop, ?tree) <- (?a rdf:type pre:AppleSeed) (?b rdf:type pre:Soil) (?c rdf:type pre:Water)(?b pre:contains ?a) (?b pre:contains ?c) (?s rdf:type pre:Sun) (?s pre:shinesOn ?b) ] This is syntacticly correct but does not result in a named Individual in the Ontology My 3rd try was to write a hybrid rule: @prefix pre: <http://anarxim.net/world/test.owl#>. [growTree: (?a rdf:type pre:AppleSeed) (?b rdf:type pre:Soil) (?c rdf:type pre:Water)(?b pre:contains ?a) (?b pre:contains ?c) (?s rdf:type pre:Sun) (?s pre:shinesOn ?b) -> [(?tree rdf:type pre:AppleTree) <- makeInstance(?b, pre:hasOntop, pre:Soil ?tree) ]] This resultst a least in a <j.0:AppleTree/> in the ontology but it has neither an rdf:about-attribute nor is it bound to something. I would be very grateful if someone gives me a hint. Thanks in advance. Kamil