Jena: How to update (not added) RDF triple in ontology graph using jena rules

312 Views Asked by At

How to update the RDF triple (not added new one) using jena rule. I am using generic rule reasoner and rules are in separate file as shown case 1:

@prefix fa: http://www.smarthome_haier.com#.

Rule1: (?a fa:setTimer “0”)(?a fa:windvolume “150”)->remove(0)(?a fa:setTimer “1”)

This work fine using remove() Builtin primitive to add new triple and delete the old triple "(?a fa:setTimer “0”)" using remove() builtin option.

But for example in this 2nd case below where we want same result as case one:

@prefix fa: http://www.smarthome_haier.com#.

Rule1: (?a fa:airPresure “40”)(?a fa:windvolume “150”)->(?a fa:setTimer “1”)

Using this adds new triple (?a fa:setTimer “1”) in graph but old triple also exist (?a fa:setTimer “0”) because we are not remove that one.

How can we update triple in 2nd case? Where (?a fa:setTimer “0”) is not present in rule head. I hope this explain this problem. Any help will appreciated. Thanks!

Click [Here] Jena inference support https://jena.apache.org/documentation/inference/index.html

0

There are 0 best solutions below