- All Superinterfaces:
InfModel,Lock,Model,ModelCon,ModelGraphInterface,PrefixMapping,RDFReaderF,RDFWriterF
- All Known Implementing Classes:
OntModelImpl
An enhanced view of a Jena model that is known to contain ontology
data, under a given ontology vocabulary (such as OWL).
This class does not by itself compute the deductive extension of the graph
under the semantic rules of the language. Instead, we wrap an underlying
model with this ontology interface, that presents a convenience syntax for accessing
the language elements. Depending on the inference capability of the underlying model,
the OntModel will appear to contain more or less triples. For example, if
this class is used to wrap a plain memory or database model, only the
relationships asserted by the document will be reported through this
convenience API. Alternatively, if the OntModel wraps an OWL inferencing model,
the inferred triples from the extension will be reported as well. For
example, assume the following ontology fragment:
:A rdf:type owl:Class .
:B rdf:type owl:Class ; rdfs:subClassOf :A .
:widget rdf:type :B .
In a non-inferencing model, the rdf:type of the widget will be
reported as class :B only. In a model that can process the OWL
semantics, the widget's types will include :B, :A,
and owl:Thing.
Note: that OntModel is an extension to the
InfModel interface. This is to support the case where an ontology model
wraps an inference graph, and we want to make the special capabilities of the
InfModel, for example global consistency checking, accessible to
client programs. Since not all ont models use a reasoner, using these methods
may result in a runtime exception, though the typical behaviour is that such
calls will be silently ignored.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.jena.shared.PrefixMapping
PrefixMapping.Factory, PrefixMapping.IllegalPrefixException, PrefixMapping.JenaLockedException -
Field Summary
Fields inherited from interface org.apache.jena.shared.PrefixMapping
Extended, Standard -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLoadedImport(String uri) Deprecated, for removal: This API element is subject to removal in a future version.Record that this model has now imported the document with the given URI, so that it will not be re-imported in the future.voidaddSubModel(Model model) Deprecated, for removal: This API element is subject to removal in a future version.Add the given model as one of the sub-models of the enclosed ontology union model.voidaddSubModel(Model model, boolean rebind) Deprecated, for removal: This API element is subject to removal in a future version.Add the given model as one of the sub-models of the enclosed ontology union model.intDeprecated, for removal: This API element is subject to removal in a future version.Answer the number of sub-models of this model, not including the base model.Deprecated, for removal: This API element is subject to removal in a future version.Answer a new, anonymous node representing the fact that a given set of classes are all pair-wise distinct.createAllDifferent(RDFList differentMembers) Deprecated, for removal: This API element is subject to removal in a future version.Answer a new, anonymous node representing the fact that a given set of classes are all pair-wise distinct.createAllValuesFromRestriction(String uri, Property prop, Resource cls) Deprecated, for removal: This API element is subject to removal in a future version.Answer a class description defined as the class of those individuals for which all values of the given property belong to the given classDeprecated, for removal: This API element is subject to removal in a future version.Answer a resource that represents an annotation property in this model.createCardinalityQRestriction(String uri, Property prop, int cardinality, OntClass cls) Deprecated, for removal: This API element is subject to removal in a future version.Answer a class description defined as the class of those individuals that have exactly the given number of values for the given property, all values of which belong to the given class.createCardinalityRestriction(String uri, Property prop, int cardinality) Deprecated, for removal: This API element is subject to removal in a future version.Answer a class description defined as the class of those individuals that have exactly the given number of values for the given property.Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource that represents an anonymous class description in this model.createClass(String uri) Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource that represents a class description node in this model.createComplementClass(String uri, Resource cls) Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource representing the class that is the complement of the given argument classcreateDataRange(RDFList literals) Deprecated, for removal: This API element is subject to removal in a future version.Answer a data range defined as the given set of concrete data values.Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource that represents datatype property in this model, and that is not a functional property.createDatatypeProperty(String uri, boolean functional) Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource that represents datatype property in this model.createEnumeratedClass(String uri, RDFList members) Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource representing the class that is the enumeration of the given list of individualscreateHasValueRestriction(String uri, Property prop, RDFNode value) Deprecated, for removal: This API element is subject to removal in a future version.Answer a class description defined as the class of those individuals that have the given resource as the value of the given propertycreateIndividual(String uri, Resource cls) Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource that represents an Individual node in this model.createIndividual(Resource cls) Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource that represents anIndividualnode in this model.createIntersectionClass(String uri, RDFList members) Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource representing the class that is the intersection of the given list of class descriptions.Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource representing an inverse functional propertycreateInverseFunctionalProperty(String uri, boolean functional) Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource representing an inverse functional property, which is optionally also functional.createMaxCardinalityQRestriction(String uri, Property prop, int cardinality, OntClass cls) Deprecated, for removal: This API element is subject to removal in a future version.Answer a class description defined as the class of those individuals that have at most the given number of values for the given property, all values of which belong to the given class.createMaxCardinalityRestriction(String uri, Property prop, int cardinality) Deprecated, for removal: This API element is subject to removal in a future version.Answer a class description defined as the class of those individuals that have at most the given number of values for the given property.createMinCardinalityQRestriction(String uri, Property prop, int cardinality, OntClass cls) Deprecated, for removal: This API element is subject to removal in a future version.Answer a class description defined as the class of those individuals that have at least the given number of values for the given property, all values of which belong to the given class.createMinCardinalityRestriction(String uri, Property prop, int cardinality) Deprecated, for removal: This API element is subject to removal in a future version.Answer a class description defined as the class of those individuals that have at least the given number of values for the given property.Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource representing an object property in this model, and that is not a functional property.createObjectProperty(String uri, boolean functional) Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource that represents an object property in this model.createOntology(String uri) Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource that represents an ontology description node in this model.createOntProperty(String uri) Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource representing an generic property in this model.<T extends OntResource>
TcreateOntResource(Class<T> javaClass, Resource rdfType, String uri) Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource that represents a generic ontology node in this model.createOntResource(String uri) Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource presenting theOntResourcefacet, which has the given URI.createRestriction(String uri, Property p) Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource that represents a property restriction in this model.Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource that represents an anonymous property restriction in this model.createSomeValuesFromRestriction(String uri, Property prop, Resource cls) Deprecated, for removal: This API element is subject to removal in a future version.Answer a class description defined as the class of those individuals that have at least one property with a value belonging to the given classDeprecated, for removal: This API element is subject to removal in a future version.Answer a resource representing a symmetric propertycreateSymmetricProperty(String uri, boolean functional) Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource representing a symmetric property, which is optionally also functional.Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource representing a transitive propertycreateTransitiveProperty(String uri, boolean functional) Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource representing a transitive property, which is optionally also functional.createUnionClass(String uri, RDFList members) Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource representing the class that is the union of the given list of class descriptionsDeprecated, for removal: This API element is subject to removal in a future version.Answer a class description defined as the class of those individuals for which all values of the given property belong to the given class.Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource that represents an annotation property in this model.Deprecated, for removal: This API element is subject to removal in a future version.Answer the base model of this model.Deprecated, for removal: This API element is subject to removal in a future version.Answer a class description defined as the class of those individuals that have a property p, with cardinality N, all values of which are members of a given class.Deprecated, for removal: This API element is subject to removal in a future version.Answer a class description defined as the class of those individuals that have exactly the given number of values for the given property.getComplementClass(String uri) Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource representing the class that is the complement of another class.Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource that represents datatype property in this model. .Deprecated, for removal: This API element is subject to removal in a future version.Answer a reference to the document manager that this model is using to manage ontology <-> mappings, and to load the imports closure.booleanDeprecated, for removal: This API element is subject to removal in a future version.Answer true if the imports closure of the model will be dynamically updated as imports statements are added and removed.getEnumeratedClass(String uri) Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource representing the class that is the enumeration of a list of individuals.Deprecated, for removal: This API element is subject to removal in a future version.Answer a class description defined as the class of those individuals that have the given resource as the value of the given property.getImportedModel(String uri) Deprecated, for removal: This API element is subject to removal in a future version.Answer anOntModelrepresenting the imported ontology with the given URI.Deprecated, for removal: This API element is subject to removal in a future version.Answer the model maker associated with this model (used for constructing the constituent models of the imports closure).getIndividual(String uri) Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource that represents an Individual node in this model.Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource representing the class that is the intersection of a list of class descriptions.Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource representing an inverse functional property.Deprecated, for removal: This API element is subject to removal in a future version.Answer a class description defined as the class of those individuals that have a property p, with max cardinality N, all values of which are members of a given class.Deprecated, for removal: This API element is subject to removal in a future version.Answer a class description defined as the class of those individuals that have at most the given number of values for the given property.Deprecated, for removal: This API element is subject to removal in a future version.Answer a class description defined as the class of those individuals that have a property p, with minimum cardinality N, all values of which are members of a given class.Deprecated, for removal: This API element is subject to removal in a future version.Answer a class description defined as the class of those individuals that have at least the given number of values for the given property.getObjectProperty(String uri) Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource representing an object property in this model.getOntClass(String uri) Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource that represents a class description node in this model.getOntology(String uri) Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource that represents an ontology description node in this model.getOntProperty(String uri) Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource representing an generic property in this model.getOntResource(String uri) Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource presenting theOntResourcefacet, which has the given URI.getOntResource(Resource res) Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource presenting theOntResourcefacet, which corresponds to the given resource but attached to this model.Deprecated, for removal: This API element is subject to removal in a future version.Answer the language profile (for example, OWL or DAML+OIL) that this model is working to.Deprecated, for removal: This API element is subject to removal in a future version.Answer a class description defined as the class of those individuals that have a property p, all values of which are members of a given class.getRestriction(String uri) Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource that represents a property restriction in this model.Deprecated, for removal: This API element is subject to removal in a future version.Answer a class description defined as the class of those individuals that have at least one property with a value belonging to the given class.Deprecated, for removal: This API element is subject to removal in a future version.Answer the ontology model specification that was used to construct this modelDeprecated, for removal: This API element is subject to removal in a future version.i.next() Answer the sub-graphs of this model.Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource representing a symmetric property.Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource representing a transitive property.getUnionClass(String uri) Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource representing the class that is the union of a list of class descriptions.booleanhasLoadedImport(String uri) Deprecated, for removal: This API element is subject to removal in a future version.Answer true if this model has had the given URI document imported into it.booleanisInBaseModel(RDFNode node) Deprecated, for removal: This API element is subject to removal in a future version.Answer true if the given node is a member of the base model of this ontology model.booleanisInBaseModel(Statement stmt) Deprecated, for removal: This API element is subject to removal in a future version.Answer true if the given statement is defined in the base model of this ontology model.Deprecated, for removal: This API element is subject to removal in a future version.Answer an iterator that ranges over the nodes that denote pair-wise disjointness between sets of classes.Deprecated, for removal: This API element is subject to removal in a future version.Answer an iterator over all of the ontology properties in this model, including object properties, datatype properties, annotation properties, etc.Deprecated, for removal: This API element is subject to removal in a future version.Answer an iterator that ranges over the properties in this model that are declared to be annotation properties.Deprecated, for removal: This API element is subject to removal in a future version.Answer an iterator that ranges over all of the various forms of class description resource in this model.Deprecated, for removal: This API element is subject to removal in a future version.Answer an iterator that ranges over the complement class-descriptions in this model, i.e. the class resources specified to have a propertycomplementOf(or equivalent) and a list of values.Deprecated, for removal: This API element is subject to removal in a future version.Answer an iterator over the DataRange objects in this ontology, if there are any.Deprecated, for removal: This API element is subject to removal in a future version.Answer an iterator that ranges over the datatype property resources in this model, i.e. the resources withrdf:type DatatypePropertyor equivalent.Deprecated, for removal: This API element is subject to removal in a future version.Answer an iterator that ranges over the enumerated class class-descriptions in this model, i.e. the class resources specified to have a propertyoneOf(or equivalent) and a list of values.Deprecated, for removal: This API element is subject to removal in a future version.Answer an iterator that ranges over the functional property resources in this model, i.e. the resources withrdf:type FunctionalPropertyor equivalent.Deprecated, for removal: This API element is subject to removal in a future version.Answer an iterator over the classes in this ontology model that represent the uppermost nodes of the class hierarchy.Deprecated, for removal: This API element is subject to removal in a future version.Answer a list of the imported URI's in this ontology model.listImportedOntologyURIs(boolean closure) Deprecated, for removal: This API element is subject to removal in a future version.Answer a list of the imported URI's in this ontology model, and optionally in the closure of this model's imports.Deprecated, for removal: This API element is subject to removal in a future version.Answer an iterator that ranges over the individual resources in this model, i.e. the resources withrdf:typecorresponding to a class defined in the ontology.listIndividuals(Resource cls) Deprecated, for removal: This API element is subject to removal in a future version.Answer an iterator that ranges over the resources in this model that are instances of the given class.Deprecated, for removal: This API element is subject to removal in a future version.Answer an iterator that ranges over the intersection class-descriptions in this model, i.e. the class resources specified to have a propertyintersectionOf(or equivalent) and a list of values.Deprecated, for removal: This API element is subject to removal in a future version.Answer an iterator that ranges over the inverse functional property resources in this model, i.e. the resources withrdf:type InverseFunctionalPropertyor equivalent.Deprecated, for removal: This API element is subject to removal in a future version.Answer an iterator that ranges over the named class-descriptions in this model, i.e. resources withrdf:type Class(or equivalent) and a node URI.Deprecated, for removal: This API element is subject to removal in a future version.Answer an iterator that ranges over the object property resources in this model, i.e. the resources withrdf:type ObjectPropertyor equivalent.Deprecated, for removal: This API element is subject to removal in a future version.Answer an iterator that ranges over the ontology resources in this model, i.e. the resources withrdf:type Ontologyor equivalent.Deprecated, for removal: This API element is subject to removal in a future version.Answer an iterator that ranges over the property resources in this model, i.e. the resources withrdf:type Propertyor equivalent.Deprecated, for removal: This API element is subject to removal in a future version.Answer an iterator that ranges over the property restriction class-descriptions in this model, i.e. resources withrdf:type Restriction(or equivalent).Deprecated, for removal: This API element is subject to removal in a future version.Answer an iterator over the ontology models that are sub-models of this model.listSubModels(boolean withImports) Deprecated, for removal: This API element is subject to removal in a future version.Answer an iterator over the ontology models that are sub-models of this model.Deprecated, for removal: This API element is subject to removal in a future version.Answer an iterator that ranges over the symmetric property resources in this model, i.e. the resources withrdf:type SymmetricPropertyor equivalent.Deprecated, for removal: This API element is subject to removal in a future version.Answer an iterator that ranges over the transitive property resources in this model, i.e. the resources withrdf:type TransitivePropertyor equivalent.Deprecated, for removal: This API element is subject to removal in a future version.Answer an iterator that ranges over the union class-descriptions in this model, i.e. the class resources specified to have a propertyunionOf(or equivalent) and a list of values.voidDeprecated, for removal: This API element is subject to removal in a future version.Determine which models this model imports (by looking for, for example,owl:importsstatements, and load each of those models as an import.voidremoveLoadedImport(String uri) Deprecated, for removal: This API element is subject to removal in a future version.Record that this model no longer imports the document with the given URI.voidremoveSubModel(Model model) Deprecated, for removal: This API element is subject to removal in a future version.Remove the given model as one of the sub-models of the enclosed ontology union model.voidremoveSubModel(Model model, boolean rebind) Deprecated, for removal: This API element is subject to removal in a future version.Remove the given model as one of the sub-models of the enclosed ontology union model.voidsetDynamicImports(boolean dynamic) Deprecated, for removal: This API element is subject to removal in a future version.Set the flag that controls whether adding or removing imports statements into the model will result in the imports closure changing dynamically.voidsetStrictMode(boolean strict) Deprecated, for removal: This API element is subject to removal in a future version.Set the checking mode to strict or non-strict.booleanDeprecated, for removal: This API element is subject to removal in a future version.Answer true if this model is currently in strict checking mode.write(OutputStream out) Deprecated, for removal: This API element is subject to removal in a future version.Write a serialization of this model as an XML document.write(OutputStream out, String lang) Deprecated, for removal: This API element is subject to removal in a future version.Write a serialized representation of this model in a specified language.write(OutputStream out, String lang, String base) Deprecated, for removal: This API element is subject to removal in a future version.Write a serialized representation of a model in a specified language.Deprecated, for removal: This API element is subject to removal in a future version.Write the model as an XML document.Deprecated, for removal: This API element is subject to removal in a future version.Write a serialized representation of a model in a specified language.Deprecated, for removal: This API element is subject to removal in a future version.Write a serialized representation of a model in a specified language.writeAll(OutputStream out, String lang) Deprecated, for removal: This API element is subject to removal in a future version.Write a serialized representation of all of the contents of the model, including inferred statements and statements imported from other documents.writeAll(OutputStream out, String lang, String base) Deprecated, for removal: This API element is subject to removal in a future version.Write a serialized representation of all of the contents of the model, including inferred statements and statements imported from other documents.Deprecated, for removal: This API element is subject to removal in a future version.Write a serialized representation of all of the contents of the model, including inferred statements and statements imported from other documents.Deprecated, for removal: This API element is subject to removal in a future version.Write a serialized representation of all of the contents of the model, including inferred statements and statements imported from other documents.Methods inherited from interface org.apache.jena.rdf.model.InfModel
getDeductionsModel, getDerivation, getRawModel, getReasoner, listStatements, prepare, rebind, reset, setDerivationLogging, validateMethods inherited from interface org.apache.jena.shared.Lock
enterCriticalSection, leaveCriticalSectionMethods inherited from interface org.apache.jena.rdf.model.Model
abort, add, add, add, add, add, begin, calculateInTxn, clearNsPrefixMap, close, commit, contains, contains, contains, containsAll, containsAll, containsAny, containsAny, containsResource, createList, createList, createList, createLiteral, createLiteral, createProperty, createReifier, createReifier, createResource, createResource, createResource, createResource, createStatement, createStatementTerm, createTypedLiteral, createTypedLiteral, createTypedLiteral, difference, equals, executeInTxn, getLock, getProperty, getProperty, getProperty, getReader, getRequiredProperty, getRequiredProperty, getResource, getResource, getWriter, independent, intersection, isClosed, isEmpty, isIsomorphicWith, listNameSpaces, listObjects, listObjectsOfProperty, listObjectsOfProperty, listResourcesWithProperty, listResourcesWithProperty, listStatements, listStatements, listSubjects, listSubjectsWithProperty, listSubjectsWithProperty, notifyEvent, read, read, read, read, read, read, read, register, remove, remove, remove, removeAll, removeAll, removeNsPrefix, setNsPrefix, setNsPrefixes, setNsPrefixes, size, supportsSetOperations, supportsTransactions, union, unregister, withDefaultMappingsMethods inherited from interface org.apache.jena.rdf.model.ModelCon
add, add, add, add, add, addLiteral, addLiteral, addLiteral, addLiteral, addLiteral, addLiteral, addLiteral, contains, contains, contains, containsLiteral, containsLiteral, containsLiteral, containsLiteral, containsLiteral, containsLiteral, containsLiteral, createAlt, createAlt, createBag, createBag, createLiteral, createLiteralStatement, createLiteralStatement, createLiteralStatement, createLiteralStatement, createLiteralStatement, createLiteralStatement, createLiteralStatement, createProperty, createResource, createResource, createSeq, createSeq, createStatement, createStatement, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, getAlt, getAlt, getBag, getBag, getList, getList, getProperty, getRDFNode, getSeq, getSeq, listLiteralStatements, listLiteralStatements, listLiteralStatements, listLiteralStatements, listLiteralStatements, listLiteralStatements, listResourcesWithProperty, listResourcesWithProperty, listResourcesWithProperty, listResourcesWithProperty, listResourcesWithProperty, listResourcesWithProperty, listStatements, listStatements, listStatements, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, remove, remove, removeMethods inherited from interface org.apache.jena.rdf.model.ModelGraphInterface
asRDFNode, asStatement, getGraph, wrapAsResourceMethods inherited from interface org.apache.jena.shared.PrefixMapping
expandPrefix, getNsPrefixMap, getNsPrefixURI, getNsURIPrefix, hasNoMappings, lock, numPrefixes, qnameFor, samePrefixMappingAs, shortForm
-
Method Details
-
listOntologies
ExtendedIterator<Ontology> listOntologies()Deprecated, for removal: This API element is subject to removal in a future version.Answer an iterator that ranges over the ontology resources in this model, i.e. the resources with
rdf:type Ontologyor equivalent. These resources typically contain metadata about the ontology document that contains them.Specifically, the resources in this iterator will those whose type corresponds to the value given in the ontology vocabulary associated with this model, see
Profile.ONTOLOGY().- Returns:
- An iterator over ontology resources.
-
listOntProperties
ExtendedIterator<OntProperty> listOntProperties()Deprecated, for removal: This API element is subject to removal in a future version.Answer an iterator that ranges over the property resources in this model, i.e. the resources with
rdf:type Propertyor equivalent. AnOntPropertyis equivalent to anrdfs:Propertyin a normal RDF graph; this type is provided as a common super-type for the more specificObjectPropertyandDatatypePropertyproperty types.Note This method searches for nodes in the underlying model whose
rdf:typeisrdf:Property. This type is entailed by specific property sub-types, such asowl:ObjectProperty. An important consequence of this is that in models without an attached reasoner (e.g. in theOWL_MEMOntModelSpec), the entailed type will not be present and this method will omit such properties from the returned iterator.
Solution There are two ways to address to this issue: either use a reasoning engine to ensure that type entailments are taking place correctly, or calllistAllOntProperties(). Note thatlistAllOntPropertiesis potentially less efficient than this method.The resources returned by this iterator will those whose type corresponds to the value given in the ontology vocabulary associated with this model.
- Returns:
- An iterator over property resources.
-
listAllOntProperties
ExtendedIterator<OntProperty> listAllOntProperties()Deprecated, for removal: This API element is subject to removal in a future version.Answer an iterator over all of the ontology properties in this model, including object properties, datatype properties, annotation properties, etc. This method takes a different approach to calculating the set of property resources to return, and is robust against the absence of a reasoner attached to the model (see note in
listOntProperties()for explanation). However, the calculation used by this method is potentially less efficient than the alternativelistOntProperties(). Users whose models have an attached reasoner are recommended to uselistOntProperties().- Returns:
- An iterator over all available properties in a model, irrespective of
whether a reasoner is available to perform
rdf:typeentailments. Each property will appear exactly once in the iterator.
-
listObjectProperties
ExtendedIterator<ObjectProperty> listObjectProperties()Deprecated, for removal: This API element is subject to removal in a future version.Answer an iterator that ranges over the object property resources in this model, i.e. the resources with
rdf:type ObjectPropertyor equivalent. An object property is a property that is defined in the ontology language semantics as a one whose range comprises individuals (rather than datatyped literals).Specifically, the resources in this iterator will those whose type corresponds to the value given in the ontology vocabulary associated with this model: see
Profile.OBJECT_PROPERTY().- Returns:
- An iterator over object property resources.
-
listDatatypeProperties
ExtendedIterator<DatatypeProperty> listDatatypeProperties()Deprecated, for removal: This API element is subject to removal in a future version.Answer an iterator that ranges over the datatype property resources in this model, i.e. the resources with
rdf:type DatatypePropertyor equivalent. An datatype property is a property that is defined in the ontology language semantics as a one whose range comprises datatyped literals (rather than individuals).Specifically, the resources in this iterator will those whose type corresponds to the value given in the ontology vocabulary associated with this model: see
Profile.DATATYPE_PROPERTY().- Returns:
- An iterator over datatype property resources.
-
listFunctionalProperties
ExtendedIterator<FunctionalProperty> listFunctionalProperties()Deprecated, for removal: This API element is subject to removal in a future version.Answer an iterator that ranges over the functional property resources in this model, i.e. the resources with
rdf:type FunctionalPropertyor equivalent. A functional property is a property that is defined in the ontology language semantics as having a unique domain element for each instance of the relationship.Specifically, the resources in this iterator will those whose type corresponds to the value given in the ontology vocabulary associated with this model: see
Profile.FUNCTIONAL_PROPERTY().- Returns:
- An iterator over functional property resources.
-
listTransitiveProperties
ExtendedIterator<TransitiveProperty> listTransitiveProperties()Deprecated, for removal: This API element is subject to removal in a future version.Answer an iterator that ranges over the transitive property resources in this model, i.e. the resources with
rdf:type TransitivePropertyor equivalent.Specifically, the resources in this iterator will those whose type corresponds to the value given in the ontology vocabulary associated with this model: see
Profile.TRANSITIVE_PROPERTY().- Returns:
- An iterator over transitive property resources.
-
listSymmetricProperties
ExtendedIterator<SymmetricProperty> listSymmetricProperties()Deprecated, for removal: This API element is subject to removal in a future version.Answer an iterator that ranges over the symmetric property resources in this model, i.e. the resources with
rdf:type SymmetricPropertyor equivalent.Specifically, the resources in this iterator will those whose type corresponds to the value given in the ontology vocabulary associated with this model: see
Profile.SYMMETRIC_PROPERTY().- Returns:
- An iterator over symmetric property resources.
-
listInverseFunctionalProperties
ExtendedIterator<InverseFunctionalProperty> listInverseFunctionalProperties()Deprecated, for removal: This API element is subject to removal in a future version.Answer an iterator that ranges over the inverse functional property resources in this model, i.e. the resources with
rdf:type InverseFunctionalPropertyor equivalent.Specifically, the resources in this iterator will those whose type corresponds to the value given in the ontology vocabulary associated with this model: see
Profile.INVERSE_FUNCTIONAL_PROPERTY().- Returns:
- An iterator over inverse functional property resources.
-
listIndividuals
ExtendedIterator<Individual> listIndividuals()Deprecated, for removal: This API element is subject to removal in a future version.Answer an iterator that ranges over the individual resources in this model, i.e. the resources with
rdf:typecorresponding to a class defined in the ontology.- Returns:
- An iterator over individual resources.
-
listIndividuals
Deprecated, for removal: This API element is subject to removal in a future version.Answer an iterator that ranges over the resources in this model that are instances of the given class.
- Returns:
- An iterator over individual resources whose
rdf:typeiscls.
-
listClasses
ExtendedIterator<OntClass> listClasses()Deprecated, for removal: This API element is subject to removal in a future version.Answer an iterator that ranges over all of the various forms of class description resource in this model. Class descriptions include
enumeratedclasses,unionclasses,complementclasses,intersectionclasses,namedclasses andproperty restrictions.- Returns:
- An iterator over class description resources.
-
listHierarchyRootClasses
ExtendedIterator<OntClass> listHierarchyRootClasses()Deprecated, for removal: This API element is subject to removal in a future version.Answer an iterator over the classes in this ontology model that represent the uppermost nodes of the class hierarchy. Depending on the underlying reasoner configuration, if any, these will be calculated as the classes that have Top (i.e.
owl:Thing) as a direct super-class, or the classes which have no declared super-class.- Returns:
- An iterator of the root classes in the local class hierarchy
-
listEnumeratedClasses
ExtendedIterator<EnumeratedClass> listEnumeratedClasses()Deprecated, for removal: This API element is subject to removal in a future version.Answer an iterator that ranges over the enumerated class class-descriptions in this model, i.e. the class resources specified to have a property
oneOf(or equivalent) and a list of values.- Returns:
- An iterator over enumerated class resources.
- See Also:
-
listUnionClasses
ExtendedIterator<UnionClass> listUnionClasses()Deprecated, for removal: This API element is subject to removal in a future version.Answer an iterator that ranges over the union class-descriptions in this model, i.e. the class resources specified to have a property
unionOf(or equivalent) and a list of values.- Returns:
- An iterator over union class resources.
- See Also:
-
listComplementClasses
ExtendedIterator<ComplementClass> listComplementClasses()Deprecated, for removal: This API element is subject to removal in a future version.Answer an iterator that ranges over the complement class-descriptions in this model, i.e. the class resources specified to have a property
complementOf(or equivalent) and a list of values.- Returns:
- An iterator over complement class resources.
- See Also:
-
listIntersectionClasses
ExtendedIterator<IntersectionClass> listIntersectionClasses()Deprecated, for removal: This API element is subject to removal in a future version.Answer an iterator that ranges over the intersection class-descriptions in this model, i.e. the class resources specified to have a property
intersectionOf(or equivalent) and a list of values.- Returns:
- An iterator over complement class resources.
- See Also:
-
listNamedClasses
ExtendedIterator<OntClass> listNamedClasses()Deprecated, for removal: This API element is subject to removal in a future version.Answer an iterator that ranges over the named class-descriptions in this model, i.e. resources with
rdf:type Class(or equivalent) and a node URI.- Returns:
- An iterator over named class resources.
-
listRestrictions
ExtendedIterator<Restriction> listRestrictions()Deprecated, for removal: This API element is subject to removal in a future version.Answer an iterator that ranges over the property restriction class-descriptions in this model, i.e. resources with
rdf:type Restriction(or equivalent).- Returns:
- An iterator over restriction class resources.
- See Also:
-
listAnnotationProperties
ExtendedIterator<AnnotationProperty> listAnnotationProperties()Deprecated, for removal: This API element is subject to removal in a future version.Answer an iterator that ranges over the properties in this model that are declared to be annotation properties. Not all supported languages define annotation properties (the category of annotation properties is chiefly an OWL innovation).
- Returns:
- An iterator over annotation properties.
- See Also:
-
listAllDifferent
ExtendedIterator<AllDifferent> listAllDifferent()Deprecated, for removal: This API element is subject to removal in a future version.Answer an iterator that ranges over the nodes that denote pair-wise disjointness between sets of classes.
- Returns:
- An iterator over AllDifferent nodes.
-
listDataRanges
ExtendedIterator<DataRange> listDataRanges()Deprecated, for removal: This API element is subject to removal in a future version.Answer an iterator over the DataRange objects in this ontology, if there are any.
- Returns:
- An iterator, whose values are
DataRangeobjects.
-
getOntology
Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource that represents an ontology description node in this model. If a resource with the given URI exists in the model, and can be viewed as an Ontology, return the Ontology facet, otherwise return null.
- Parameters:
uri- The URI for the ontology node. Conventionally, this corresponds to the base URI of the document itself.- Returns:
- An Ontology resource or null.
-
getIndividual
Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource that represents an Individual node in this model. If a resource with the given URI exists in the model, and can be viewed as an Individual, return the Individual facet, otherwise return null.
- Parameters:
uri- The URI for the required individual- Returns:
- An Individual resource or null.
-
getOntProperty
Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource representing an generic property in this model. If a property with the given URI exists in the model, return the OntProperty facet, otherwise return null.
- Parameters:
uri- The URI for the property.- Returns:
- An OntProperty resource or null.
-
getObjectProperty
Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource representing an object property in this model. If a resource with the given URI exists in the model, and can be viewed as an ObjectProperty, return the ObjectProperty facet, otherwise return null.
- Parameters:
uri- The URI for the object property. May not be null.- Returns:
- An ObjectProperty resource or null.
-
getTransitiveProperty
Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource representing a transitive property. If a resource with the given URI exists in the model, and can be viewed as a TransitiveProperty, return the TransitiveProperty facet, otherwise return null.
- Parameters:
uri- The URI for the property. May not be null.- Returns:
- A TransitiveProperty resource or null
-
getSymmetricProperty
Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource representing a symmetric property. If a resource with the given URI exists in the model, and can be viewed as a SymmetricProperty, return the SymmetricProperty facet, otherwise return null.
- Parameters:
uri- The URI for the property. May not be null.- Returns:
- A SymmetricProperty resource or null
-
getInverseFunctionalProperty
Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource representing an inverse functional property. If a resource with the given URI exists in the model, and can be viewed as a InverseFunctionalProperty, return the InverseFunctionalProperty facet, otherwise return null.
- Parameters:
uri- The URI for the property. May not be null.- Returns:
- An InverseFunctionalProperty resource or null
-
getDatatypeProperty
Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource that represents datatype property in this model. . If a resource with the given URI exists in the model, and can be viewed as a DatatypeProperty, return the DatatypeProperty facet, otherwise return null.
- Parameters:
uri- The URI for the datatype property. May not be null.- Returns:
- A DatatypeProperty resource or null
-
getAnnotationProperty
Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource that represents an annotation property in this model. If a resource with the given URI exists in the model, and can be viewed as an AnnotationProperty, return the AnnotationProperty facet, otherwise return null.
- Parameters:
uri- The URI for the annotation property. May not be null.- Returns:
- An AnnotationProperty resource or null
-
getOntResource
Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource presenting the
OntResourcefacet, which has the given URI. If no such resource is currently present in the model, return null.- Parameters:
uri- The URI of a resource- Returns:
- An OntResource with the given URI, or null
-
getOntResource
Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource presenting the
OntResourcefacet, which corresponds to the given resource but attached to this model.- Parameters:
res- An existing resource- Returns:
- An OntResource attached to this model that has the same URI or anonID as the given resource
-
getOntClass
Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource that represents a class description node in this model. If a resource with the given URI exists in the model, and can be viewed as an OntClass, return the OntClass facet, otherwise return null.
- Parameters:
uri- The URI for the class node, or null for an anonymous class.- Returns:
- An OntClass resource or null.
-
getComplementClass
Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource representing the class that is the complement of another class. If a resource with the given URI exists in the model, and can be viewed as a ComplementClass, return the ComplementClass facet, otherwise return null.
- Parameters:
uri- The URI of the new complement class.- Returns:
- A complement class or null
-
getEnumeratedClass
Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource representing the class that is the enumeration of a list of individuals. If a resource with the given URI exists in the model, and can be viewed as an EnumeratedClass, return the EnumeratedClass facet, otherwise return null.
- Parameters:
uri- The URI of the new enumeration class.- Returns:
- An enumeration class or null
-
getUnionClass
Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource representing the class that is the union of a list of class descriptions. If a resource with the given URI exists in the model, and can be viewed as a UnionClass, return the UnionClass facet, otherwise return null.
- Parameters:
uri- The URI of the new union class.- Returns:
- A union class description or null
-
getIntersectionClass
Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource representing the class that is the intersection of a list of class descriptions. If a resource with the given URI exists in the model, and can be viewed as a IntersectionClass, return the IntersectionClass facet, otherwise return null.
- Parameters:
uri- The URI of the new intersection class.- Returns:
- An intersection class description or null
-
getRestriction
Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource that represents a property restriction in this model. If a resource with the given URI exists in the model, and can be viewed as a Restriction, return the Restriction facet, otherwise return null.
- Parameters:
uri- The URI for the restriction node.- Returns:
- A Restriction resource or null
-
getHasValueRestriction
Deprecated, for removal: This API element is subject to removal in a future version.Answer a class description defined as the class of those individuals that have the given resource as the value of the given property. If a resource with the given URI exists in the model, and can be viewed as a HasValueRestriction, return the HasValueRestriction facet, otherwise return null.
- Parameters:
uri- The URI for the restriction- Returns:
- A resource representing a has-value restriction or null
-
getSomeValuesFromRestriction
Deprecated, for removal: This API element is subject to removal in a future version.Answer a class description defined as the class of those individuals that have at least one property with a value belonging to the given class. If a resource with the given URI exists in the model, and can be viewed as a SomeValuesFromRestriction, return the SomeValuesFromRestriction facet, otherwise return null.
- Parameters:
uri- The URI for the restriction- Returns:
- A resource representing a some-values-from restriction, or null
-
getAllValuesFromRestriction
Deprecated, for removal: This API element is subject to removal in a future version.Answer a class description defined as the class of those individuals for which all values of the given property belong to the given class. If a resource with the given URI exists in the model, and can be viewed as an AllValuesFromResriction, return the AllValuesFromRestriction facet, otherwise return null.
- Parameters:
uri- The URI for the restriction- Returns:
- A resource representing an all-values-from restriction or null
-
getCardinalityRestriction
Deprecated, for removal: This API element is subject to removal in a future version.Answer a class description defined as the class of those individuals that have exactly the given number of values for the given property. If a resource with the given URI exists in the model, and can be viewed as a CardinalityRestriction, return the CardinalityRestriction facet, otherwise return null.
- Parameters:
uri- The URI for the restriction- Returns:
- A resource representing a has-value restriction, or null
-
getMinCardinalityRestriction
Deprecated, for removal: This API element is subject to removal in a future version.Answer a class description defined as the class of those individuals that have at least the given number of values for the given property. If a resource with the given URI exists in the model, and can be viewed as a MinCardinalityRestriction, return the MinCardinalityRestriction facet, otherwise return null.
- Parameters:
uri- The URI for the restriction- Returns:
- A resource representing a minimum cardinality restriction, or null
-
getMaxCardinalityRestriction
Deprecated, for removal: This API element is subject to removal in a future version.Answer a class description defined as the class of those individuals that have at most the given number of values for the given property. If a resource with the given URI exists in the model, and can be viewed as a MaxCardinalityRestriction, return the MaxCardinalityRestriction facet, otherwise return null.
- Parameters:
uri- The URI for the restriction- Returns:
- A resource representing a max-cardinality restriction, or null
-
getQualifiedRestriction
Deprecated, for removal: This API element is subject to removal in a future version.Answer a class description defined as the class of those individuals that have a property p, all values of which are members of a given class. Typically used with a cardinality constraint. If a resource with the given URI exists in the model, and can be viewed as a QualifiedRestriction, return the QualifiedRestriction facet, otherwise return null.
- Parameters:
uri- The URI for the restriction- Returns:
- A resource representing a qualified restriction, or null
-
getCardinalityQRestriction
Deprecated, for removal: This API element is subject to removal in a future version.Answer a class description defined as the class of those individuals that have a property p, with cardinality N, all values of which are members of a given class. If a resource with the given URI exists in the model, and can be viewed as a CardinalityQRestriction, return the CardinalityQRestriction facet, otherwise return null.
- Parameters:
uri- The URI for the restriction- Returns:
- A resource representing a qualified cardinality restriction, or null
-
getMinCardinalityQRestriction
Deprecated, for removal: This API element is subject to removal in a future version.Answer a class description defined as the class of those individuals that have a property p, with minimum cardinality N, all values of which are members of a given class. If a resource with the given URI exists in the model, and can be viewed as a MinCardinalityQRestriction, return the MinCardinalityQRestriction facet, otherwise return null.
- Parameters:
uri- The URI for the restriction- Returns:
- A resource representing a qualified minimum cardinality restriction, or null
-
getMaxCardinalityQRestriction
Deprecated, for removal: This API element is subject to removal in a future version.Answer a class description defined as the class of those individuals that have a property p, with max cardinality N, all values of which are members of a given class. If a resource with the given URI exists in the model, and can be viewed as a MaxCardinalityQRestriction, return the MaxCardinalityQRestriction facet, otherwise return null.
- Parameters:
uri- The URI for the restriction- Returns:
- A resource representing a qualified max cardinality restriction, or null
-
createOntology
Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource that represents an ontology description node in this model. If a resource with the given URI exists in the model, it will be re-used. If not, a new one is created in the writable sub-model of the ontology model.
- Parameters:
uri- The URI for the ontology node. Conventionally, this corresponds to the base URI of the document itself.- Returns:
- An Ontology resource.
-
createIndividual
Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource that represents an
Individualnode in this model. A new anonymous resource will be created in the writable sub-model of the ontology model.- Parameters:
cls- Resource representing the ontology class to which the individual belongs- Returns:
- A new anonymous Individual of the given class.
-
createIndividual
Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource that represents an Individual node in this model. If a resource with the given URI exists in the model, it will be re-used. If not, a new one is created in the writable sub-model of the ontology model.
- Parameters:
uri- The URI for the individual, or null for an anonymous individual.cls- Resource representing the ontology class to which the individual belongs.- Returns:
- An Individual resource.
-
createOntProperty
Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource representing an generic property in this model. Effectively this method is an alias for
ModelCon.createProperty(String), except that the return type isOntProperty, which allow more convenient access to a property's position in the property hierarchy, domain, range, etc.- Parameters:
uri- The URI for the property. May not be null.- Returns:
- An OntProperty resource.
-
createObjectProperty
Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource representing an object property in this model, and that is not a functional property.
- Parameters:
uri- The URI for the object property. May not be null.- Returns:
- An ObjectProperty resource.
- See Also:
-
createObjectProperty
Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource that represents an object property in this model. An object property is defined to have a range of individuals, rather than datatypes. If a resource with the given URI exists in the model, it will be re-used. If not, a new one is created in the writable sub-model of the ontology model.
- Parameters:
uri- The URI for the object property. May not be null.functional- If true, the resource will also be typed as aFunctionalProperty, that is, a property that has a unique range value for any given domain value.- Returns:
- An ObjectProperty resource, optionally also functional.
-
createTransitiveProperty
Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource representing a transitive property
- Parameters:
uri- The URI for the property. May not be null.- Returns:
- An TransitiveProperty resource
- See Also:
-
createTransitiveProperty
Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource representing a transitive property, which is optionally also functional. Note: although it is permitted in OWL full to have functional transitive properties, it makes the language undecidable. Functional transitive properties are not permitted in OWL-Lite or OWL DL.
- Parameters:
uri- The URI for the property. May not be null.functional- If true, the property is also functional- Returns:
- An TransitiveProperty resource, optionally also functional.
-
createSymmetricProperty
Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource representing a symmetric property
- Parameters:
uri- The URI for the property. May not be null.- Returns:
- An SymmetricProperty resource
- See Also:
-
createSymmetricProperty
Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource representing a symmetric property, which is optionally also functional.
- Parameters:
uri- The URI for the property. May not be null.functional- If true, the property is also functional- Returns:
- An SymmetricProperty resource, optionally also functional.
-
createInverseFunctionalProperty
Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource representing an inverse functional property
- Parameters:
uri- The URI for the property. May not be null.- Returns:
- An InverseFunctionalProperty resource
- See Also:
-
createInverseFunctionalProperty
Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource representing an inverse functional property, which is optionally also functional.
- Parameters:
uri- The URI for the property. May not be null.functional- If true, the property is also functional- Returns:
- An InverseFunctionalProperty resource, optionally also functional.
-
createDatatypeProperty
Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource that represents datatype property in this model, and that is not a functional property.
- Parameters:
uri- The URI for the datatype property. May not be null.- Returns:
- A DatatypeProperty resource.
- See Also:
-
createDatatypeProperty
Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource that represents datatype property in this model. A datatype property is defined to have a range that is a concrete datatype, rather than an individual. If a resource with the given URI exists in the model, it will be re-used. If not, a new one is created in the writable sub-model of the ontology model.
- Parameters:
uri- The URI for the datatype property. May not be null.functional- If true, the resource will also be typed as aFunctionalProperty, that is, a property that has a unique range value for any given domain value.- Returns:
- A DatatypeProperty resource.
-
createAnnotationProperty
Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource that represents an annotation property in this model. If a resource with the given URI exists in the model, it will be re-used. If not, a new one is created in the writable sub-model of the ontology model.
- Parameters:
uri- The URI for the annotation property. May not be null.- Returns:
- An AnnotationProperty resource.
-
createClass
OntClass createClass()Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource that represents an anonymous class description in this model. A new anonymous resource of
rdf:type C, where C is the class type from the language profile.- Returns:
- An anonymous Class resource.
-
createClass
Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource that represents a class description node in this model. If a resource with the given URI exists in the model, it will be re-used. If not, a new one is created in the writable sub-model of the ontology model.
- Parameters:
uri- The URI for the class node, or null for an anonymous class.- Returns:
- A Class resource.
-
createComplementClass
Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource representing the class that is the complement of the given argument class
- Parameters:
uri- The URI of the new complement class, or null for an anonymous class description.cls- Resource denoting the class that the new class is a complement of- Returns:
- A complement class
-
createEnumeratedClass
Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource representing the class that is the enumeration of the given list of individuals
- Parameters:
uri- The URI of the new enumeration class, or null for an anonymous class description.members- An optional list of resources denoting the individuals in the enumeration, or null.- Returns:
- An enumeration class
-
createUnionClass
Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource representing the class that is the union of the given list of class descriptions
- Parameters:
uri- The URI of the new union class, or null for an anonymous class description.members- A list of resources denoting the classes that comprise the union- Returns:
- A union class description
-
createIntersectionClass
Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource representing the class that is the intersection of the given list of class descriptions.
- Parameters:
uri- The URI of the new intersection class, or null for an anonymous class description.members- A list of resources denoting the classes that comprise the intersection- Returns:
- An intersection class description
-
createRestriction
Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource that represents an anonymous property restriction in this model. A new anonymous resource of
rdf:type R, where R is the restriction type from the language profile.- Parameters:
p- The property that is restricted by this restriction, or null to omit from the restriction- Returns:
- An anonymous Restriction resource.
-
createRestriction
Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource that represents a property restriction in this model. If a resource with the given URI exists in the model, it will be re-used. If not, a new one is created in the writable sub-model of the ontology model.
- Parameters:
uri- The URI for the restriction node, or null for an anonymous restriction.p- The property that is restricted by this restriction, or null to omit from the restriction- Returns:
- A Restriction resource.
-
createHasValueRestriction
Deprecated, for removal: This API element is subject to removal in a future version.Answer a class description defined as the class of those individuals that have the given resource as the value of the given property
- Parameters:
uri- The optional URI for the restriction, or null for an anonymous restriction (which should be the normal case)prop- The property the restriction applies tovalue- The value of the property, as a resource or RDF literal- Returns:
- A new resource representing a has-value restriction
-
createSomeValuesFromRestriction
Deprecated, for removal: This API element is subject to removal in a future version.Answer a class description defined as the class of those individuals that have at least one property with a value belonging to the given class
- Parameters:
uri- The optional URI for the restriction, or null for an anonymous restriction (which should be the normal case)prop- The property the restriction applies tocls- The class to which at least one value of the property belongs- Returns:
- A new resource representing a some-values-from restriction
-
createAllValuesFromRestriction
Deprecated, for removal: This API element is subject to removal in a future version.Answer a class description defined as the class of those individuals for which all values of the given property belong to the given class
- Parameters:
uri- The optional URI for the restriction, or null for an anonymous restriction (which should be the normal case)prop- The property the restriction applies tocls- The class to which any value of the property belongs- Returns:
- A new resource representing an all-values-from restriction
-
createCardinalityRestriction
Deprecated, for removal: This API element is subject to removal in a future version.Answer a class description defined as the class of those individuals that have exactly the given number of values for the given property.
- Parameters:
uri- The optional URI for the restriction, or null for an anonymous restriction (which should be the normal case)prop- The property the restriction applies tocardinality- The exact cardinality of the property- Returns:
- A new resource representing a cardinality restriction
-
createMinCardinalityRestriction
MinCardinalityRestriction createMinCardinalityRestriction(String uri, Property prop, int cardinality) Deprecated, for removal: This API element is subject to removal in a future version.Answer a class description defined as the class of those individuals that have at least the given number of values for the given property.
- Parameters:
uri- The optional URI for the restriction, or null for an anonymous restriction (which should be the normal case)prop- The property the restriction applies tocardinality- The minimum cardinality of the property- Returns:
- A new resource representing a min-cardinality restriction
-
createMaxCardinalityRestriction
MaxCardinalityRestriction createMaxCardinalityRestriction(String uri, Property prop, int cardinality) Deprecated, for removal: This API element is subject to removal in a future version.Answer a class description defined as the class of those individuals that have at most the given number of values for the given property.
- Parameters:
uri- The optional URI for the restriction, or null for an anonymous restriction (which should be the normal case)prop- The property the restriction applies tocardinality- The maximum cardinality of the property- Returns:
- A new resource representing a max-cardinality restriction
-
createMaxCardinalityQRestriction
MaxCardinalityQRestriction createMaxCardinalityQRestriction(String uri, Property prop, int cardinality, OntClass cls) Deprecated, for removal: This API element is subject to removal in a future version.Answer a class description defined as the class of those individuals that have at most the given number of values for the given property, all values of which belong to the given class.
- Parameters:
uri- The optional URI for the restriction, or null for an anonymous restriction (which should be the normal case)prop- The property the restriction applies tocardinality- The maximum cardinality of the propertycls- The class to which all values of the restricted property should belong- Returns:
- A new resource representing a max-cardinality-q restriction
-
createMinCardinalityQRestriction
MinCardinalityQRestriction createMinCardinalityQRestriction(String uri, Property prop, int cardinality, OntClass cls) Deprecated, for removal: This API element is subject to removal in a future version.Answer a class description defined as the class of those individuals that have at least the given number of values for the given property, all values of which belong to the given class.
- Parameters:
uri- The optional URI for the restriction, or null for an anonymous restriction (which should be the normal case)prop- The property the restriction applies tocardinality- The minimum cardinality of the propertycls- The class to which all values of the restricted property should belong- Returns:
- A new resource representing a min-cardinality-q restriction
-
createCardinalityQRestriction
CardinalityQRestriction createCardinalityQRestriction(String uri, Property prop, int cardinality, OntClass cls) Deprecated, for removal: This API element is subject to removal in a future version.Answer a class description defined as the class of those individuals that have exactly the given number of values for the given property, all values of which belong to the given class.
- Parameters:
uri- The optional URI for the restriction, or null for an anonymous restriction (which should be the normal case)prop- The property the restriction applies tocardinality- The cardinality of the propertycls- The class to which all values of the restricted property should belong- Returns:
- A new resource representing a cardinality-q restriction
-
createDataRange
Deprecated, for removal: This API element is subject to removal in a future version.Answer a data range defined as the given set of concrete data values. DataRange resources are necessarily bNodes.
- Parameters:
literals- A list of literals that will be the members of the data range, or null to define an empty data range- Returns:
- A new data range containing the given literals as permissible values
-
createAllDifferent
AllDifferent createAllDifferent()Deprecated, for removal: This API element is subject to removal in a future version.Answer a new, anonymous node representing the fact that a given set of classes are all pair-wise distinct.
AllDifferentis a feature of OWL only, and is something of an anomaly in that it exists only to give a place to anchor thedistinctMembersproperty, which is the actual expression of the fact.- Returns:
- A new AllDifferent resource
-
createAllDifferent
Deprecated, for removal: This API element is subject to removal in a future version.Answer a new, anonymous node representing the fact that a given set of classes are all pair-wise distinct.
AllDifferentis a feature of OWL only, and is something of an anomaly in that it exists only to give a place to anchor thedistinctMembersproperty, which is the actual expression of the fact.- Parameters:
differentMembers- A list of the class expressions that denote a set of mutually disjoint classes- Returns:
- A new AllDifferent resource
-
createOntResource
Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource that represents a generic ontology node in this model. If a resource with the given URI exists in the model, it will be re-used. If not, a new one is created in the writable sub-model of the ontology model.
This is a generic method for creating any known ontology value. The selector that determines which resource to create is the same as as the argument to the
as()method: the Java class object of the desired abstraction. For example, to create an ontology class via this mechanism, use:OntClass c = (OntClass) myModel.createOntResource( OntClass.class, null, "http://example.org/ex#Parrot" );- Parameters:
javaClass- The Java class object that represents the ontology abstraction to createrdfType- Optional resource denoting the ontology class to which an individual or axiom belongs, if that is the type of resource being created.uri- The URI for the ontology resource, or null for an anonymous resource.- Returns:
- An ontology resource, of the type specified by the
javaClass
-
createOntResource
Deprecated, for removal: This API element is subject to removal in a future version.Answer a resource presenting the
OntResourcefacet, which has the given URI.- Parameters:
uri- The URI of the resource, or null for an anonymous resource (i.e. bNode)- Returns:
- An OntResource with the given URI
-
loadImports
void loadImports()Deprecated, for removal: This API element is subject to removal in a future version.Determine which models this model imports (by looking for, for example,
owl:importsstatements, and load each of those models as an import. A check is made to determine if a model has already been imported, if so, the import is ignored. Thus this method is safe against circular sets of import statements. Note that actual implementation is delegated to the associatedOntDocumentManager. -
listImportedOntologyURIs
Deprecated, for removal: This API element is subject to removal in a future version.Answer a list of the imported URI's in this ontology model. Detection of
importsstatements will be according to the local language profile. Note that, in order to allow this method to be called during the imports closure process, we only query the base model, thus side-stepping the any attached reasoner.- Returns:
- The imported ontology URI's as a set. Note that since the underlying graph is not ordered, the order of values in the list in successive calls to this method is not guaranteed to be preserved.
-
listImportedOntologyURIs
Deprecated, for removal: This API element is subject to removal in a future version.Answer a list of the imported URI's in this ontology model, and optionally in the closure of this model's imports. Detection of
importsstatements will be according to the local language profile. Note that, in order to allow this method to be called during the imports closure process, we only query the base model, thus side-stepping the any attached reasoner.- Parameters:
closure- If true, the set of URI's returned will include not only those directly imported by this model, but those imported by the model's imports, and so on transitively.- Returns:
- A set of imported ontology URIs. Note that since the underlying graph is not ordered, the order of values in the list in successive calls to this method is not guaranteed to be preserved.
-
hasLoadedImport
Deprecated, for removal: This API element is subject to removal in a future version.Answer true if this model has had the given URI document imported into it. This is important to know since an import only occurs once, and we also want to be able to detect cycles of imports.
- Parameters:
uri- An ontology URI- Returns:
- True if the document corresponding to the URI has been successfully loaded into this model
-
addLoadedImport
Deprecated, for removal: This API element is subject to removal in a future version.Record that this model has now imported the document with the given URI, so that it will not be re-imported in the future.
- Parameters:
uri- A document URI that has now been imported into the model.
-
removeLoadedImport
Deprecated, for removal: This API element is subject to removal in a future version.Record that this model no longer imports the document with the given URI.
- Parameters:
uri- A document URI that is no longer imported into the model.
-
getProfile
Profile getProfile()Deprecated, for removal: This API element is subject to removal in a future version.Answer the language profile (for example, OWL or DAML+OIL) that this model is working to.
- Returns:
- A language profile
-
getImportModelMaker
ModelMaker getImportModelMaker()Deprecated, for removal: This API element is subject to removal in a future version.Answer the model maker associated with this model (used for constructing the constituent models of the imports closure).
- Returns:
- The local model maker
-
getSubGraphs
Deprecated, for removal: This API element is subject to removal in a future version.i.next() Answer the sub-graphs of this model. A sub-graph is defined as a graph that is used to contain the triples from an imported document.
- Returns:
- A list of graphs that are contained in this ontology model
-
listSubModels
Deprecated, for removal: This API element is subject to removal in a future version.Answer an iterator over the ontology models that are sub-models of this model. Sub-models are used, for example, to represent composite documents such as the imports of a model. So if ontology A imports ontologies B and C, each of B and C will be available as one of the sub-models of the model containing A. This method replaces the older
listImportedModels. Note that to fully replicate the behaviour oflistImportedModels, thewithImportsflag must be set to true. Each model returned by this method will have been wrapped as an ontology model using the sameOntModelSpecas this model. If this model has no sub-models, the returned iterator will be non-null but will not have any values.- Parameters:
withImports- If true, each sub-model returned by this method will also include its import models. So if model A imports D, and D imports E, when called withwithImportsset to true, the return value formodelA.listSubModels(true)will be an iterator, whose only value is a model for D, and that model will contain a sub-model representing the import of E. IfwithImportsis false, E will not be included as a sub-model of D.- Returns:
- An iterator, each value of which will be an
OntModelrepresenting a sub-model of this ontology.
-
listSubModels
ExtendedIterator<OntModel> listSubModels()Deprecated, for removal: This API element is subject to removal in a future version.Answer an iterator over the ontology models that are sub-models of this model. Sub-models are used, for example, to represent composite documents such as the imports of a model. So if ontology A imports ontologies B and C, each of B and C will be available as one of the sub-models of the model containing A. Important note on behaviour change: please see the comment on
listSubModels(boolean)for explanation of thewithImportsflag. This zero-argument form oflistSubModelssetswithImportsto false, so the returned models will not themselves contain imports.- Returns:
- An iterator, each value of which will be an
OntModelrepresenting a sub-model of this ontology. - See Also:
-
countSubModels
int countSubModels()Deprecated, for removal: This API element is subject to removal in a future version.Answer the number of sub-models of this model, not including the base model.
- Returns:
- The number of sub-models, ≥ zero.
-
getImportedModel
Deprecated, for removal: This API element is subject to removal in a future version.Answer an
OntModelrepresenting the imported ontology with the given URI. If an ontology with that URI has not been imported, answer null.- Parameters:
uri- The URI of an ontology that may have been imported into the ontology represented by this model- Returns:
- A model representing the imported ontology with the given URI, or null.
-
getBaseModel
Model getBaseModel()Deprecated, for removal: This API element is subject to removal in a future version.Answer the base model of this model. The base model is the model that contains the triples read from the source document for this ontology. It is therefore this base model that will be updated if statements are added to a model that is built from a union of documents (via the
importsstatements in the source document).- Returns:
- The base model for this ontology model
-
addSubModel
Deprecated, for removal: This API element is subject to removal in a future version.Add the given model as one of the sub-models of the enclosed ontology union model. Will cause the associated inference engine (if any) to update, so this may be an expensive operation in some cases.
- Parameters:
model- A sub-model to add- See Also:
-
addSubModel
Deprecated, for removal: This API element is subject to removal in a future version.Add the given model as one of the sub-models of the enclosed ontology union model.
- Parameters:
model- A sub-model to addrebind- If true, rebind any associated inferencing engine to the new data (which may be an expensive operation)
-
removeSubModel
Deprecated, for removal: This API element is subject to removal in a future version.Remove the given model as one of the sub-models of the enclosed ontology union model. Will cause the associated inference engine (if any) to update, so this may be an expensive operation in some cases.
- Parameters:
model- A sub-model to remove- See Also:
-
removeSubModel
Deprecated, for removal: This API element is subject to removal in a future version.Remove the given model as one of the sub-models of the enclosed ontology union model.
- Parameters:
model- A sub-model to removerebind- If true, rebind any associated inferencing engine to the new data (which may be an expensive operation)
-
isInBaseModel
Deprecated, for removal: This API element is subject to removal in a future version.Answer true if the given node is a member of the base model of this ontology model. This is an important distinction, because only the base model receives updates when the ontology model is updated. Thus, removing properties of a resource that is not in the base model will not actually side-effect the overall model.
- Parameters:
node- An RDF node (Resource, Property or Literal) to test- Returns:
- True if the given node is from the base model
-
isInBaseModel
Deprecated, for removal: This API element is subject to removal in a future version.Answer true if the given statement is defined in the base model of this ontology model. This is an important distinction, because only the base model receives updates when the ontology model is updated. Thus, removing a statement that is not in the base model will not actually side-effect the overall model.
- Parameters:
stmt- A statement to test- Returns:
- True if the given statement is from the base model
-
strictMode
boolean strictMode()Deprecated, for removal: This API element is subject to removal in a future version.Answer true if this model is currently in strict checking mode. Strict mode means that converting a common resource to a particular language element, such as an ontology class, will be subject to some simple syntactic-level checks for appropriateness.
- Returns:
- True if in strict checking mode
-
setStrictMode
void setStrictMode(boolean strict) Deprecated, for removal: This API element is subject to removal in a future version.Set the checking mode to strict or non-strict.
- Parameters:
strict-- See Also:
-
setDynamicImports
void setDynamicImports(boolean dynamic) Deprecated, for removal: This API element is subject to removal in a future version.Set the flag that controls whether adding or removing imports statements into the model will result in the imports closure changing dynamically.
- Parameters:
dynamic- If true, adding or removing an imports statement to the model will result in a change in the imports closure. If false, changes to the imports are not monitored dynamically. Default false.
-
getDynamicImports
boolean getDynamicImports()Deprecated, for removal: This API element is subject to removal in a future version.Answer true if the imports closure of the model will be dynamically updated as imports statements are added and removed.
- Returns:
- True if the imports closure is updated dynamically.
-
getDocumentManager
OntDocumentManager getDocumentManager()Deprecated, for removal: This API element is subject to removal in a future version.Answer a reference to the document manager that this model is using to manage ontology <-> mappings, and to load the imports closure. Note by default, an ontology model is constructed with a reference to the shared, global document manager. Thus changing the settings via this model's document manager may affect other models also using the same instance.
- Returns:
- A reference to this model's document manager
-
getSpecification
OntModelSpec getSpecification()Deprecated, for removal: This API element is subject to removal in a future version.Answer the ontology model specification that was used to construct this model
- Returns:
- An ont model spec instance.
-
write
Deprecated, for removal: This API element is subject to removal in a future version.Write the model as an XML document. It is often better to use an OutputStream rather than a Writer, since this will avoid character encoding errors. 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. -
write
Deprecated, for removal: This API element is subject to removal in a future version.Write a serialized representation of a model in a specified language. It is often better to use an OutputStream rather than a Writer, since this will avoid character encoding errors. 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
langargument. Predefined values are "RDF/XML", "RDF/XML-ABBREV", "N-TRIPLE" and "TURTLE". The default value, represented bynullis "RDF/XML". -
write
Deprecated, for removal: This API element is subject to removal in a future version.Write a serialized representation of a model in a specified language. It is often better to use an OutputStream rather than a Writer, since this will avoid character encoding errors. 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
langargument. Predefined values are "RDF/XML", "RDF/XML-ABBREV", "N-TRIPLE" and "TURTLE". The default value, represented bynull, is "RDF/XML". -
write
Deprecated, for removal: This API element is subject to removal in a future version.Write a serialization of this model as an XML document. 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
langargument. Predefined values are "RDF/XML", "RDF/XML-ABBREV", "N-TRIPLE" and "TURTLE". The default value is represented bynullis "RDF/XML". -
write
Deprecated, for removal: This API element is subject to removal in a future version.Write a serialized representation of this 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
langargument. Predefined values are "RDF/XML", "RDF/XML-ABBREV", "N-TRIPLE" and "TURTLE". The default value, represented bynull, is "RDF/XML". -
write
Deprecated, for removal: This API element is subject to removal in a future version.Write 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
langargument. Predefined values are "RDF/XML", "RDF/XML-ABBREV", "N-TRIPLE" and "TURTLE". The default value, represented bynull, is "RDF/XML". -
writeAll
Deprecated, for removal: This API element is subject to removal in a future version.Write a serialized representation of all of the contents of the model, including inferred statements and statements imported from other documents. To write only the data asserted in the base model, use
write. 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
langargument. Predefined values are "RDF/XML", "RDF/XML-ABBREV", "N-TRIPLE" and "TURTLE". The default value, represented bynull, is "RDF/XML".- Parameters:
writer- The output writerlang- The language in which the RDF should be writtenbase- The base URI for relative URI calculations.nullmeans use only absolute URI's.- Returns:
- This model
-
writeAll
Deprecated, for removal: This API element is subject to removal in a future version.Write a serialized representation of all of the contents of the model, 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
langargument. Predefined values are "RDF/XML", "RDF/XML-ABBREV", "N-TRIPLE" and "TURTLE". The default value, represented bynull, is "RDF/XML".- Parameters:
out- The output stream to which the RDF is writtenlang- The language in which the RDF should be writtenbase- The base URI to use when writing relative URI's.nullmeans use only absolute URI's.- Returns:
- This model
-
writeAll
Deprecated, for removal: This API element is subject to removal in a future version.Write a serialized representation of all of the contents of the model, including inferred statements and statements imported from other documents. To write only the data asserted in the base model, use
write. 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
langargument. Predefined values are "RDF/XML", "RDF/XML-ABBREV", "N-TRIPLE" and "TURTLE". The default value, represented bynull, is "RDF/XML".- Parameters:
writer- The output writerlang- The language in which the RDF should be written- Returns:
- This model
-
writeAll
Deprecated, for removal: This API element is subject to removal in a future version.Write a serialized representation of all of the contents of the model, 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
langargument. Predefined values are "RDF/XML", "RDF/XML-ABBREV", "N-TRIPLE" and "TURTLE". The default value, represented bynull, is "RDF/XML".- Parameters:
out- The output stream to which the RDF is writtenlang- The language in which the RDF should be written- Returns:
- This model
-