jena-rules

Jena TDB after reason then update

让人想犯罪 __ 提交于 2019-12-11 13:44:18
问题 I am using Jena and I want to update the new ontology into my tdb. For example. I have 100 rows in my ontology , after I add some rules and run the reasoner, there are 105 rows now. And I need to update these 5 additional rows in my tdb. How can I get this done ? I try to google it and I found two ways. One is using sparql to update , another is truncating the tdb and add the new model into it. Is there any other better solution? Thanks you -- code void after_reasoner(Model m) { String yago =

Specifying class equivalence in Jena rules

时光毁灭记忆、已成空白 提交于 2019-12-11 13:14:41
问题 Given an ontology with Class A and Class B I am stating a rule: [-> (ns:Class_A owl:equivalentClass ns:Class_B)] However the Jena generic rule reasoner is only applying the tag equivalentClass to Class A , i. e. it is not stating Class B equivalentClass Class A . Furthermore, I have an object A that is an individual of Class A , the reasoner is not applying Class B as a type of object A . Is there another way to specify class equivalence through Jena rules? And is it better to use the generic

Problems with inference examples from Apache Jena framework

帅比萌擦擦* 提交于 2019-12-06 14:46:21
I have a serious problem to get any reasoner up and running. Also the examples from the documentation: https://jena.apache.org/documentation/inference/ does not work here. I transferred the example into a unit test, so that the problem might be easier reproduced. Is reasoning limited to certain environment like a spatial JDK or so on, or am i getting something wrong? Thanks Here the example code (as java unit test): import static org.junit.Assert.assertNotNull; import java.io.PrintWriter; import java.util.Iterator; import org.junit.Before; import org.junit.Test; import com.hp.hpl.jena.rdf