Interface OntModel

All Superinterfaces:
org.apache.jena.shared.Lock, org.apache.jena.rdf.model.Model, org.apache.jena.rdf.model.ModelCon, org.apache.jena.rdf.model.ModelGraphInterface, org.apache.jena.shared.PrefixMapping, org.apache.jena.rdf.model.RDFReaderF, org.apache.jena.rdf.model.RDFWriterF
All Known Implementing Classes:
OntGraphModelImpl

public interface OntModel extends org.apache.jena.rdf.model.Model
An enhanced view of a Jena Model about which is known to contain OWL or RDFS ontology data. The view supports OWL2 DL specification, and is an analogue of Apache Jena OntModel, which only covers the OWL1 syntax.

In addition to the standard Jena Resources and Jena Statements this model provides access to different ontological components in the form of Objects and Ontology Statements that support OWL Annotations. Some of the OntObjects can be constructed using another kind of resource - OntList, which is an extended analogue of the standard Jena RDFList.

The model also has a component-level support of Semantic Web Rule Language (SWRL).

In additional to native Jena Extended Iterators, this model also provides access to RDF in the form of Streams, that obey the same rules: both Stream and ExtendedIterator must be closed explicitly if they are no longer needed but not yet exhausted, see ClosableIterator.

Impl note: this model does not support Jena Profiles mechanism, and model configuration is delegated directly to the extended Personality.

The interface does not extend InfModel, but the inference model can be accessed via asInferenceModel(). If implementation does not provide inference support, the method will throw an exception.

See Also:
  • Method Details

    • getBaseGraph

      org.apache.jena.graph.Graph getBaseGraph()
      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().
      Returns:
      Graph
      See Also:
      • ModelGraphInterface.getGraph()
    • id

      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.

      Returns:
      an Optional that contains the OntID
      See Also:
    • setID

      OntID setID(String uri)
      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.
      Parameters:
      uri - String, can be null to make this ontology to be anonymous
      Returns:
      the new OntID instance
      Throws:
      OntJenaException - if ontology can't be added (e.g. due to collision with imports)
      See Also:
    • addImport

      OntModel addImport(OntModel m) throws OntJenaException
      Adds a sub-model both to the owl:import section and to the graph hierarchy.
      Parameters:
      m - ont jena model to add, not null
      Returns:
      this model to allow cascading calls
      Throws:
      OntJenaException - if specified, ontology is anonymous or already present in the imports (both as graph and in owl-declaration)
      See Also:
    • removeImport

      OntModel removeImport(OntModel m)
      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 hasImport(OntModel) description).
      Parameters:
      m - ont jena model to remove, not null
      Returns:
      this model to allow cascading calls
      See Also:
    • removeImport

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

      Stream<OntModel> imports()
      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.
      Returns:
      Stream of OntModels
      See Also:
    • hasImport

      boolean hasImport(OntModel other)
      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 hasImport(String) returns true, it does not mean this method also returns true.
      Parameters:
      other - OntModel to test, not null
      Returns:
      true if the model is in imports
    • hasImport

      boolean hasImport(String uri)
      Answers true if the model has a graph with the given uri both in owl:imports and graph-hierarchy.
      Parameters:
      uri - String, not null
      Returns:
      boolean
      See Also:
    • ontObjects

      <O extends OntObject> Stream<O> ontObjects(Class<? extends O> type)
      Lists all ont-objects of the specified type. Note: this method may return non-distinct results, it is implementation dependent.
      Type Parameters:
      O - any ont-object subtype
      Parameters:
      type - Class the concrete type of OntObject, not null
      Returns:
      Stream of OntObjects of the type O
      See Also:
    • ontEntities

      Stream<OntEntity> ontEntities()
      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.
      Returns:
      Stream of OntEntity
      See Also:
    • individuals

      Stream<OntIndividual> individuals()
      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 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 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.

      Returns:
      Stream of OntIndividuals
      See Also:
    • getOntEntity

      <E extends OntEntity> E getOntEntity(Class<E> type, String uri)
      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.
      Type Parameters:
      E - type of ont-entity
      Parameters:
      type - Class, the type of OntEntity, not null.
      uri - String, not null.
      Returns:
      OntEntity or null
      See Also:
    • statements

      Stream<OntStatement> statements()
      Lists all ont-statements.
      Returns:
      Stream of OntStatement
      See Also:
      • Model.listStatements()
    • statements

      Stream<OntStatement> statements(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.RDFNode o)
      Lists all statements for the specified subject, predicate and object (SPO).
      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

      Stream<OntStatement> localStatements(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.RDFNode o)
      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.
      Parameters:
      s - Resource, the subject
      p - Property, the predicate
      o - RDFNode, the object
      Returns:
      Stream of OntStatement
      See Also:
    • asStatement

      OntStatement asStatement(org.apache.jena.graph.Triple triple)
      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
      Parameters:
      triple - Triple, not null
      Returns:
      OntStatement
    • removeOntObject

      OntModel removeOntObject(OntObject obj)
      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.
      Parameters:
      obj - OntObject
      Returns:
      this model
      See Also:
    • removeOntStatement

      OntModel removeOntStatement(OntStatement statement)
      Removes the statement from the graph-model including its annotations with sub-annotations hierarchy.
      Parameters:
      statement - OntStatement
      Returns:
      this model
      See Also:
      • Model.remove(Statement)
    • createOntEntity

      <E extends OntEntity> E createOntEntity(Class<E> type, String iri)
      Creates an owl-entity by the type and iri.
      Type Parameters:
      E - type of ont-entity
      Parameters:
      type - Class, the type of OntEntity, not null
      iri - String, not null
      Returns:
      OntEntity
      Throws:
      OntJenaException.Creation - in case something is wrong (e.g. configuration does not support creation of the specified type)
      See Also:
    • createFacetRestriction

      <F extends OntFacetRestriction> F createFacetRestriction(Class<F> type, org.apache.jena.rdf.model.Literal literal)
      Creates a facet restriction by the given type and literal value. Each call to this method creates a fresh b-node within the graph.
      Type Parameters:
      F - type of ont-facet-restriction
      Parameters:
      type - Class, the type of OntFacetRestriction, not null
      literal - Literal, not null
      Returns:
      OntFacetRestriction
      See Also:
    • getBaseModel

      org.apache.jena.rdf.model.Model getBaseModel()
      Returns the standard jena model that corresponds to the base graph. Note: there is the Jena Builtin Personality within the returned model.
      Returns:
      Model
      See Also:
    • asInferenceModel

      default org.apache.jena.rdf.model.InfModel asInferenceModel()
      Returns a view of this model that supports inference, if possible.
      Returns:
      InfModel, not null
      Throws:
      OntJenaException.Unsupported - if implementation does not support inference, or there is no reasoner attached to the model
    • getID

      default OntID getID()
      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.

      Returns:
      OntID an existing or fresh Resource, that is subject in the _:x rdf:type owl:Ontology statement
    • createOntClass

      default OntClass.Named createOntClass(String uri)
      Creates named class (owl-entity)
      Parameters:
      uri - IRI of class
      Returns:
      named class
    • createDatatype

      default OntDataRange.Named createDatatype(String uri)
      Creates named datatype (owl-entity), only for OWL2
      Parameters:
      uri - IRI of datarange
      Returns:
      named datarange
    • createIndividual

      default OntIndividual.Named createIndividual(String uri)
      Creates named individual (owl-entity), only for OWL2 if owl:NamedIndividual is enabled.
      Parameters:
      uri - IRI of individual
      Returns:
      named individual
    • createRDFProperty

      default OntProperty createRDFProperty(String uri)
      Creates named rdf:Property.
      Parameters:
      uri - <uri> a rdf:Property
      Returns:
      OntProperty
    • createAnnotationProperty

      default OntAnnotationProperty createAnnotationProperty(String uri)
      Creates annotation property (owl-entity).
      Parameters:
      uri - IRI of annotation property
      Returns:
      annotation property
    • createDataProperty

      default OntDataProperty createDataProperty(String uri)
      Creates datatype property (owl-entity).
      Parameters:
      uri - IRI of datatype property
      Returns:
      datatype property
    • createObjectProperty

      default OntObjectProperty.Named createObjectProperty(String uri)
      Creates named object property (owl-entity).
      Parameters:
      uri - IRI of object property
      Returns:
      named object property
    • createIndividual

      default OntIndividual createIndividual(String uri, OntClass type)
      Creates individual (named or anonymous) of the specified type.
      Parameters:
      uri - String, or null for anonymous individual
      type - OntClass
      Returns:
      OntIndividual
    • getOntClass

      default OntClass.Named getOntClass(String uri)
    • getDatatype

      default OntDataRange.Named getDatatype(String uri)
    • getIndividual

      default OntIndividual.Named getIndividual(String uri)
    • getAnnotationProperty

      default OntAnnotationProperty getAnnotationProperty(String uri)
    • getDataProperty

      default OntDataProperty getDataProperty(String uri)
    • getObjectProperty

      default OntObjectProperty.Named getObjectProperty(String uri)
    • getOntClass

      default OntClass.Named getOntClass(org.apache.jena.rdf.model.Resource uri)
    • getDatatype

      default OntDataRange.Named getDatatype(org.apache.jena.rdf.model.Resource uri)
    • getIndividual

      default OntIndividual.Named getIndividual(org.apache.jena.rdf.model.Resource uri)
    • getAnnotationProperty

      default OntAnnotationProperty getAnnotationProperty(org.apache.jena.rdf.model.Resource uri)
    • getDataProperty

      default OntDataProperty getDataProperty(org.apache.jena.rdf.model.Resource uri)
    • getObjectProperty

      default OntObjectProperty.Named getObjectProperty(org.apache.jena.rdf.model.Resource uri)
    • localStatements

      default Stream<OntStatement> localStatements()
    • ontEntities

      default <E extends OntEntity> Stream<E> ontEntities(Class<E> type)
    • getDatatype

      default OntDataRange.Named getDatatype(org.apache.jena.rdf.model.Literal literal)
      Retrieves a datatype from the given literal.
      Parameters:
      literal - Literal, not null
      Returns:
      OntDataRange.Named
    • fetchOntEntity

      default <E extends OntEntity> E fetchOntEntity(Class<E> type, String uri)
      Returns an entity of the given type and with the specified URI, creating it if needed.
      Type Parameters:
      E - any subtype of OntEntity
      Parameters:
      type - a class-type of entity
      uri - String uri, not null
      Returns:
      E
    • classes

      default Stream<OntClass.Named> classes()
      Lists all named class expressions (OWL classes).
      Returns:
      Stream of Ontology Classes
    • hierarchyRoots

      default Stream<OntClass> hierarchyRoots()
      Answers a Stream over the classes in this ontology model that represent the uppermost nodes of the class hierarchy. Built-ins are not included.
      Returns:
      a Stream of the root classes in the local class hierarchy
    • properties

      default Stream<OntProperty> properties()
      Lists all OntProperties. The result includes not only OWL properties (Named and Inverse ObjectProperties, DatatypeProperties, AnnotationProperties), but also RDF-properties (<uri> rdf:type rdf:Property).

      For getting only OWL Properties, use Stream.of(m.objectProperties(), m.dataProperties(), m.annotationProperties()).flatMap(it -> it) . If you need all named properties, use this.ontEntities(OntNamedProperty.class)

      This is analogous of OntModel.listAllOntProperties(). Note that this method does not care about punnings: it will return property even if it has both owl:ObjectProperty and owl:DatatypeProperty declarations and such punning is prohibited in the model settings.

      Returns:
      distinct Stream of OntPropertys
    • annotationProperties

      default Stream<OntAnnotationProperty> annotationProperties()
      Lists all annotation properties.
      Returns:
      Stream of Annotation Propertys
    • dataProperties

      default Stream<OntDataProperty> dataProperties()
      Lists all data properties.
      Returns:
      Stream of Data Propertys
    • objectProperties

      default Stream<OntObjectProperty.Named> objectProperties()
      Lists all named object property expressions (object properties in short).
      Returns:
      Stream of Named Object Propertys
    • datatypes

      default Stream<OntDataRange.Named> datatypes()
      Lists all datatypes (named data range expressions).
      Returns:
      Stream of Ontology Datatypes
    • namedIndividuals

      default Stream<OntIndividual.Named> namedIndividuals()
      Lists all named individuals, i.e. all those individuals which have explicitly owl:NamedIndividual declaration.
      Returns:
      Stream of Named Individuals
      See Also:
    • getOntEntity

      default <E extends OntEntity> E getOntEntity(Class<E> type, org.apache.jena.rdf.model.Resource uri)
      Returns OWL Entity with the specified class-type and uri.
      Type Parameters:
      E - any OntEntity subtype, not null
      Parameters:
      type - Class, not null
      uri - Resource, must be URI, not null
      Returns:
      a E instance
    • getRDFSComment

      default OntAnnotationProperty getRDFSComment()
    • getRDFSLabel

      default OntAnnotationProperty getRDFSLabel()
    • getRDFSSeeAlso

      default OntAnnotationProperty getRDFSSeeAlso()
    • getRDFSIsDefinedBy

      default OntAnnotationProperty getRDFSIsDefinedBy()
    • getOWLDeprecated

      default OntAnnotationProperty getOWLDeprecated()
    • getOWLVersionInfo

      default OntAnnotationProperty getOWLVersionInfo()
    • getOWLPriorVersion

      default OntAnnotationProperty getOWLPriorVersion()
    • getOWLBackwardCompatibleWith

      default OntAnnotationProperty getOWLBackwardCompatibleWith()
    • getOWLIncompatibleWith

      default OntAnnotationProperty getOWLIncompatibleWith()
    • getOWLThing

      default OntClass.Named getOWLThing()
    • getOWLNothing

      default OntClass.Named getOWLNothing()
    • getRDFSLiteral

      default OntDataRange.Named getRDFSLiteral()
    • getOWLTopObjectProperty

      default OntObjectProperty.Named getOWLTopObjectProperty()
    • getOWLBottomObjectProperty

      default OntObjectProperty.Named getOWLBottomObjectProperty()
    • getOWLTopDataProperty

      default OntDataProperty getOWLTopDataProperty()
    • getOWLBottomDataProperty

      default OntDataProperty getOWLBottomDataProperty()
    • add

      OntModel add(org.apache.jena.rdf.model.Statement s)
      Specified by:
      add in interface org.apache.jena.rdf.model.Model
    • add

      OntModel 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
    • add

      OntModel add(org.apache.jena.rdf.model.Model m)
      Specified by:
      add in interface org.apache.jena.rdf.model.Model
    • add

      OntModel add(org.apache.jena.rdf.model.StmtIterator it)
      Specified by:
      add in interface org.apache.jena.rdf.model.Model
    • add

      OntModel add(org.apache.jena.rdf.model.Statement[] statements)
      Specified by:
      add in interface org.apache.jena.rdf.model.Model
    • add

      OntModel add(List<org.apache.jena.rdf.model.Statement> statements)
      Specified by:
      add in interface org.apache.jena.rdf.model.Model
    • remove

      OntModel remove(org.apache.jena.rdf.model.Statement s)
      Specified by:
      remove in interface org.apache.jena.rdf.model.Model
    • remove

      OntModel 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
    • remove

      OntModel remove(org.apache.jena.rdf.model.Model m)
      Specified by:
      remove in interface org.apache.jena.rdf.model.ModelCon
    • remove

      OntModel remove(org.apache.jena.rdf.model.StmtIterator it)
      Specified by:
      remove in interface org.apache.jena.rdf.model.ModelCon
    • removeAll

      OntModel 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
    • remove

      OntModel remove(org.apache.jena.rdf.model.Statement[] statements)
      Specified by:
      remove in interface org.apache.jena.rdf.model.Model
    • remove

      OntModel remove(List<org.apache.jena.rdf.model.Statement> statements)
      Specified by:
      remove in interface org.apache.jena.rdf.model.Model
    • removeAll

      OntModel removeAll()
      Specified by:
      removeAll in interface org.apache.jena.rdf.model.Model
    • addLiteral

      OntModel 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
    • addLiteral

      OntModel 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
    • addLiteral

      OntModel 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
    • addLiteral

      OntModel 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
    • addLiteral

      OntModel 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
    • addLiteral

      OntModel 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
    • addLiteral

      OntModel 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
    • add

      OntModel 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
    • add

      OntModel 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
    • add

      OntModel 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
    • setNsPrefix

      OntModel setNsPrefix(String prefix, String uri)
      Specified by:
      setNsPrefix in interface org.apache.jena.shared.PrefixMapping
    • removeNsPrefix

      OntModel removeNsPrefix(String prefix)
      Specified by:
      removeNsPrefix in interface org.apache.jena.shared.PrefixMapping
    • clearNsPrefixMap

      OntModel clearNsPrefixMap()
      Specified by:
      clearNsPrefixMap in interface org.apache.jena.shared.PrefixMapping
    • setNsPrefixes

      OntModel setNsPrefixes(org.apache.jena.shared.PrefixMapping other)
      Specified by:
      setNsPrefixes in interface org.apache.jena.shared.PrefixMapping
    • setNsPrefixes

      OntModel setNsPrefixes(Map<String,String> map)
      Specified by:
      setNsPrefixes in interface org.apache.jena.shared.PrefixMapping
    • withDefaultMappings

      OntModel withDefaultMappings(org.apache.jena.shared.PrefixMapping map)
      Specified by:
      withDefaultMappings in interface org.apache.jena.shared.PrefixMapping
    • lock

      OntModel lock()
      Specified by:
      lock in interface org.apache.jena.shared.PrefixMapping
    • read

      OntModel read(String url)
      Specified by:
      read in interface org.apache.jena.rdf.model.Model
    • read

      OntModel read(InputStream in, String base)
      Specified by:
      read in interface org.apache.jena.rdf.model.Model
    • read

      OntModel read(InputStream in, String base, String lang)
      Specified by:
      read in interface org.apache.jena.rdf.model.Model
    • read

      OntModel read(Reader reader, String base)
      Specified by:
      read in interface org.apache.jena.rdf.model.Model
    • read

      OntModel read(String url, String lang)
      Specified by:
      read in interface org.apache.jena.rdf.model.Model
    • read

      OntModel read(Reader reader, String base, String lang)
      Specified by:
      read in interface org.apache.jena.rdf.model.Model
    • read

      OntModel read(String url, String base, String lang)
      Specified by:
      read in interface org.apache.jena.rdf.model.Model
    • write

      OntModel write(Writer writer)
      Writes a serialized representation of a model in a specified language. Note(1): this method is adapted for the ontology model to write out only the base model (which contains the asserted data). To write all triples, including imported data and inferred triples, use writeAll . Note(2): it is often better to use an OutputStream rather than a Writer, since this will avoid character encoding errors.

      The language in which to write the model is specified by the lang argument. Some of the supported formats are "RDF/XML", "RDF/XML-ABBREV", "N-TRIPLE", "TURTLE". See Lang for all supported formats. The default value, represented by null, is "RDF/XML".

      Specified by:
      write in interface org.apache.jena.rdf.model.Model
      Parameters:
      writer - the output writer
      Returns:
      this model
    • write

      OntModel write(Writer writer, String lang)
      Writes a serialized representation of a model in a specified language. Note(1): this method is adapted for the ontology model to write out only the base model (which contains the asserted data). To write all triples, including imported data and inferred triples, use writeAll . Note(2): it is often better to use an OutputStream rather than a Writer, since this will avoid character encoding errors.

      The language in which to write the model is specified by the lang argument. Some of the supported formats are "RDF/XML", "RDF/XML-ABBREV", "N-TRIPLE", "TURTLE". See Lang for all supported formats. The default value, represented by null, is "RDF/XML".

      Specified by:
      write in interface org.apache.jena.rdf.model.Model
      Parameters:
      writer - the output writer
      lang - the language in which the RDF should be written
      Returns:
      this model
    • write

      OntModel write(Writer writer, String lang, String base)
      Writes a serialized representation of a model in a specified language. Note(1): this method is adapted for the ontology model to write out only the base model (which contains the asserted data). To write all triples, including imported data and inferred triples, use writeAll . Note(2): it is often better to use an OutputStream rather than a Writer, since this will avoid character encoding errors.

      The language in which to write the model is specified by the lang argument. Some of the supported formats are "RDF/XML", "RDF/XML-ABBREV", "N-TRIPLE", "TURTLE". See Lang for all supported formats. The default value, represented by null, is "RDF/XML".

      Specified by:
      write in interface org.apache.jena.rdf.model.Model
      Parameters:
      writer - the output writer
      lang - the language in which the RDF should be written
      base - the base URI for relative URI calculations; null means use only absolute URI's.
      Returns:
      this model
    • write

      OntModel write(OutputStream out)
      Writes a serialized representation of a model in a specified language. Note: this method is adapted for the ontology model to write out only the base model (which contains the asserted data). To write all triples, including imported data and inferred triples, use writeAll .

      The language in which to write the model is specified by the lang argument. Some of the supported formats are "RDF/XML", "RDF/XML-ABBREV", "N-TRIPLE", "TURTLE". See Lang for all supported formats. The default value, represented by null, is "RDF/XML".

      Specified by:
      write in interface org.apache.jena.rdf.model.Model
      Parameters:
      out - tre output stream to which the RDF is written
      Returns:
      this model
    • write

      OntModel write(OutputStream out, String lang)
      Writes a serialized representation of a model in a specified language. Note: this method is adapted for the ontology model to write out only the base model (which contains the asserted data). To write all triples, including imported data and inferred triples, use writeAll .

      The language in which to write the model is specified by the lang argument. Some of the supported formats are "RDF/XML", "RDF/XML-ABBREV", "N-TRIPLE", "TURTLE". See Lang for all supported formats. The default value, represented by null, is "RDF/XML".

      Specified by:
      write in interface org.apache.jena.rdf.model.Model
      Parameters:
      out - tre output stream to which the RDF is written
      lang - the language in which the RDF should be written
      Returns:
      this model
    • write

      OntModel write(OutputStream out, String lang, String base)
      Writes a serialized representation of a model in a specified language. Note: this method is adapted for the ontology model to write out only the base model (which contains the asserted data). To write all triples, including imported data and inferred triples, use writeAll .

      The language in which to write the model is specified by the lang argument. Some of the supported formats are "RDF/XML", "RDF/XML-ABBREV", "N-TRIPLE", "TURTLE". See Lang for all supported formats. The default value, represented by null, is "RDF/XML".

      Specified by:
      write in interface org.apache.jena.rdf.model.Model
      Parameters:
      out - tre output stream to which the RDF is written
      lang - the language in which the RDF should be written
      base - the base URI for relative URI calculations; null means use only absolute URI's.
      Returns:
      this model
    • writeAll

      OntModel writeAll(Writer writer, String lang, String base)
      Writes a serialized representation of all the model's contents, including inferred statements and statements imported from other documents. To write only the data asserted in the base model, use write. Note: it is often better to use an OutputStream rather than a Writer, since this will avoid character encoding errors.

      The language in which to write the model is specified by the lang argument. Some of the supported formats are "RDF/XML", "RDF/XML-ABBREV", "N-TRIPLE", "TURTLE". See Lang for all supported formats. The default value, represented by null, is "RDF/XML".

      Parameters:
      writer - the output writer
      lang - the language in which the RDF should be written
      base - the base URI for relative URI calculations; null means use only absolute URI's.
      Returns:
      this model
    • writeAll

      OntModel writeAll(Writer writer, String lang)
      Writes a serialized representation of all the model's contents, including inferred statements and statements imported from other documents. To write only the data asserted in the base model, use write. Note: it is often better to use an OutputStream rather than a Writer, since this will avoid character encoding errors.

      The language in which to write the model is specified by the lang argument. Some of the supported formats are "RDF/XML", "RDF/XML-ABBREV", "N-TRIPLE", "TURTLE". See Lang for all supported formats. The default value, represented by null, is "RDF/XML".

      Parameters:
      writer - the output writer
      lang - the language in which the RDF should be written
      Returns:
      this model
    • writeAll

      OntModel writeAll(OutputStream out, String lang, String base)
      Writes a serialized representation of all the model's contents, including inferred statements and statements imported from other documents. To write only the data asserted in the base model, use write.

      The language in which to write the model is specified by the lang argument. Some of the supported formats are "RDF/XML", "RDF/XML-ABBREV", "N-TRIPLE", "TURTLE". See Lang for all supported formats. The default value, represented by null, is "RDF/XML".

      Parameters:
      out - tre output stream to which the RDF is written
      lang - the language in which the RDF should be written
      base - the base URI for relative URI calculations; null means use only absolute URI's.
      Returns:
      this model
    • writeAll

      OntModel writeAll(OutputStream out, String lang)
      Writes a serialized representation of all the model's contents, including inferred statements and statements imported from other documents. To write only the data asserted in the base model, use write.

      The language in which to write the model is specified by the lang argument. Some of the supported formats are "RDF/XML", "RDF/XML-ABBREV", "N-TRIPLE", "TURTLE". See Lang for all supported formats. The default value, represented by null, is "RDF/XML".

      Parameters:
      out - tre output stream to which the RDF is written
      lang - the language in which the RDF should be written
      Returns:
      this model
    • createObjectSomeValuesFrom

      OntClass.ObjectSomeValuesFrom createObjectSomeValuesFrom(OntObjectProperty property, OntClass ce)
      Creates an Existential Quantification Object Property Restriction. The RDF structure:
      
       _:x rdf:type owl:Restriction .
       _:x owl:onProperty P .
       _:x owl:someValuesFrom C .
       
      Parameters:
      property - object property expression, not null
      ce - class expression, not null
      Returns:
      OntClass.ObjectSomeValuesFrom
      See Also:
    • createDataSomeValuesFrom

      OntClass.DataSomeValuesFrom createDataSomeValuesFrom(OntDataProperty property, OntDataRange dr)
      Creates an Existential Quantification Data Property Restriction. The RDF structure:
      
       _:x rdf:type owl:Restriction .
       _:x owl:onProperty R .
       _:x owl:someValuesFrom D .
       
      Parameters:
      property - data property, not null
      dr - data range, not null
      Returns:
      OntClass.DataSomeValuesFrom
      See Also:
    • createObjectAllValuesFrom

      OntClass.ObjectAllValuesFrom createObjectAllValuesFrom(OntObjectProperty property, OntClass ce)
      Creates a Universal Quantification Object Property Restriction. The RDF structure:
      
       _:x rdf:type owl:Restriction .
       _:x owl:onProperty P .
       _:x owl:allValuesFrom C .
       
      Parameters:
      property - object property expression, not null
      ce - class expression, not null
      Returns:
      OntClass.ObjectAllValuesFrom
      See Also:
    • createDataAllValuesFrom

      OntClass.DataAllValuesFrom createDataAllValuesFrom(OntDataProperty property, OntDataRange dr)
      Creates a Universal Quantification Data Property Restriction. The RDF structure:
      
       _:x rdf:type owl:Restriction .
       _:x owl:onProperty R .
       _:x owl:allValuesFrom D .
       
      Parameters:
      property - data property, not null
      dr - data range, not null
      Returns:
      OntClass.DataAllValuesFrom
      See Also:
    • createObjectHasValue

      OntClass.ObjectHasValue createObjectHasValue(OntObjectProperty property, OntIndividual individual)
      Creates an Individual Value Restriction. The RDF structure:
      
       _:x rdf:type owl:Restriction .
       _:x owl:onProperty P .
       _:x owl:hasValue a .
       
      Parameters:
      property - object property expression, not null
      individual - OntIndividual, not null
      Returns:
      OntClass.ObjectHasValue
      See Also:
    • createDataHasValue

      OntClass.DataHasValue createDataHasValue(OntDataProperty property, org.apache.jena.rdf.model.Literal literal)
      Creates a Literal Value Restriction. The RDF structure:
      
       _:x rdf:type owl:Restriction .
       _:x owl:onProperty R .
       _:x owl:hasValue v .
       
      Parameters:
      property - data property, not null
      literal - Literal, not null
      Returns:
      OntClass.DataHasValue
      See Also:
    • createObjectMinCardinality

      OntClass.ObjectMinCardinality createObjectMinCardinality(OntObjectProperty property, int cardinality, OntClass ce)
      Creates an Object Minimum Cardinality Restriction, possible Qualified. If ce is null, it is taken to be owl:Thing. In that case the return restriction is unqualified. The RDF structure:
      
       _:x rdf:type owl:Restriction .
       _:x owl:onProperty P .
       _:x owl:minCardinality n .
       
      or
      
       _:x rdf:type owl:Restriction .
       _:x owl:onProperty P .
       _:x owl:minQualifiedCardinality n .
       _:x owl:onClass C .
       
      Parameters:
      property - object property expression, not null
      cardinality - int, non-negative number
      ce - class expression or null
      Returns:
      OntClass.ObjectMinCardinality
      See Also:
    • createDataMinCardinality

      OntClass.DataMinCardinality createDataMinCardinality(OntDataProperty property, int cardinality, OntDataRange dr)
      Creates a Data Minimum Cardinality Restriction, possible Qualified. If dr is null, it is taken to be rdfs:Literal. The RDF structure:
      
       _:x rdf:type owl:Restriction .
       _:x owl:onProperty R .
       _:x owl:minCardinality n .
       
      or
      
       _:x rdf:type owl:Restriction .
       _:x owl:onProperty R .
       _:x owl:minQualifiedCardinality n .
       _:x owl:onDataRange D .
       
      Parameters:
      property - data property, not null
      cardinality - int, non-negative number
      dr - data range or null
      Returns:
      OntClass.DataMinCardinality
      See Also:
    • createObjectMaxCardinality

      OntClass.ObjectMaxCardinality createObjectMaxCardinality(OntObjectProperty property, int cardinality, OntClass ce)
      Creates an Object Maximum Cardinality Restriction, possible Qualified. If ce is null, it is taken to be owl:Thing. In that case the return restriction is unqualified. The RDF structure:
      
       _:x rdf:type owl:Restriction .
       _:x owl:onProperty P .
       _:x owl:maxCardinality n .
       
      or
      
       _:x rdf:type owl:Restriction .
       _:x owl:onProperty P .
       _:x owl:maxQualifiedCardinality n .
       _:x owl:onClass C .
       
      Parameters:
      property - object property expression, not null
      cardinality - int, non-negative number
      ce - class expression or null
      Returns:
      OntClass.ObjectMaxCardinality
      See Also:
    • createDataMaxCardinality

      OntClass.DataMaxCardinality createDataMaxCardinality(OntDataProperty property, int cardinality, OntDataRange dr)
      Creates a Data Maximum Cardinality Restriction, possible Qualified. If dr is null, it is taken to be rdfs:Literal. The RDF structure:
      
       _:x rdf:type owl:Restriction .
       _:x owl:onProperty R .
       _:x owl:maxCardinality n .
       
      or
      
       _:x rdf:type owl:Restriction .
       _:x owl:onProperty R .
       _:x owl:maxQualifiedCardinality n .
       _:x owl:onDataRange D .
       
      Parameters:
      property - data property, not null
      cardinality - int, non-negative number
      dr - data range or null
      Returns:
      OntClass.DataMaxCardinality
      See Also:
    • createObjectCardinality

      OntClass.ObjectCardinality createObjectCardinality(OntObjectProperty property, int cardinality, OntClass ce)
      Creates an Object Exact Cardinality Restriction, possible Qualified. If ce is null, it is taken to be owl:Thing. In that case the return restriction is unqualified. The RDF structure:
      
       _:x rdf:type owl:Restriction .
       _:x owl:onProperty P .
       _:x owl:cardinality n .
       
      or
      
       _:x rdf:type owl:Restriction .
       _:x owl:onProperty P .
       _:x owl:qualifiedCardinality n .
       _:x owl:onClass C .
       
      Parameters:
      property - object property expression, not null
      cardinality - int, non-negative number
      ce - class expression or null
      Returns:
      OntClass.ObjectCardinality
      See Also:
    • createDataCardinality

      OntClass.DataCardinality createDataCardinality(OntDataProperty property, int cardinality, OntDataRange dr)
      Creates a Data Exact Cardinality Restriction, possible Qualified. If dr is null, it is taken to be rdfs:Literal. The RDF structure:
      
       _:x rdf:type owl:Restriction .
       _:x owl:onProperty R .
       _:x owl:cardinality n .
       
      or
      
       _:x rdf:type owl:Restriction .
       _:x owl:onProperty R .
       _:x owl:qualifiedCardinality n .
       _:x owl:onDataRange D .
       
      Parameters:
      property - data property, not null
      cardinality - int, non-negative number
      dr - data range or null
      Returns:
      OntClass.DataCardinality
      See Also:
    • createHasSelf

      OntClass.HasSelf createHasSelf(OntObjectProperty property)
      Creates a Local Reflexivity Class Expression (Self-Restriction). The RDF structure:
      
       _:x rdf:type owl:Restriction .
       _:x owl:onProperty P .
       _:x owl:hasSelf "true"^^xsd:boolean .
       
      Parameters:
      property - object property expression, not null
      Returns:
      OntClass.HasSelf
      See Also:
    • createObjectUnionOf

      OntClass.UnionOf createObjectUnionOf(Collection<OntClass> classes)
      Creates a Union of Class Expressions. The RDF structure:
      
       _:x rdf:type owl:Class .
       _:x owl:unionOf ( C1 ... Cn ) .
       
      Parameters:
      classes - Collection of class expressions without nulls
      Returns:
      OntClass.UnionOf
      See Also:
    • createObjectIntersectionOf

      OntClass.IntersectionOf createObjectIntersectionOf(Collection<OntClass> classes)
      Creates an Intersection of Class Expressions. The RDF structure:
      
       _:x rdf:type owl:Class .
       _:x owl:intersectionOf ( C1 ... Cn ) .
       
      Parameters:
      classes - Collection of class expressions without nulls
      Returns:
      OntClass.IntersectionOf
      See Also:
    • createObjectOneOf

      OntClass.OneOf createObjectOneOf(Collection<OntIndividual> individuals)
      Creates an Enumeration of Individuals. The RDF structure:
      
       _:x rdf:type owl:Class .
       _:x owl:oneOf ( a1 ... an ).
       
      Parameters:
      individuals - Collection of individuals without nulls
      Returns:
      OntClass.OneOf
      See Also:
    • createObjectComplementOf

      OntClass.ComplementOf createObjectComplementOf(OntClass ce)
      Create a Complement of Class Expressions. The RDF structure:
      
       _:x rdf:type owl:Class .
       _:x owl:complementOf C .
       
      Parameters:
      ce - class expression or null
      Returns:
      OntClass.ComplementOf
      See Also:
    • createDataAllValuesFrom

      OntClass.NaryDataAllValuesFrom createDataAllValuesFrom(Collection<OntDataProperty> properties, OntDataRange dr)
      Creates an N-Ary Data Universal Quantification N-Ary Restriction. Note: currently a Unary Restriction is preferable since in OWL2 data-range arity is always 1. The RDF structure:
      
       _:x rdf:type owl:Restriction .
       _:x owl:onProperties ( R1 ... Rn ) .
       _:x owl:allValuesFrom Dn .
       
      Parameters:
      properties - Collection of data ranges without nulls
      dr - data range, not null
      Returns:
      OntClass.NaryDataAllValuesFrom
      See Also:
    • createDataSomeValuesFrom

      OntClass.NaryDataSomeValuesFrom createDataSomeValuesFrom(Collection<OntDataProperty> properties, OntDataRange dr)
      Creates an N-Ary Data Existential Quantification N-Ary Restriction. Note: currently a Unary Restriction is preferable since in OWL2 data-range arity is always 1. The RDF structure:
      
       _:x rdf:type owl:Restriction .
       _:x owl:onProperties ( R1 ... Rn ) .
       _:x owl:someValuesFrom Dn .
       
      Parameters:
      properties - Collection of data ranges without nulls
      dr - data range, not null
      Returns:
      OntClass.NaryDataAllValuesFrom
      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

      OntDataRange.OneOf createDataOneOf(Collection<org.apache.jena.rdf.model.Literal> values)
      Creates an Enumeration of Literals. RDF (turtle) syntax:
      
       _:x rdf:type rdfs:Datatype .
       _:x owl:oneOf ( v1 ... vn ) .
       
      Parameters:
      values - Collection of literals, without nulls
      Returns:
      OntDataRange.OneOf
      See Also:
    • createDataRestriction

      Creates a Datatype Restriction. RDF (turtle) syntax:
      
       _:x rdf:type rdfs:Datatype .
       _:x owl:onDatatype DN .
       _:x owl:withRestrictions ( _:x1 ... _:xn ) .
       _:xj fj vj .
       
      Parameters:
      other - OntDataRange.Named, not null
      values - Collection of facet restrictions, without nulls
      Returns:
      OntDataRange.Restriction
      See Also:
    • createDataComplementOf

      OntDataRange.ComplementOf createDataComplementOf(OntDataRange other)
      Creates a Complement of Data Ranges. RDF (turtle) syntax:
      
       _:x rdf:type rdfs:Datatype .
       _:x owl:datatypeComplementOf D .
       
      Parameters:
      other - OntDataRange, not null
      Returns:
      OntDataRange.ComplementOf
      See Also:
    • createDataUnionOf

      OntDataRange.UnionOf createDataUnionOf(Collection<OntDataRange> values)
      Creates a Union of Data Ranges. RDF (turtle) syntax:
      
       _:x rdf:type rdfs:Datatype .
       _:x owl:unionOf ( D1 ... Dn ) .
       
      Parameters:
      values - Collection of data ranges, without nulls
      Returns:
      OntDataRange.UnionOf
      See Also:
    • createDataIntersectionOf

      OntDataRange.IntersectionOf createDataIntersectionOf(Collection<OntDataRange> values)
      Creates an Intersection of Data Ranges. RDF (turtle) syntax:
      
       _:x rdf:type rdfs:Datatype .
       _:x owl:intersectionOf ( D1 ... Dn ) .
       
      Parameters:
      values - Collection of data ranges, without nulls
      Returns:
      OntDataRange.IntersectionOf
      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

      OntDisjoint.Classes createDisjointClasses(Collection<OntClass> classes)
      Creates a Disjoint Classes Axiom Resource. The RDF structure:
      
       _:x rdf:type owl:AllDisjointClasses .
       _:x owl:members ( C1 ... Cn ) .
       
      Parameters:
      classes - Collection of Class Expressions without null-elements
      Returns:
      OntDisjoint.Classes
      See Also:
    • createDifferentIndividuals

      OntDisjoint.Individuals createDifferentIndividuals(Collection<OntIndividual> individuals)
      Creates a Different Individuals Axiom Resource. The RDF structure:
      
       _:x rdf:type owl:AllDifferent .
       _:x owl:members ( a1 ... an ).
       
      Note: instead of owl:members, alternatively, the predicate owl:distinctMembers can be used.
      Parameters:
      individuals - Collection of Individuals without null-elements
      Returns:
      OntDisjoint.Individuals
      See Also:
    • createDisjointObjectProperties

      OntDisjoint.ObjectProperties createDisjointObjectProperties(Collection<OntObjectProperty> properties)
      Creates a Disjoint Object Properties Axiom Resource. The RDF structure:
      
       _:x rdf:type owl:AllDisjointProperties .
       _:x owl:members ( P1 ... Pn ) .
       
      Parameters:
      properties - Collection of object property expressions without null-elements
      Returns:
      OntDisjoint.ObjectProperties
      See Also:
    • createDisjointDataProperties

      OntDisjoint.DataProperties createDisjointDataProperties(Collection<OntDataProperty> properties)
      Creates a Disjoint Data Properties Axiom Resource. The RDF structure:
      
       _:x rdf:type owl:AllDisjointProperties .
       _:x owl:members ( R1 ... Rn ) .
       
      Parameters:
      properties - Collection of data properties without null-elements
      Returns:
      OntDisjoint.DataProperties
      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:
    • createSWRLVariable

      OntSWRL.Variable createSWRLVariable(String uri)
      Creates a SWRL Variable, that is a URI resource with a type swrl:Variable.
      Parameters:
      uri - String, not null
      Returns:
      OntSWRL.Variable
    • createBuiltInSWRLAtom

      OntSWRL.Atom.WithBuiltin createBuiltInSWRLAtom(org.apache.jena.rdf.model.Resource predicate, Collection<OntSWRL.DArg> arguments)
      Creates a BuiltIn Atom. An input predicate can be taken from SWRL Builins Vocabulary. Turtle syntax:
      
       	_:x rdf:type swrl:BuiltinAtom .
       _:x swrl:arguments ( d1 ... d2 ) .
       _:x swrl:builtin U .
       
      Parameters:
      predicate - an URI, Resource, not null
      arguments - Collection of OntSWRL.DArgs
      Returns:
      OntSWRL.Atom.WithBuiltin
      See Also:
      • SWRLB
    • createClassSWRLAtom

      OntSWRL.Atom.WithClass createClassSWRLAtom(OntClass clazz, OntSWRL.IArg arg)
      Creates a Class Atom. Turtle syntax:
      
       _:x rdf:type swrl:ClassAtom .
       _:x swrl:argument1 i .
       _:x swrl:classPredicate C .
       
      Parameters:
      clazz - OntClass, not null
      arg - OntSWRL.IArg (either OntIndividual or OntSWRL.Variable), not null
      Returns:
      OntSWRL.Atom.WithClass
    • createDataRangeSWRLAtom

      OntSWRL.Atom.WithDataRange createDataRangeSWRLAtom(OntDataRange range, OntSWRL.DArg arg)
      Creates a Data Range Atom. Turtle syntax:
      
       _:x rdf:type swrl:DataRangeAtom .
       _:x swrl:argument1 d .
       _:x swrl:dataRange D .
       
      Parameters:
      range - OntDataRange, not null
      arg - OntSWRL.DArg (either OntSWRL.Variable or Literal), not null
      Returns:
      OntSWRL.Atom.WithDataRange
    • createDataPropertySWRLAtom

      OntSWRL.Atom.WithDataProperty createDataPropertySWRLAtom(OntDataProperty property, OntSWRL.IArg first, OntSWRL.DArg second)
      Creates a Data Property Atom. Turtle syntax:
      
       _:x rdf:type swrl:DatavaluedPropertyAtom .
       _:x swrl:argument1 i .
       _:x swrl:argument2 d .
       _:x swrl:propertyPredicate R .
       
      Parameters:
      property - OntDataProperty, not null
      first - OntSWRL.IArg (either OntIndividual or OntSWRL.Variable), not null
      second - OntSWRL.DArg (either OntSWRL.Variable or Literal), not null
      Returns:
      OntSWRL.Atom.WithDataProperty
    • createObjectPropertySWRLAtom

      OntSWRL.Atom.WithObjectProperty createObjectPropertySWRLAtom(OntObjectProperty property, OntSWRL.IArg first, OntSWRL.IArg second)
      Creates an Object Property Atom. Turtle syntax:
      
       _:x rdf:type swrl:IndividualPropertyAtom .
       _:x swrl:argument1 i1 .
       _:x swrl:argument2 i2 .
       _:x swrl:propertyPredicate P .
       
      Parameters:
      property - OntObjectProperty, not null
      first - OntSWRL.IArg (either OntIndividual or OntSWRL.Variable), not null
      second - OntSWRL.IArg (either OntIndividual or OntSWRL.Variable), not null
      Returns:
      OntSWRL.Atom.WithObjectProperty
    • createDifferentIndividualsSWRLAtom

      OntSWRL.Atom.WithDifferentIndividuals createDifferentIndividualsSWRLAtom(OntSWRL.IArg first, OntSWRL.IArg second)
      Creates a Different Individuals Atom. Turtle syntax:
      
       _:x rdf:type swrl:DifferentIndividualsAtom .
       _:x swrl:argument1 i1 .
       _:x swrl:argument2 i2 .
       
      Parameters:
      first - OntSWRL.IArg (either OntIndividual or OntSWRL.Variable), not null
      second - OntSWRL.IArg (either OntIndividual or OntSWRL.Variable), not null
      Returns:
      OntSWRL.Atom.WithDifferentIndividuals
    • createSameIndividualsSWRLAtom

      OntSWRL.Atom.WithSameIndividuals createSameIndividualsSWRLAtom(OntSWRL.IArg first, OntSWRL.IArg second)
      Creates a Same Individuals Atom. Turtle syntax:
      
       _:x rdf:type swrl:SameIndividualAtom .
       _:x swrl:argument1 i1 .
       _:x swrl:argument2 i2 .
       
      Parameters:
      first - OntSWRL.IArg (either OntIndividual or OntSWRL.Variable), not null
      second - OntSWRL.IArg (either OntIndividual or OntSWRL.Variable), not null
      Returns:
      OntSWRL.Atom.WithSameIndividuals
    • createSWRLImp

      OntSWRL.Imp createSWRLImp(Collection<OntSWRL.Atom<?>> head, Collection<OntSWRL.Atom<?>> body)
      Creates a SWRL Rule. A rule consists of a head and a body. Both the head and the body consist of a conjunction of Atoms. In RDF, instead of a regular []-list, a typed version of []-lis is used, where rdf:type is swrl:AtomList. Turtle syntax:
      
       _:x rdf:type swrl:Impl .
       _:x swrl:body (swrl:AtomList: A1 ... An ) .
       _:x swrl:head (swrl:AtomList: A1 ... Am ) .
       
      Parameters:
      head - Collection of OntSWRL.Atoms
      body - Collection of OntSWRL.Atoms
      Returns:
      OntSWRL.Imp