0

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.

3
  • 1
    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(). Commented Jan 5, 2015 at 6:29
  • Thanks. This works fine! I didn't find that method when I was reading the documentation last week. Commented Jan 5, 2015 at 11:10
  • @djthequest You should post that as an answer. Commented Jan 6, 2015 at 13:22

2 Answers 2

0

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().

0

To preserve djthequest's answer from a comment:

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().

and Christian Wartena's response indicating that this was a solution:

Thanks. This works fine! I didn't find that method when I was reading the documentation last week.

(I'll remove this answer if djthequest posts one.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.