Search code examples
jenardfsinference

How can I distinguish an axiom from an inferred statement in a Jena RDFS-INF model?


When I create a RDFS_MEM_RDFS_INF model in Jena and read some RDFS-File, a number of statements, that were not explicitly stated in the file are added. E.g. if we have a triple

a p b

and p is a rdfs:subPropertyOf q, than

a q b is

also in the model. A concrete example is the following: if

a skos:related b

is in the file

a skos:semanticRelation b

is also in the model.

Is there any possibility to check whether a statement in the model is an axiom or an inferred one? There are such methods for OWL Models, but I use the RDFS Model. A trivial solution would be to build two models, one without and one with inference, but I would prefer a less memory consuming solution.


Solution

  • Jena InfModel has a method getRawModel(). This Model wont contain the inferred statements, it will contain only the axioms in the file. use a check against that. If you are using the OntModel it has got a method getBaseModel().