Jena reasoning with rules

In this tutorial we explain, how you can perform reasoning with rules using Apache Jena. The example code is available on Github. 1. Create a Dataset Starting of with an example dataset called dataset.n3: @prefix : <http://tutorialacademy.com/2015/jena#> . :John :hasClass :Math . :Bill :teaches :Math . We have two statements. John has a class which is Math. Bill teaches a Math class. Consequently, Bill has a student called John. That is exactly what we want to infer later on. 2. Writing a rule We create a rule file called rules.txt and add…

Read More