An enhanced view of a Jena model that is known to contain ontology data, under a given ontology {@link Profile vocabulary} (such as OWL).This class does not by itself compute the deductive extension of the graph under the semantic rules of the language. Instead, we wrap an underlying model with this ontology interface, that presents a convenience syntax for accessing the language elements. Depending on the inference capability of the underlying model, the OntModel will appear to contain more or less triples. For example, if this class is used to wrap a plain memory or database model, only the relationships asserted by the document will be reported through this convenience API. Alternatively, if the OntModel wraps an OWL inferencing model, the inferred triples from the extension will be reported as well. For example, assume the following ontology fragment: :A rdf:type owl:Class . :B rdf:type owl:Class ; rdfs:subClassOf :A . :widget rdf:type :B .
In a non-inferencing model, the rdf:type
of the widget will be reported as class :B
only. In a model that can process the OWL semantics, the widget's types will include :B
, :A
, and owl:Thing
.
Note: that OntModel
is an extension to the {@link InfModel} interface. This is to support the case where an ontology modelwraps an inference graph, and we want to make the special capabilities of the InfModel
, for example global consistency checking, accessible to client programs. Since not all ont models use a reasoner, using these methods may result in a runtime exception, though the typical behaviour is that such calls will be silently ignored.