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:

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 the following rule:

This basically means, if we find a…

Read More