Class OntGraphModelImpl

java.lang.Object
org.apache.jena.enhanced.EnhGraph
org.apache.jena.rdf.model.impl.ModelCom
org.apache.jena.ontapi.impl.OntGraphModelImpl
All Implemented Interfaces:
OntEnhGraph, OntModel, org.apache.jena.rdf.model.InfModel, org.apache.jena.rdf.model.Model, org.apache.jena.rdf.model.ModelCon, org.apache.jena.rdf.model.ModelGraphInterface, org.apache.jena.rdf.model.RDFReaderF, org.apache.jena.rdf.model.RDFWriterF, org.apache.jena.shared.Lock, org.apache.jena.shared.PrefixMapping

public class OntGraphModelImpl extends org.apache.jena.rdf.model.impl.ModelCom implements OntModel, OntEnhGraph, org.apache.jena.rdf.model.InfModel
Implementation of a model that can process general ontologies in OWL and similar languages. Class OntPersonality is responsible for the configuration of the model. Also see OntModelControls - a set of settings, that can be accessed through OntPersonality.getConfig().
See Also:
  • Field Details

  • Constructor Details

    • OntGraphModelImpl

      public OntGraphModelImpl(UnionGraph graph, OntPersonality personality)
    • OntGraphModelImpl

      public OntGraphModelImpl(org.apache.jena.reasoner.InfGraph graph, OntPersonality personality)
  • Method Details

    • listOntObjects

      public static <M extends org.apache.jena.enhanced.EnhGraph & OntEnhGraph, O extends OntObject> org.apache.jena.util.iterator.ExtendedIterator<O> listOntObjects(M m, Class<? extends O> type)
      Lists all OntObjects for the given OntGraphModelImpl.
      Type Parameters:
      M - a subtype of EnhGraph and OntEnhGraph
      O - subtype of OntObject
      Parameters:
      m - OntGraphModelImpl the impl to cache
      type - Class the type of OntObject, not null
      Returns:
      an Extended Iterator of OntObjects
    • listIndividuals

      public static <M extends OntModel & OntEnhGraph> org.apache.jena.util.iterator.ExtendedIterator<OntIndividual> listIndividuals(M model, Set<String> reserved, org.apache.jena.util.iterator.ExtendedIterator<org.apache.jena.graph.Triple> assertions)
      Filters OntIndividuals from the specified ExtendedIterator.
      Type Parameters:
      M - a subtype of OntModel and OntEnhGraph
      Parameters:
      model - M, not null
      reserved - a Set of forbidden URIs, that cannot be treated as Ontology Classes, not null
      assertions - ExtendedIterator of Triples with the rdf:type as predicate, not null
      Returns:
      ExtendedIterator of OntIndividuals that are attached to the model
    • checkFeature

      public static void checkFeature(OntModel m, OntModelControls setting, String featureName)
    • configValue

      public static boolean configValue(OntModel m, OntModelControls setting)
    • getOntPersonality

      public OntPersonality getOntPersonality()
      Description copied from interface: OntEnhGraph
      Returns the model personality, that is unmodifiable model's configuration storage.
      Specified by:
      getOntPersonality in interface OntEnhGraph
      Returns:
      OntPersonality
    • getUnionGraph

      public UnionGraph getUnionGraph()
      Returns UnionGraph. This implementation requires that the underlying graph is union-graph or inf-graph.
      Returns:
      UnionGraph
    • getBaseGraph

      public org.apache.jena.graph.Graph getBaseGraph()
      Description copied from interface: OntModel
      Returns the base Graph, i.e., the primary ontological Graph that does not contain any subgraph hierarchy. Only the base graph can be edited from this interface view. To get the whole union graph use the method ModelGraphInterface.getGraph().
      Specified by:
      getBaseGraph in interface OntModel
      Returns:
      Graph
      See Also:
      • ModelGraphInterface.getGraph()
    • getBaseModel

      public org.apache.jena.rdf.model.Model getBaseModel()
      Description copied from interface: OntModel
      Returns the standard jena model that corresponds to the base graph. Note: there is the Jena Builtin Personality within the returned model.
      Specified by:
      getBaseModel in interface OntModel
      Returns:
      Model
      See Also:
    • register

      public OntGraphModelImpl register(org.apache.jena.rdf.model.ModelChangedListener listener)
      Specified by:
      register in interface org.apache.jena.rdf.model.Model
      Overrides:
      register in class org.apache.jena.rdf.model.impl.ModelCom
    • unregister

      public OntGraphModelImpl unregister(org.apache.jena.rdf.model.ModelChangedListener listener)
      Specified by:
      unregister in interface org.apache.jena.rdf.model.Model
      Overrides:
      unregister in class org.apache.jena.rdf.model.impl.ModelCom
    • notifyEvent

      public OntGraphModelImpl notifyEvent(Object event)
      Specified by:
      notifyEvent in interface org.apache.jena.rdf.model.Model
      Overrides:
      notifyEvent in class org.apache.jena.rdf.model.impl.ModelCom
    • getID

      public OntID getID()
      Description copied from interface: OntModel
      Gets the Ontology ID object.

      Since OWL2 graph can only contain the one @uri rdf:type owl:Ontology triple inside, this method creates such a statement if it absent; in case there are more than one Resource with the type equaled to owl:Ontology, it chooses the most bulky one (i.e. those that contains the largest number of associated statements) and all the others leave intact.

      Specified by:
      getID in interface OntModel
      Returns:
      OntID an existing or fresh Resource, that is subject in the _:x rdf:type owl:Ontology statement
    • createIndividual

      public OntIndividual createIndividual(String uri, OntClass type)
      Description copied from interface: OntModel
      Creates individual (named or anonymous) of the specified type.
      Specified by:
      createIndividual in interface OntModel
      Parameters:
      uri - String, or null for anonymous individual
      type - OntClass
      Returns:
      OntIndividual
    • id

      public Optional<OntID> id()
      Description copied from interface: OntModel
      Finds an Ontology ID object.

      Since OWL2 graph requires only one @uri rdf:type owl:Ontology triple, the method returns Optional#empty in other cases. No changes in the Graph is made. The method works only with the base graph.

      Specified by:
      id in interface OntModel
      Returns:
      an Optional that contains the OntID
      See Also:
    • setID

      public OntID setID(String uri)
      Description copied from interface: OntModel
      Creates a new @uri rdf:type owl:Ontology statement for the specified uri and wraps it as Ontology ID Resource. Removes all extra ontology objects if they are present and moves their content to the new one, to have a single Ontology header as it is required by OWL2 specification.
      Specified by:
      setID in interface OntModel
      Parameters:
      uri - String, can be null to make this ontology to be anonymous
      Returns:
      the new OntID instance
      See Also:
    • addImport

      public OntGraphModelImpl addImport(OntModel m)
      Description copied from interface: OntModel
      Adds a sub-model both to the owl:import section and to the graph hierarchy.
      Specified by:
      addImport in interface OntModel
      Parameters:
      m - ont jena model to add, not null
      Returns:
      this model to allow cascading calls
      See Also:
    • hasImport

      public boolean hasImport(OntModel m)
      Description copied from interface: OntModel
      Answers true if the given model is present in the owl:imports of this model. This means that at the top-level of the import hierarchy there is a base graph of the given other model. Please note: the model may contain the same uri as that of the specified model, but a different (base) graph, i.e. if the method OntModel.hasImport(String) returns true, it does not mean this method also returns true.
      Specified by:
      hasImport in interface OntModel
      Parameters:
      m - OntModel to test, not null
      Returns:
      true if the model is in imports
    • hasImport

      public boolean hasImport(String uri)
      Description copied from interface: OntModel
      Answers true if the model has a graph with the given uri both in owl:imports and graph-hierarchy.
      Specified by:
      hasImport in interface OntModel
      Parameters:
      uri - String, not null
      Returns:
      boolean
      See Also:
    • removeImport

      public OntGraphModelImpl removeImport(OntModel m)
      Description copied from interface: OntModel
      Removes a sub-model from owl:import and from the graph hierarchy. Does nothing if the specified model does not belong to this ontology. Matching is performed by graph, not uri (see OntModel.hasImport(OntModel) description).
      Specified by:
      removeImport in interface OntModel
      Parameters:
      m - ont jena model to remove, not null
      Returns:
      this model to allow cascading calls
      See Also:
    • removeImport

      public OntGraphModelImpl removeImport(String uri)
      Description copied from interface: OntModel
      Removes the import (both owl:import declaration and the corresponding graph) by the given uri if it is found.
      Specified by:
      removeImport in interface OntModel
      Parameters:
      uri - String, an iri of ontology to find, not null
      Returns:
      this model to allow cascading calls
      See Also:
    • imports

      public Stream<OntModel> imports()
      Description copied from interface: OntModel
      Lists all sub-models that belong to the top-level hierarchy and have owl:import reference inside the base graph. Caution: since recursive hierarchies are not prohibited, the rectilinear usage of this method may cause a StackOverflow Error.
      Specified by:
      imports in interface OntModel
      Returns:
      Stream of OntModels
      See Also:
    • imports

      public Stream<OntModel> imports(OntPersonality personality)
      Lists all top-level sub-models built with the given personality.
      Parameters:
      personality - OntPersonality, not null
      Returns:
      Stream of OntModels
    • listImportModels

      public final org.apache.jena.util.iterator.ExtendedIterator<OntGraphModelImpl> listImportModels(OntPersonality personality, org.apache.jena.reasoner.Reasoner reasoner)
      Lists model impls with the specified personality from the top tier of the imports' hierarchy.
      Parameters:
      personality - OntPersonality, not null
      reasoner - Reasoner, can be null
      Returns:
      non-distinct ExtendedIterator of OntGraphModelImpls
    • getTopModel

      public OntGraphModelImpl getTopModel()
      Gets the top-level Ontology Graph Model impl. The returned model may contain import declarations, but cannot contain sub-models. Be warned: any listeners, attached on the ModelCom.getGraph()
      Returns:
      OntGraphModelImpl
      See Also:
    • independent

      public boolean independent()
      Determines whether this model is independent.
      Specified by:
      independent in interface org.apache.jena.rdf.model.Model
      Overrides:
      independent in class org.apache.jena.rdf.model.impl.ModelCom
      Returns:
      true if this model is independent of others
    • isBuiltIn

      public <E extends OntObjectImpl & OntEntity> boolean isBuiltIn(E e)
      Answers true if the given entity is built-in.
      Type Parameters:
      E - subtype of OntObjectImpl and OntEntity
      Parameters:
      e - OntEntity object impl
      Returns:
      boolean
    • ontObjects

      public <O extends OntObject> Stream<O> ontObjects(Class<? extends O> type)
      Retrieves the stream of Ontology Objects. The result object will be cached inside the model. Note: this method may return non-distinct results, this is determined by the reasoner and nature of the underlying graph; for non-inference the standard memory graph implementation the result Stream is distinct.
      Specified by:
      ontObjects in interface OntModel
      Type Parameters:
      O - subtype of OntObject
      Parameters:
      type - Class the type of OntObject, not null
      Returns:
      Stream of OntObjects
      See Also:
    • listOntObjects

      public <O extends OntObject> org.apache.jena.util.iterator.ExtendedIterator<O> listOntObjects(Class<? extends O> type)
      Lists all Ontology Objects and caches them inside this model.
      Type Parameters:
      O - subtype of OntObject
      Parameters:
      type - Class the type of OntObject, not null
      Returns:
      an Extended Iterator of OntObjects
    • listLocalOntObjects

      public <O extends OntObject> org.apache.jena.util.iterator.ExtendedIterator<O> listLocalOntObjects(Class<? extends O> type)
      The same as listOntObjects(Class), but for the base graph.
      Type Parameters:
      O - subtype of OntObject
      Parameters:
      type - Class the type of OntObject, not null
      Returns:
      Extended Iterator of OntObjects
    • ontEntities

      public Stream<OntEntity> ontEntities()
      Description copied from interface: OntModel
      Lists all entities declared in the model. Built-ins are not included. The retrieved entities can belong to the underlying graphs also. Note: this method returns non-distinct stream. The duplicate elements (by equals and hasCode, not by real class-type) means that there is so-called punning.
      Specified by:
      ontEntities in interface OntModel
      Returns:
      Stream of OntEntity
      See Also:
    • listOntEntities

      public org.apache.jena.util.iterator.ExtendedIterator<OntEntity> listOntEntities()
      Lists all Ontology Entities. Built-ins are not included.
      Returns:
      Extended Iterator of OntEntitys
      See Also:
    • listLocalOntEntities

      public org.apache.jena.util.iterator.ExtendedIterator<OntEntity> listLocalOntEntities()
      The same as listOntEntities() but for the base graph.
      Returns:
      Extended Iterator of OntEntitys
      See Also:
    • ambiguousEntities

      public Stream<OntEntity> ambiguousEntities(boolean withImports)
      Gets 'punnings', i.e. the OntEntitys which have not only a single type.
      Parameters:
      withImports - if it false takes into account only the base model
      Returns:
      Stream of OntEntitys.
    • individuals

      public Stream<OntIndividual> individuals()
      Description copied from interface: OntModel
      Lists all class-asserted individuals.

      A class assertion axiom is a statement a rdf:type C, where a is a retrieving individual (named or anonymous) and C is any class expression. Notice, that the method OntModel.ontObjects(Class) called with the parameter OntIndividual.class (i.e. model.ontObject(OntIndividual.class)) must return all individuals from a model, even those which have no explicit declarations (e.g. any part of owl:sameAs is an individual), while this method returns only class-asserted individuals. Also notice: the method OntModel.namedIndividuals() must return only explicitly declared named individuals, while this method does not require the declaration owl:NamedIndividual to be present for an individual: according to the specification, it is optional; for more details see 5.8.1 Typing Constraints of OWL 2 DL. Also note: in case of valid distinct RDF graph the returned Stream is also distinct, which means an individual that has more than one class assertions, must appear in the stream only once.

      Specified by:
      individuals in interface OntModel
      Returns:
      Stream of OntIndividuals
      See Also:
    • listIndividuals

      public org.apache.jena.util.iterator.ExtendedIterator<OntIndividual> listIndividuals()
      Returns an ExtendedIterator over all individuals that participate in class assertion statement a rdf:type C.
      Returns:
      ExtendedIterator of OntIndividuals
    • hierarchyRoots

      public Stream<OntClass> hierarchyRoots()
      Description copied from interface: OntModel
      Answers a Stream over the classes in this ontology model that represent the uppermost nodes of the class hierarchy. Built-ins are not included.
      Specified by:
      hierarchyRoots in interface OntModel
      Returns:
      a Stream of the root classes in the local class hierarchy
    • listHierarchyRoots

      public org.apache.jena.util.iterator.ExtendedIterator<OntClass> listHierarchyRoots()
    • getOntEntity

      public <E extends OntEntity> E getOntEntity(Class<E> type, String uri)
      Description copied from interface: OntModel
      Returns an ont-entity for the specified type and uri. This method can also be used to wrap builtin entities, which, in fact, do not belong to the RDF graph, but can be considered as belonged to the OWL model. An IRI for such a built-in entity must be in the Builtins Vocabulary, otherwise the method returns null.
      Specified by:
      getOntEntity in interface OntModel
      Type Parameters:
      E - type of OntEntity
      Parameters:
      type - Class, the type of OntEntity, not null
      uri - String, not null
      Returns:
      OntEntity or null
      See Also:
    • createOntEntity

      public <T extends OntEntity> T createOntEntity(Class<T> type, String iri)
      Description copied from interface: OntModel
      Creates an owl-entity by the type and iri.
      Specified by:
      createOntEntity in interface OntModel
      Type Parameters:
      T - type of ont-entity
      Parameters:
      type - Class, the type of OntEntity, not null
      iri - String, not null
      Returns:
      OntEntity
      See Also:
    • createOntObject

      public <T extends OntObject> T createOntObject(Class<T> type, String uri)
      Creates and caches an ontology object resource by the given type and uri.
      Type Parameters:
      T - class-type of OntObject
      Parameters:
      type - Class, object type
      uri - String, URI (IRI), can be null for anonymous resource
      Returns:
      OntObject, new instance
      Throws:
      OntJenaException.Unsupported - profile mismatch
    • removeOntObject

      public OntGraphModelImpl removeOntObject(OntObject obj)
      Description copied from interface: OntModel
      Removes the given Ontology Object from the graph-model including its content and annotations. This operation does not guarantee the removal of all references to objects: it takes into account only statements where the given object in a subject position. For example, in case of deleting an OWL class that is on the right side in a statement with the predicate rdfs:subClassOf, that statement remains unchanged in the graph, but becomes meaningless: its right side will no longer be a class, but just uri. But if a class is on the left side of the statement with the rdfs:subClassOf predicate, that statement is being removed from the graph along with its annotations, because it belongs to the class content.
      Specified by:
      removeOntObject in interface OntModel
      Parameters:
      obj - OntObject
      Returns:
      this model
      See Also:
    • removeOntStatement

      public OntGraphModelImpl removeOntStatement(OntStatement statement)
      Description copied from interface: OntModel
      Removes the statement from the graph-model including its annotations with sub-annotations hierarchy.
      Specified by:
      removeOntStatement in interface OntModel
      Parameters:
      statement - OntStatement
      Returns:
      this model
      See Also:
      • Model.remove(Statement)
    • statements

      public Stream<OntStatement> statements()
      Description copied from interface: OntModel
      Lists all ont-statements.
      Specified by:
      statements in interface OntModel
      Returns:
      Stream of OntStatement
      See Also:
      • Model.listStatements()
    • statements

      public Stream<OntStatement> statements(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.RDFNode o)
      Description copied from interface: OntModel
      Lists all statements for the specified subject, predicate and object (SPO).
      Specified by:
      statements in interface OntModel
      Parameters:
      s - Resource, the subject
      p - Property, the predicate
      o - RDFNode, the object
      Returns:
      Stream of OntStatement
      See Also:
      • Model.listStatements(Resource, Property, RDFNode)
    • localStatements

      public Stream<OntStatement> localStatements(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.RDFNode o)
      Description copied from interface: OntModel
      Lists all statements from the base graph for the specified subject, predicate and object. Effectively equivalent to the model.statements(s, p, o).filter(OntStatement::isLocal) expression.
      Specified by:
      localStatements in interface OntModel
      Parameters:
      s - Resource, the subject
      p - Property, the predicate
      o - RDFNode, the object
      Returns:
      Stream of OntStatement
      See Also:
    • listStatements

      public org.apache.jena.rdf.model.StmtIterator listStatements(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.RDFNode o)
      Specified by:
      listStatements in interface org.apache.jena.rdf.model.Model
      Overrides:
      listStatements in class org.apache.jena.rdf.model.impl.ModelCom
      Parameters:
      s - Resource the subject sought, can be null
      p - Property the predicate sought, can be null
      o - RDFNode the object sought, can be null
      Returns:
      StmtIterator of OntStatements
    • listOntStatements

      public org.apache.jena.util.iterator.ExtendedIterator<OntStatement> listOntStatements(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.RDFNode o)
      Returns an extended iterator over all the statements in the model that match a pattern. The statements selected are those whose subject matches the s argument, whose predicate matches the p argument and whose object matches the o argument. If an argument is null it matches anything. The method is equivalent to the expression listStatements(s, p, o).mapWith(OntStatement.class::cast).
      Parameters:
      s - Resource the subject sought, can be null
      p - Property the predicate sought, can be null
      o - RDFNode the object sought, can be null
      Returns:
      ExtendedIterator of OntStatements
      See Also:
    • listLocalStatements

      public org.apache.jena.util.iterator.ExtendedIterator<OntStatement> listLocalStatements(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.RDFNode o)
      Lists all statements in the base model that match a pattern in the form of Extended Iterator. The method is equivalent to the expression listStatements(s, p, o).mapWith(OntStatement.class::cast).filterKeep(OntStatement::isLocal).
      Parameters:
      s - Resource the subject sought, can be null
      p - Property the predicate sought, can be null
      o - RDFNode the object sought, can be null
      Returns:
      ExtendedIterator of OntStatements, which are local to the base graph
      See Also:
    • createStatement

      public OntStatementImpl createStatement(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.RDFNode o)
      Specified by:
      createStatement in interface org.apache.jena.rdf.model.Model
      Overrides:
      createStatement in class org.apache.jena.rdf.model.impl.ModelCom
    • asStatement

      public OntStatementImpl asStatement(org.apache.jena.graph.Triple triple)
      Description copied from interface: OntModel
      Answers an Ontology Statement in this model who's SPO is that of the triple.
      Specified by:
      asStatement in interface org.apache.jena.rdf.model.ModelGraphInterface
      Specified by:
      asStatement in interface OntModel
      Overrides:
      asStatement in class org.apache.jena.rdf.model.impl.ModelCom
      Parameters:
      triple - Triple, not null
      Returns:
      OntStatement
    • containsLocal

      public boolean containsLocal(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.RDFNode o)
      Determines if the given (s, p, o) pattern is present in the base graph, with null allowed to represent a wildcard match.
      Parameters:
      s - - Resource - the subject of the statement tested (null as wildcard)
      p - - Property - the predicate of the statement tested (null as wildcard)
      o - - RDFNode - the object of the statement tested (null as wildcard)
      Returns:
      boolean
      See Also:
      • Model.contains(Resource, Property, RDFNode)
    • asOntList

      public <E extends org.apache.jena.rdf.model.RDFNode> OntListImpl<E> asOntList(org.apache.jena.rdf.model.RDFList list, OntObject subject, org.apache.jena.rdf.model.Property predicate, Class<E> type)
      Wraps the existing given []-list as ONT-list.
      Type Parameters:
      E - any RDFNode
      Parameters:
      list - RDFList, not null
      subject - OntObject, not null
      predicate - Property, not null
      type - a Class-type for list element E, not null
      Returns:
      OntList
    • asOntList

      public <E extends org.apache.jena.rdf.model.RDFNode> OntListImpl<E> asOntList(org.apache.jena.rdf.model.RDFList list, OntObject subject, org.apache.jena.rdf.model.Property predicate, boolean checkRecursions, org.apache.jena.rdf.model.Resource listType, Class<E> elementType)
      Wraps the existing given []-list as ONT-list.
      Type Parameters:
      E - any RDFNode
      Parameters:
      list - RDFList, not null
      subject - OntObject, not null
      predicate - Property, not null
      checkRecursions - boolean, if true more careful and expensive checking for list content is performed
      listType - an uri-Resource, used as an archaic RDF-type, usually this parameter should be null
      elementType - a Class-type for list element E, not null
      Returns:
      OntList
    • createOntList

      public <E extends org.apache.jena.rdf.model.RDFNode> OntListImpl<E> createOntList(OntObject subject, org.apache.jena.rdf.model.Property predicate, Class<E> type, Iterator<E> elements)
      Creates ONT-List with given elements and other settings.
      Type Parameters:
      E - any RDFNode
      Parameters:
      subject - OntObject, not null
      predicate - Property, not null
      type - a Class-type for element E, not null
      elements - and Iterator of E-elements (the order is preserved), not null
      Returns:
      OntList
    • createOntList

      public <E extends org.apache.jena.rdf.model.RDFNode> OntListImpl<E> createOntList(OntObject subject, org.apache.jena.rdf.model.Property predicate, org.apache.jena.rdf.model.Resource listType, Class<E> elementType, Iterator<E> elements)
      Creates ONT-List with given elements and other settings.
      Type Parameters:
      E - any RDFNode
      Parameters:
      subject - OntObject, not null
      predicate - Property, not null
      listType - an uri-Resource, used as an archaic RDF-type, usually this parameter should be null
      elementType - a Class-type for element E, not null
      elements - and Iterator of E-elements (the order is preserved), not null
      Returns:
      OntList
    • listAnnotations

      public org.apache.jena.util.iterator.ExtendedIterator<org.apache.jena.rdf.model.Resource> listAnnotations(org.apache.jena.rdf.model.Resource t, org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.RDFNode o)
      Lists all (bulk) annotation anonymous resources for the given rdf:type and SPO.
      Parameters:
      t - Resource either owl:Axiom or owl:Annotation
      s - Resource subject
      p - Property predicate
      o - RDFNode object
      Returns:
      ExtendedIterator of annotation resources
    • deleteOntList

      public OntGraphModelImpl deleteOntList(OntObject subject, org.apache.jena.rdf.model.Property predicate, OntList<?> object)
      Deletes the specified OntList including its annotations.
      Parameters:
      subject - OntObject the subject of the OntList root statement
      predicate - Property the predicate of the OntList root statement
      object - OntList to be deleted
      Returns:
      this model instance
    • createDisjointClasses

      public OntDisjoint.Classes createDisjointClasses(Collection<OntClass> classes)
    • createDifferentIndividuals

      public OntDisjoint.Individuals createDifferentIndividuals(Collection<OntIndividual> individuals)
    • createDisjointObjectProperties

      public OntDisjoint.ObjectProperties createDisjointObjectProperties(Collection<OntObjectProperty> properties)
    • createDisjointDataProperties

      public OntDisjoint.DataProperties createDisjointDataProperties(Collection<OntDataProperty> properties)
    • createFacetRestriction

      public <T extends OntFacetRestriction> T createFacetRestriction(Class<T> view, org.apache.jena.rdf.model.Literal literal)
      Description copied from interface: OntModel
      Creates a facet restriction by the given type and literal value. Each call to this method creates a fresh b-node within the graph.
      Specified by:
      createFacetRestriction in interface OntModel
      Type Parameters:
      T - type of ont-facet-restriction
      Parameters:
      view - Class, the type of OntFacetRestriction, not null
      literal - Literal, not null
      Returns:
      OntFacetRestriction
      See Also:
    • createDataOneOf

      public OntDataRange.OneOf createDataOneOf(Collection<org.apache.jena.rdf.model.Literal> values)
    • createDataRestriction

      public OntDataRange.Restriction createDataRestriction(OntDataRange.Named datatype, Collection<OntFacetRestriction> values)
    • createDataComplementOf

      public OntDataRange.ComplementOf createDataComplementOf(OntDataRange other)
    • createDataUnionOf

      public OntDataRange.UnionOf createDataUnionOf(Collection<OntDataRange> values)
    • createDataIntersectionOf

      public OntDataRange.IntersectionOf createDataIntersectionOf(Collection<OntDataRange> values)
    • createObjectSomeValuesFrom

      public OntClass.ObjectSomeValuesFrom createObjectSomeValuesFrom(OntObjectProperty property, OntClass ce)
    • createDataSomeValuesFrom

      public OntClass.DataSomeValuesFrom createDataSomeValuesFrom(OntDataProperty property, OntDataRange dr)
    • createObjectAllValuesFrom

      public OntClass.ObjectAllValuesFrom createObjectAllValuesFrom(OntObjectProperty property, OntClass ce)
    • createDataAllValuesFrom

      public OntClass.DataAllValuesFrom createDataAllValuesFrom(OntDataProperty property, OntDataRange dr)
    • createObjectHasValue

      public OntClass.ObjectHasValue createObjectHasValue(OntObjectProperty property, OntIndividual individual)
    • createDataHasValue

      public OntClass.DataHasValue createDataHasValue(OntDataProperty property, org.apache.jena.rdf.model.Literal literal)
    • createObjectMinCardinality

      public OntClass.ObjectMinCardinality createObjectMinCardinality(OntObjectProperty property, int cardinality, OntClass ce)
    • createDataMinCardinality

      public OntClass.DataMinCardinality createDataMinCardinality(OntDataProperty property, int cardinality, OntDataRange dr)
    • createObjectMaxCardinality

      public OntClass.ObjectMaxCardinality createObjectMaxCardinality(OntObjectProperty property, int cardinality, OntClass ce)
    • createDataMaxCardinality

      public OntClass.DataMaxCardinality createDataMaxCardinality(OntDataProperty property, int cardinality, OntDataRange dr)
    • createObjectCardinality

      public OntClass.ObjectCardinality createObjectCardinality(OntObjectProperty property, int cardinality, OntClass ce)
    • createDataCardinality

      public OntClass.DataCardinality createDataCardinality(OntDataProperty property, int cardinality, OntDataRange dr)
    • createObjectUnionOf

      public OntClass.UnionOf createObjectUnionOf(Collection<OntClass> classes)
    • createObjectIntersectionOf

      public OntClass.IntersectionOf createObjectIntersectionOf(Collection<OntClass> classes)
    • createObjectOneOf

      public OntClass.OneOf createObjectOneOf(Collection<OntIndividual> individuals)
    • createHasSelf

      public OntClass.HasSelf createHasSelf(OntObjectProperty property)
    • createDataAllValuesFrom

      public OntClass.NaryDataAllValuesFrom createDataAllValuesFrom(Collection<OntDataProperty> properties, OntDataRange dr)
    • createDataSomeValuesFrom

      public OntClass.NaryDataSomeValuesFrom createDataSomeValuesFrom(Collection<OntDataProperty> properties, OntDataRange dr)
    • createObjectComplementOf

      public OntClass.ComplementOf createObjectComplementOf(OntClass ce)
    • createSWRLVariable

      public OntSWRL.Variable createSWRLVariable(String uri)
    • createBuiltInSWRLAtom

      public OntSWRL.Atom.WithBuiltin createBuiltInSWRLAtom(org.apache.jena.rdf.model.Resource predicate, Collection<OntSWRL.DArg> arguments)
    • createClassSWRLAtom

      public OntSWRL.Atom.WithClass createClassSWRLAtom(OntClass clazz, OntSWRL.IArg arg)
    • createDataRangeSWRLAtom

      public OntSWRL.Atom.WithDataRange createDataRangeSWRLAtom(OntDataRange range, OntSWRL.DArg arg)
    • createDataPropertySWRLAtom

      public OntSWRL.Atom.WithDataProperty createDataPropertySWRLAtom(OntDataProperty dataProperty, OntSWRL.IArg firstArg, OntSWRL.DArg secondArg)
    • createObjectPropertySWRLAtom

      public OntSWRL.Atom.WithObjectProperty createObjectPropertySWRLAtom(OntObjectProperty dataProperty, OntSWRL.IArg firstArg, OntSWRL.IArg secondArg)
    • createDifferentIndividualsSWRLAtom

      public OntSWRL.Atom.WithDifferentIndividuals createDifferentIndividualsSWRLAtom(OntSWRL.IArg firstArg, OntSWRL.IArg secondArg)
    • createSameIndividualsSWRLAtom

      public OntSWRL.Atom.WithSameIndividuals createSameIndividualsSWRLAtom(OntSWRL.IArg firstArg, OntSWRL.IArg secondArg)
    • createSWRLImp

      public OntSWRL.Imp createSWRLImp(Collection<OntSWRL.Atom<?>> head, Collection<OntSWRL.Atom<?>> body)
    • getRDFDatatype

      public org.apache.jena.datatypes.RDFDatatype getRDFDatatype(String uri)
    • getPrefixMapping

      public org.apache.jena.shared.PrefixMapping getPrefixMapping()
    • setNsPrefix

      public OntGraphModelImpl setNsPrefix(String prefix, String uri)
      Specified by:
      setNsPrefix in interface org.apache.jena.rdf.model.Model
      Specified by:
      setNsPrefix in interface org.apache.jena.shared.PrefixMapping
      Overrides:
      setNsPrefix in class org.apache.jena.rdf.model.impl.ModelCom
    • removeNsPrefix

      public OntGraphModelImpl removeNsPrefix(String prefix)
      Specified by:
      removeNsPrefix in interface org.apache.jena.rdf.model.Model
      Specified by:
      removeNsPrefix in interface org.apache.jena.shared.PrefixMapping
      Overrides:
      removeNsPrefix in class org.apache.jena.rdf.model.impl.ModelCom
    • clearNsPrefixMap

      public OntGraphModelImpl clearNsPrefixMap()
      Specified by:
      clearNsPrefixMap in interface org.apache.jena.rdf.model.Model
      Specified by:
      clearNsPrefixMap in interface org.apache.jena.shared.PrefixMapping
      Overrides:
      clearNsPrefixMap in class org.apache.jena.rdf.model.impl.ModelCom
    • setNsPrefixes

      public OntGraphModelImpl setNsPrefixes(org.apache.jena.shared.PrefixMapping pm)
      Specified by:
      setNsPrefixes in interface org.apache.jena.rdf.model.Model
      Specified by:
      setNsPrefixes in interface org.apache.jena.shared.PrefixMapping
      Overrides:
      setNsPrefixes in class org.apache.jena.rdf.model.impl.ModelCom
    • setNsPrefixes

      public OntGraphModelImpl setNsPrefixes(Map<String,String> map)
      Specified by:
      setNsPrefixes in interface org.apache.jena.rdf.model.Model
      Specified by:
      setNsPrefixes in interface org.apache.jena.shared.PrefixMapping
      Overrides:
      setNsPrefixes in class org.apache.jena.rdf.model.impl.ModelCom
    • withDefaultMappings

      public OntGraphModelImpl withDefaultMappings(org.apache.jena.shared.PrefixMapping other)
      Specified by:
      withDefaultMappings in interface org.apache.jena.rdf.model.Model
      Specified by:
      withDefaultMappings in interface org.apache.jena.shared.PrefixMapping
      Overrides:
      withDefaultMappings in class org.apache.jena.rdf.model.impl.ModelCom
    • lock

      public OntGraphModelImpl lock()
      Specified by:
      lock in interface org.apache.jena.shared.PrefixMapping
      Overrides:
      lock in class org.apache.jena.rdf.model.impl.ModelCom
    • add

      public OntGraphModelImpl add(org.apache.jena.rdf.model.Statement s)
      Specified by:
      add in interface org.apache.jena.rdf.model.Model
      Overrides:
      add in class org.apache.jena.rdf.model.impl.ModelCom
    • remove

      public OntGraphModelImpl remove(org.apache.jena.rdf.model.Statement s)
      Specified by:
      remove in interface org.apache.jena.rdf.model.Model
      Overrides:
      remove in class org.apache.jena.rdf.model.impl.ModelCom
    • add

      public OntGraphModelImpl add(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.RDFNode o)
      Specified by:
      add in interface org.apache.jena.rdf.model.ModelCon
      Overrides:
      add in class org.apache.jena.rdf.model.impl.ModelCom
    • remove

      public OntGraphModelImpl remove(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.RDFNode o)
      Specified by:
      remove in interface org.apache.jena.rdf.model.ModelCon
      Overrides:
      remove in class org.apache.jena.rdf.model.impl.ModelCom
    • add

      public OntGraphModelImpl add(org.apache.jena.rdf.model.Model data)
      Specified by:
      add in interface org.apache.jena.rdf.model.Model
      Overrides:
      add in class org.apache.jena.rdf.model.impl.ModelCom
    • remove

      public OntGraphModelImpl remove(org.apache.jena.rdf.model.Model data)
      Specified by:
      remove in interface org.apache.jena.rdf.model.ModelCon
      Overrides:
      remove in class org.apache.jena.rdf.model.impl.ModelCom
    • add

      public OntGraphModelImpl add(org.apache.jena.rdf.model.StmtIterator iter)
      Specified by:
      add in interface org.apache.jena.rdf.model.Model
      Overrides:
      add in class org.apache.jena.rdf.model.impl.ModelCom
    • remove

      public OntGraphModelImpl remove(org.apache.jena.rdf.model.StmtIterator iter)
      Specified by:
      remove in interface org.apache.jena.rdf.model.ModelCon
      Overrides:
      remove in class org.apache.jena.rdf.model.impl.ModelCom
    • add

      public OntGraphModelImpl add(org.apache.jena.rdf.model.Statement[] statements)
      Specified by:
      add in interface org.apache.jena.rdf.model.Model
      Overrides:
      add in class org.apache.jena.rdf.model.impl.ModelCom
    • remove

      public OntGraphModelImpl remove(org.apache.jena.rdf.model.Statement[] statements)
      Specified by:
      remove in interface org.apache.jena.rdf.model.Model
      Overrides:
      remove in class org.apache.jena.rdf.model.impl.ModelCom
    • add

      public OntGraphModelImpl add(List<org.apache.jena.rdf.model.Statement> statements)
      Specified by:
      add in interface org.apache.jena.rdf.model.Model
      Overrides:
      add in class org.apache.jena.rdf.model.impl.ModelCom
    • remove

      public OntGraphModelImpl remove(List<org.apache.jena.rdf.model.Statement> statements)
      Specified by:
      remove in interface org.apache.jena.rdf.model.Model
      Overrides:
      remove in class org.apache.jena.rdf.model.impl.ModelCom
    • removeAll

      public OntGraphModelImpl removeAll(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.RDFNode o)
      Specified by:
      removeAll in interface org.apache.jena.rdf.model.Model
      Overrides:
      removeAll in class org.apache.jena.rdf.model.impl.ModelCom
    • removeAll

      public OntGraphModelImpl removeAll()
      Specified by:
      removeAll in interface org.apache.jena.rdf.model.Model
      Overrides:
      removeAll in class org.apache.jena.rdf.model.impl.ModelCom
    • addLiteral

      public OntGraphModelImpl addLiteral(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, boolean v)
      Specified by:
      addLiteral in interface org.apache.jena.rdf.model.ModelCon
      Overrides:
      addLiteral in class org.apache.jena.rdf.model.impl.ModelCom
    • addLiteral

      public OntGraphModelImpl addLiteral(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, long v)
      Specified by:
      addLiteral in interface org.apache.jena.rdf.model.ModelCon
      Overrides:
      addLiteral in class org.apache.jena.rdf.model.impl.ModelCom
    • addLiteral

      public OntGraphModelImpl addLiteral(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, int v)
      Specified by:
      addLiteral in interface org.apache.jena.rdf.model.ModelCon
      Overrides:
      addLiteral in class org.apache.jena.rdf.model.impl.ModelCom
    • addLiteral

      public OntGraphModelImpl addLiteral(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, char v)
      Specified by:
      addLiteral in interface org.apache.jena.rdf.model.ModelCon
      Overrides:
      addLiteral in class org.apache.jena.rdf.model.impl.ModelCom
    • addLiteral

      public OntGraphModelImpl addLiteral(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, float v)
      Specified by:
      addLiteral in interface org.apache.jena.rdf.model.ModelCon
      Overrides:
      addLiteral in class org.apache.jena.rdf.model.impl.ModelCom
    • addLiteral

      public OntGraphModelImpl addLiteral(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, double v)
      Specified by:
      addLiteral in interface org.apache.jena.rdf.model.ModelCon
      Overrides:
      addLiteral in class org.apache.jena.rdf.model.impl.ModelCom
    • addLiteral

      public OntGraphModelImpl addLiteral(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.Literal o)
      Specified by:
      addLiteral in interface org.apache.jena.rdf.model.ModelCon
      Overrides:
      addLiteral in class org.apache.jena.rdf.model.impl.ModelCom
    • add

      public OntGraphModelImpl add(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, String lex)
      Specified by:
      add in interface org.apache.jena.rdf.model.ModelCon
      Overrides:
      add in class org.apache.jena.rdf.model.impl.ModelCom
    • add

      public OntGraphModelImpl add(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, String lex, org.apache.jena.datatypes.RDFDatatype datatype)
      Specified by:
      add in interface org.apache.jena.rdf.model.ModelCon
      Overrides:
      add in class org.apache.jena.rdf.model.impl.ModelCom
    • add

      public OntGraphModelImpl add(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, String lex, String lang)
      Specified by:
      add in interface org.apache.jena.rdf.model.ModelCon
      Overrides:
      add in class org.apache.jena.rdf.model.impl.ModelCom
    • read

      public OntGraphModelImpl read(String url)
      Specified by:
      read in interface org.apache.jena.rdf.model.Model
      Overrides:
      read in class org.apache.jena.rdf.model.impl.ModelCom
    • read

      public OntGraphModelImpl read(Reader reader, String base)
      Specified by:
      read in interface org.apache.jena.rdf.model.Model
      Overrides:
      read in class org.apache.jena.rdf.model.impl.ModelCom
    • read

      public OntGraphModelImpl read(InputStream reader, String base)
      Specified by:
      read in interface org.apache.jena.rdf.model.Model
      Overrides:
      read in class org.apache.jena.rdf.model.impl.ModelCom
    • read

      public OntGraphModelImpl read(String url, String lang)
      Specified by:
      read in interface org.apache.jena.rdf.model.Model
      Overrides:
      read in class org.apache.jena.rdf.model.impl.ModelCom
    • read

      public OntGraphModelImpl read(String url, String base, String lang)
      Specified by:
      read in interface org.apache.jena.rdf.model.Model
      Overrides:
      read in class org.apache.jena.rdf.model.impl.ModelCom
    • read

      public OntGraphModelImpl read(Reader reader, String base, String lang)
      Specified by:
      read in interface org.apache.jena.rdf.model.Model
      Overrides:
      read in class org.apache.jena.rdf.model.impl.ModelCom
    • read

      public OntGraphModelImpl read(InputStream reader, String base, String lang)
      Specified by:
      read in interface org.apache.jena.rdf.model.Model
      Overrides:
      read in class org.apache.jena.rdf.model.impl.ModelCom
    • write

      public OntGraphModelImpl write(Writer writer)
      Specified by:
      write in interface org.apache.jena.rdf.model.Model
      Overrides:
      write in class org.apache.jena.rdf.model.impl.ModelCom
    • write

      public OntGraphModelImpl write(Writer writer, String lang)
      Specified by:
      write in interface org.apache.jena.rdf.model.Model
      Overrides:
      write in class org.apache.jena.rdf.model.impl.ModelCom
    • write

      public OntGraphModelImpl write(Writer writer, String lang, String base)
      Specified by:
      write in interface org.apache.jena.rdf.model.Model
      Overrides:
      write in class org.apache.jena.rdf.model.impl.ModelCom
    • write

      public OntGraphModelImpl write(OutputStream out)
      Specified by:
      write in interface org.apache.jena.rdf.model.Model
      Overrides:
      write in class org.apache.jena.rdf.model.impl.ModelCom
    • write

      public OntGraphModelImpl write(OutputStream out, String lang)
      Specified by:
      write in interface org.apache.jena.rdf.model.Model
      Overrides:
      write in class org.apache.jena.rdf.model.impl.ModelCom
    • write

      public OntGraphModelImpl write(OutputStream out, String lang, String base)
      Specified by:
      write in interface org.apache.jena.rdf.model.Model
      Overrides:
      write in class org.apache.jena.rdf.model.impl.ModelCom
    • writeAll

      public OntModel writeAll(Writer writer, String lang, String base)
    • writeAll

      public OntModel writeAll(Writer writer, String lang)
    • writeAll

      public OntModel writeAll(OutputStream out, String lang, String base)
    • writeAll

      public OntModel writeAll(OutputStream out, String lang)
    • getRDFSComment

      public OntAnnotationProperty getRDFSComment()
      Specified by:
      getRDFSComment in interface OntModel
    • getRDFSLabel

      public OntAnnotationProperty getRDFSLabel()
      Specified by:
      getRDFSLabel in interface OntModel
    • getOWLThing

      public OntClass.Named getOWLThing()
      Specified by:
      getOWLThing in interface OntModel
    • getRDFSLiteral

      public OntDataRange.Named getRDFSLiteral()
      Specified by:
      getRDFSLiteral in interface OntModel
    • getOWLNothing

      public OntClass.Named getOWLNothing()
      Specified by:
      getOWLNothing in interface OntModel
    • getOWLTopObjectProperty

      public OntObjectProperty.Named getOWLTopObjectProperty()
      Specified by:
      getOWLTopObjectProperty in interface OntModel
    • getOWLBottomObjectProperty

      public OntObjectProperty.Named getOWLBottomObjectProperty()
      Specified by:
      getOWLBottomObjectProperty in interface OntModel
    • getOWLTopDataProperty

      public OntDataProperty getOWLTopDataProperty()
      Specified by:
      getOWLTopDataProperty in interface OntModel
    • getOWLBottomDataProperty

      public OntDataProperty getOWLBottomDataProperty()
      Specified by:
      getOWLBottomDataProperty in interface OntModel
    • getReasoner

      public org.apache.jena.reasoner.Reasoner getReasoner()
      Returns the Reasoner which is being used to answer queries to this graph or null if reasoner is not supported by the model.
      Specified by:
      getReasoner in interface org.apache.jena.rdf.model.InfModel
    • setDerivationLogging

      public void setDerivationLogging(boolean logOn)
      Switches on/off derivation logging. If this option is enabled, then each time a derivation is made, that fact is recorded, and the resulting record can be accessed through a later call to getDerivation. This can take up a lot of space!
      Specified by:
      setDerivationLogging in interface org.apache.jena.rdf.model.InfModel
    • getDerivation

      public Iterator<org.apache.jena.reasoner.Derivation> getDerivation(org.apache.jena.rdf.model.Statement statement)
      Returns the derivation of the given statement (which should be the result of some previous list operation). Not all reasoners support derivations.
      Specified by:
      getDerivation in interface org.apache.jena.rdf.model.InfModel
      Parameters:
      statement - Statement to get derivation information
      Returns:
      an iterator over Derivation records or null if there is no derivation information available for this triple
      See Also:
      • Derivation
    • getInfGraph

      public org.apache.jena.reasoner.InfGraph getInfGraph()
      Returns InfGraph or null if no-inf model
      Returns:
      InfGraph
    • rebind

      public void rebind()
      Causes the inference model to reconsult the underlying data to take into account changes. Normally, changes are made through the InfModel's, add and remove calls are will be handled appropriately. However, in some cases, changes are made behind the InfModel's back and this forces a full reconsult of the changed data.
      Specified by:
      rebind in interface org.apache.jena.rdf.model.InfModel
    • prepare

      public void prepare()
      Performs any initial processing and caching. This call is optional. Most engines either have negligible set-up work or will perform an implicit "prepare" if necessary. The call is provided for those occasions where substantial preparation work is possible (e.g. running a forward chaining rule system) and where an application might wish greater control over when this preparation is done rather than just leaving to be done at first query time.
      Specified by:
      prepare in interface org.apache.jena.rdf.model.InfModel
    • reset

      public void reset()
      Resets any internal caches. Some systems, such as the tabled backchainer, retain information after each query. A reset will wipe this information preventing unbounded memory use at the expense of more expensive future queries. A reset does not cause the raw data to be reconsulted and so is less expensive than a rebinding.
      Specified by:
      reset in interface org.apache.jena.rdf.model.InfModel
    • validate

      public org.apache.jena.reasoner.ValidityReport validate()
      Tests the consistency of the underlying data. This normally tests the validity of the bound instance data against the bound schema data.
      Specified by:
      validate in interface org.apache.jena.rdf.model.InfModel
      Returns:
      a ValidityReport structure
    • listStatements

      public org.apache.jena.rdf.model.StmtIterator listStatements(org.apache.jena.rdf.model.Resource subject, org.apache.jena.rdf.model.Property predicate, org.apache.jena.rdf.model.RDFNode object, org.apache.jena.rdf.model.Model posit)
      Finds all the statements matching a pattern. Returns an iterator over all the statements in a model that match a pattern.

      The SPO terms may refer to resources which are temporarily defined in the "posit" model. This allows one, for example, to query what resources are of type CE where CE is a class expression rather than a named class - put CE in the posit arg.

      Specified by:
      listStatements in interface org.apache.jena.rdf.model.InfModel
      Parameters:
      subject - The subject sought
      predicate - The predicate sought
      object - The value sought
      posit - Model containing additional assertions to be considered when matching statements
      Returns:
      an iterator over the subjects
    • asInferenceModel

      public org.apache.jena.rdf.model.InfModel asInferenceModel()
      Description copied from interface: OntModel
      Returns a view of this model that supports inference, if possible.
      Specified by:
      asInferenceModel in interface OntModel
      Returns:
      InfModel, not null
    • getDeductionsModel

      public org.apache.jena.rdf.model.Model getDeductionsModel()
      Returns a derivations model. The rule reasoners typically create a graph containing those triples added to the base graph due to rule firings. In some applications, it can be useful to be able to access those deductions directly, without seeing the raw data which triggered them. In particular, this allows the forward rules to be used as if they were rewrite transformation rules.
      Specified by:
      getDeductionsModel in interface org.apache.jena.rdf.model.InfModel
      Returns:
      The derivation model, if one is defined, or else null
    • getRawModel

      public org.apache.jena.rdf.model.Model getRawModel()
      Returns the raw RDF model being processed (i.e. the argument to the Reasoner.bind(Graph) call that created this InfModel).
      Specified by:
      getRawModel in interface org.apache.jena.rdf.model.InfModel
    • findNodeAs

      public <N extends org.apache.jena.rdf.model.RDFNode> N findNodeAs(org.apache.jena.graph.Node node, Class<N> type)
      Returns a RDFNode for the given type and, if the result is present, caches it node at the model level. The method works silently: normally no exception is expected.
      Specified by:
      findNodeAs in interface OntEnhGraph
      Type Parameters:
      N - any subtype of RDFNode
      Parameters:
      node - Node
      type - Class-type
      Returns:
      RDFNode or null
      Throws:
      RuntimeException - unexpected misconfiguration (RDF recursion, wrong input, personality mismatch, etc.)
      See Also:
    • getNodeAs

      public <N extends org.apache.jena.rdf.model.RDFNode> N getNodeAs(org.apache.jena.graph.Node node, Class<N> type)
      Answers an enhanced node that wraps the given node and conforms to the given interface type. The returned RDF node is cached at the model-level.
      Specified by:
      getNodeAs in interface OntEnhGraph
      Overrides:
      getNodeAs in class org.apache.jena.enhanced.EnhGraph
      Type Parameters:
      N - a subtype of RDFNode
      Parameters:
      node - a node (assumed to be in this graph)
      type - a type denoting the enhanced facet desired
      Returns:
      an enhanced node, cannot be null
      Throws:
      OntJenaException - unable to construct new RDF view for whatever reason
      RuntimeException - unexpected misconfiguration (wrong inputs, personality mismatch)
      See Also:
    • safeFindNodeAs

      public <N extends org.apache.jena.rdf.model.RDFNode> N safeFindNodeAs(org.apache.jena.graph.Node node, Class<N> type)
      Answers an enhanced node that wraps the given node and conforms to the given interface type, taking into account possible graph recursions. For internal usage only.
      Specified by:
      safeFindNodeAs in interface OntEnhGraph
      Type Parameters:
      N - a subtype of RDFNode
      Parameters:
      node - a node (assumed to be in this graph)
      type - a type denoting the enhanced facet desired
      Returns:
      an enhanced node or null if no match found
      Throws:
      OntJenaException.Recursion - if a graph recursion is detected
      RuntimeException - unexpected misconfiguration
      See Also:
    • createObjectIntersectionOf

      default OntClass.IntersectionOf createObjectIntersectionOf(OntClass... classes)
      Creates an Intersection of Class Expressions.
      Parameters:
      classes - Array of class expressions without nulls
      Returns:
      OntClass.IntersectionOf
      See Also:
    • createObjectUnionOf

      default OntClass.UnionOf createObjectUnionOf(OntClass... classes)
      Creates a Union of Class Expressions.
      Parameters:
      classes - Array of class expressions without nulls
      Returns:
      OntClass.UnionOf
      See Also:
    • createObjectOneOf

      default OntClass.OneOf createObjectOneOf(OntIndividual... individuals)
      Creates an Enumeration of Individuals.
      Parameters:
      individuals - Array of individuals without nulls
      Returns:
      OntClass.OneOf
      See Also:
    • createDataOneOf

      default OntDataRange.OneOf createDataOneOf(org.apache.jena.rdf.model.Literal... values)
      Creates an Enumeration of Literals.
      Parameters:
      values - Array of literals, without null-elements
      Returns:
      OntDataRange.OneOf
      See Also:
    • createDataRestriction

      default OntDataRange.Restriction createDataRestriction(OntDataRange.Named other, OntFacetRestriction... values)
      Creates a Datatype Restriction.
      Parameters:
      other - Named Data Range, not null
      values - Array of facet restrictions, without nulls
      Returns:
      OntDataRange.Restriction
      See Also:
    • createDataUnionOf

      default OntDataRange.UnionOf createDataUnionOf(OntDataRange... values)
      Creates a Union of Data Ranges.
      Parameters:
      values - Collection of data ranges, without null-elements
      Returns:
      OntDataRange.UnionOf
      See Also:
    • createDataIntersectionOf

      default OntDataRange.IntersectionOf createDataIntersectionOf(OntDataRange... values)
      Creates an Intersection of Data Ranges.
      Parameters:
      values - Array of data ranges, without null-elements
      Returns:
      OntDataRange.IntersectionOf
      See Also:
    • createDisjointClasses

      default OntDisjoint.Classes createDisjointClasses(OntClass... classes)
      Creates a Disjoint Classes Axiom Resource.
      Parameters:
      classes - Array of Class Expressions without null-elements
      Returns:
      OntDisjoint.Classes
      See Also:
    • createDifferentIndividuals

      default OntDisjoint.Individuals createDifferentIndividuals(OntIndividual... individuals)
      Creates a Different Individuals Axiom Resource.
      Parameters:
      individuals - Array of individuals without null-elements
      Returns:
      OntDisjoint.Individuals
      See Also:
    • createDisjointObjectProperties

      default OntDisjoint.ObjectProperties createDisjointObjectProperties(OntObjectProperty... properties)
      Creates a Disjoint Object Properties Axiom Resource.
      Parameters:
      properties - Array of Object Property Expressions without null-elements
      Returns:
      OntDisjoint.ObjectProperties
      See Also:
    • createDisjointDataProperties

      default OntDisjoint.DataProperties createDisjointDataProperties(OntDataProperty... properties)
      Creates a Disjoint Data Properties Axiom Resource.
      Parameters:
      properties - Array of Data Properties without null-elements
      Returns:
      OntDisjoint.DataProperties
      See Also: