Jena Lessons - More On the Reasoner
Back when I started working with Jena, my first "ontology task" was to iterate through a subset of objects in the model, perform some operations to slightly modify these objects, and then store the objects back into the model. Sounds simple right? In a traditional database application, this program would consist of a SELECT statement, followed by some business logic, and conclude with a SQL UPDATE . I've probably written code like this hundreds of times. It's simple and runs quickly. On paper, the ontology task seems even easier. Once opening a Jena ontology model , you can query for objects ( Resources ) in any number of ways (including a SQL-like SPARQL syntax). From there you simply create or modify properties on the resource. Since the ontology model is in memory, the changes happen real time (no need for an UPDATE ). And while you could persist the changes, there really isn't any need to. While this seems quite easy, I noticed severe performanc...