- All Superinterfaces:
org.apache.jena.shared.Lock
,org.apache.jena.rdf.model.Model
,org.apache.jena.rdf.model.ModelCon
,org.apache.jena.rdf.model.ModelGraphInterface
,org.apache.jena.shared.PrefixMapping
,org.apache.jena.rdf.model.RDFReaderF
,org.apache.jena.rdf.model.RDFWriterF
- All Known Implementing Classes:
OntGraphModelImpl
Jena Model
about which is known
to contain OWL or RDFS ontology data.
The view supports OWL2 DL specification,
and is an analogue of Apache Jena OntModel
,
which only covers the OWL1 syntax.
In addition to the standard Jena Resource
s and Jena Statement
s
this model provides access to different ontological components in the form of Object
s
and Ontology Statement
s that support OWL Annotations.
Some of the OntObject
s can be constructed using another kind of resource -
OntList
, which is an extended analogue of the standard Jena RDFList
.
The model also has a component-level support of Semantic Web Rule Language (SWRL).
In additional to native Jena Extended Iterator
s,
this model also provides access to RDF in the form of Stream
s, that obey the same rules:
both Stream
and ExtendedIterator
must be closed explicitly
if they are no longer needed but not yet exhausted, see ClosableIterator
.
Impl note: this model does not support Jena Profile
s mechanism,
and model configuration is delegated directly to the extended Personality
.
The interface does not extend InfModel
,
but the inference model can be accessed via asInferenceModel()
.
If implementation does not provide inference support, the method will throw an exception.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.jena.shared.PrefixMapping
org.apache.jena.shared.PrefixMapping.Factory, org.apache.jena.shared.PrefixMapping.IllegalPrefixException, org.apache.jena.shared.PrefixMapping.JenaLockedException
-
Field Summary
Fields inherited from interface org.apache.jena.shared.Lock
READ, WRITE
Fields inherited from interface org.apache.jena.shared.PrefixMapping
Extended, Standard
-
Method Summary
Modifier and TypeMethodDescriptionadd
(org.apache.jena.rdf.model.Model m) add
(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, String lex, String lang) add
(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, String lex, org.apache.jena.datatypes.RDFDatatype datatype) add
(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.RDFNode o) add
(org.apache.jena.rdf.model.Statement s) add
(org.apache.jena.rdf.model.Statement[] statements) add
(org.apache.jena.rdf.model.StmtIterator it) Adds a sub-model both to theowl:import
section and to the graph hierarchy.addLiteral
(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, boolean v) addLiteral
(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, char v) addLiteral
(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, double v) addLiteral
(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, float v) addLiteral
(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, int v) addLiteral
(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, long v) addLiteral
(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.Literal o) default Stream<OntAnnotationProperty>
Lists all annotation properties.default org.apache.jena.rdf.model.InfModel
Returns a view of this model that supports inference, if possible.asStatement
(org.apache.jena.graph.Triple triple) Answers anOntology Statement
in this model who's SPO is that of thetriple
.default Stream<OntClass.Named>
classes()
Lists all named class expressions (OWL classes).default OntAnnotationProperty
Creates annotation property (owl-entity).createBuiltInSWRLAtom
(org.apache.jena.rdf.model.Resource predicate, Collection<OntSWRL.DArg> arguments) Creates a BuiltIn Atom.createClassSWRLAtom
(OntClass clazz, OntSWRL.IArg arg) Creates a Class Atom.createDataAllValuesFrom
(Collection<OntDataProperty> properties, OntDataRange dr) Creates an N-Ary Data Universal Quantification N-Ary Restriction.createDataAllValuesFrom
(OntDataProperty property, OntDataRange dr) Creates a Universal Quantification Data Property Restriction.createDataCardinality
(OntDataProperty property, int cardinality, OntDataRange dr) Creates a Data Exact Cardinality Restriction, possible Qualified.Creates a Complement of Data Ranges.createDataHasValue
(OntDataProperty property, org.apache.jena.rdf.model.Literal literal) Creates a Literal Value Restriction.Creates an Intersection of Data Ranges.default OntDataRange.IntersectionOf
createDataIntersectionOf
(OntDataRange... values) Creates an Intersection of Data Ranges.createDataMaxCardinality
(OntDataProperty property, int cardinality, OntDataRange dr) Creates a Data Maximum Cardinality Restriction, possible Qualified.createDataMinCardinality
(OntDataProperty property, int cardinality, OntDataRange dr) Creates a Data Minimum Cardinality Restriction, possible Qualified.createDataOneOf
(Collection<org.apache.jena.rdf.model.Literal> values) Creates an Enumeration of Literals.default OntDataRange.OneOf
createDataOneOf
(org.apache.jena.rdf.model.Literal... values) Creates an Enumeration of Literals.default OntDataProperty
createDataProperty
(String uri) Creates datatype property (owl-entity).createDataPropertySWRLAtom
(OntDataProperty property, OntSWRL.IArg first, OntSWRL.DArg second) Creates a Data Property Atom.createDataRangeSWRLAtom
(OntDataRange range, OntSWRL.DArg arg) Creates a Data Range Atom.createDataRestriction
(OntDataRange.Named other, Collection<OntFacetRestriction> values) Creates a Datatype Restriction.default OntDataRange.Restriction
createDataRestriction
(OntDataRange.Named other, OntFacetRestriction... values) Creates a Datatype Restriction.createDataSomeValuesFrom
(Collection<OntDataProperty> properties, OntDataRange dr) Creates an N-Ary Data Existential Quantification N-Ary Restriction.createDataSomeValuesFrom
(OntDataProperty property, OntDataRange dr) Creates an Existential Quantification Data Property Restriction.default OntDataRange.Named
createDatatype
(String uri) Creates named datatype (owl-entity), only for OWL2createDataUnionOf
(Collection<OntDataRange> values) Creates a Union of Data Ranges.default OntDataRange.UnionOf
createDataUnionOf
(OntDataRange... values) Creates a Union of Data Ranges.createDifferentIndividuals
(Collection<OntIndividual> individuals) Creates a Different Individuals Axiom Resource.default OntDisjoint.Individuals
createDifferentIndividuals
(OntIndividual... individuals) Creates a Different Individuals Axiom Resource.createDifferentIndividualsSWRLAtom
(OntSWRL.IArg first, OntSWRL.IArg second) Creates a Different Individuals Atom.createDisjointClasses
(Collection<OntClass> classes) Creates a Disjoint Classes Axiom Resource.default OntDisjoint.Classes
createDisjointClasses
(OntClass... classes) Creates a Disjoint Classes Axiom Resource.createDisjointDataProperties
(Collection<OntDataProperty> properties) Creates a Disjoint Data Properties Axiom Resource.default OntDisjoint.DataProperties
createDisjointDataProperties
(OntDataProperty... properties) Creates a Disjoint Data Properties Axiom Resource.createDisjointObjectProperties
(Collection<OntObjectProperty> properties) Creates a Disjoint Object Properties Axiom Resource.default OntDisjoint.ObjectProperties
createDisjointObjectProperties
(OntObjectProperty... properties) Creates a Disjoint Object Properties Axiom Resource.<F extends OntFacetRestriction>
FcreateFacetRestriction
(Class<F> type, org.apache.jena.rdf.model.Literal literal) Creates a facet restriction by the given type and literal value.createHasSelf
(OntObjectProperty property) Creates a Local Reflexivity Class Expression (Self-Restriction).default OntIndividual.Named
createIndividual
(String uri) Creates named individual (owl-entity), only for OWL2 ifowl:NamedIndividual
is enabled.default OntIndividual
createIndividual
(String uri, OntClass type) Creates individual (named or anonymous) of the specified type.createObjectAllValuesFrom
(OntObjectProperty property, OntClass ce) Creates a Universal Quantification Object Property Restriction.createObjectCardinality
(OntObjectProperty property, int cardinality, OntClass ce) Creates an Object Exact Cardinality Restriction, possible Qualified.Create a Complement of Class Expressions.createObjectHasValue
(OntObjectProperty property, OntIndividual individual) Creates an Individual Value Restriction.createObjectIntersectionOf
(Collection<OntClass> classes) Creates an Intersection of Class Expressions.default OntClass.IntersectionOf
createObjectIntersectionOf
(OntClass... classes) Creates an Intersection of Class Expressions.createObjectMaxCardinality
(OntObjectProperty property, int cardinality, OntClass ce) Creates an Object Maximum Cardinality Restriction, possible Qualified.createObjectMinCardinality
(OntObjectProperty property, int cardinality, OntClass ce) Creates an Object Minimum Cardinality Restriction, possible Qualified.createObjectOneOf
(Collection<OntIndividual> individuals) Creates an Enumeration of Individuals.default OntClass.OneOf
createObjectOneOf
(OntIndividual... individuals) Creates an Enumeration of Individuals.default OntObjectProperty.Named
Creates named object property (owl-entity).createObjectPropertySWRLAtom
(OntObjectProperty property, OntSWRL.IArg first, OntSWRL.IArg second) Creates an Object Property Atom.createObjectSomeValuesFrom
(OntObjectProperty property, OntClass ce) Creates an Existential Quantification Object Property Restriction.createObjectUnionOf
(Collection<OntClass> classes) Creates a Union of Class Expressions.default OntClass.UnionOf
createObjectUnionOf
(OntClass... classes) Creates a Union of Class Expressions.default OntClass.Named
createOntClass
(String uri) Creates named class (owl-entity)<E extends OntEntity>
EcreateOntEntity
(Class<E> type, String iri) Creates an owl-entity by thetype
andiri
.default OntProperty
createRDFProperty
(String uri) Creates namedrdf:Property
.createSameIndividualsSWRLAtom
(OntSWRL.IArg first, OntSWRL.IArg second) Creates a Same Individuals Atom.createSWRLImp
(Collection<OntSWRL.Atom<?>> head, Collection<OntSWRL.Atom<?>> body) Creates a SWRL Rule.createSWRLVariable
(String uri) Creates a SWRL Variable, that is a URI resource with a typeswrl:Variable
.default Stream<OntDataProperty>
Lists all data properties.default Stream<OntDataRange.Named>
Lists all datatypes (named data range expressions).default <E extends OntEntity>
EfetchOntEntity
(Class<E> type, String uri) Returns an entity of the given type and with the specified URI, creating it if needed.default OntAnnotationProperty
default OntAnnotationProperty
getAnnotationProperty
(org.apache.jena.rdf.model.Resource uri) org.apache.jena.graph.Graph
Returns the baseGraph
, i.e., the primary ontologicalGraph
that does not contain any subgraph hierarchy.org.apache.jena.rdf.model.Model
Returns thestandard jena model
that corresponds to thebase graph
.default OntDataProperty
getDataProperty
(String uri) default OntDataProperty
getDataProperty
(org.apache.jena.rdf.model.Resource uri) default OntDataRange.Named
getDatatype
(String uri) default OntDataRange.Named
getDatatype
(org.apache.jena.rdf.model.Literal literal) Retrieves adatatype
from the given literal.default OntDataRange.Named
getDatatype
(org.apache.jena.rdf.model.Resource uri) default OntID
getID()
Gets the Ontology ID object.default OntIndividual.Named
getIndividual
(String uri) default OntIndividual.Named
getIndividual
(org.apache.jena.rdf.model.Resource uri) default OntObjectProperty.Named
getObjectProperty
(String uri) default OntObjectProperty.Named
getObjectProperty
(org.apache.jena.rdf.model.Resource uri) default OntClass.Named
getOntClass
(String uri) default OntClass.Named
getOntClass
(org.apache.jena.rdf.model.Resource uri) <E extends OntEntity>
EgetOntEntity
(Class<E> type, String uri) Returns an ont-entity for the specified type and uri.default <E extends OntEntity>
EgetOntEntity
(Class<E> type, org.apache.jena.rdf.model.Resource uri) ReturnsOWL Entity
with the specified class-type anduri
.default OntAnnotationProperty
default OntDataProperty
default OntObjectProperty.Named
default OntAnnotationProperty
default OntAnnotationProperty
default OntClass.Named
default OntAnnotationProperty
default OntClass.Named
default OntDataProperty
default OntObjectProperty.Named
default OntAnnotationProperty
default OntAnnotationProperty
default OntAnnotationProperty
default OntAnnotationProperty
default OntDataRange.Named
default OntAnnotationProperty
boolean
Answerstrue
if the model has a graph with the given uri both inowl:imports
and graph-hierarchy.boolean
Answerstrue
if the given model is present in theowl:imports
of this model.Answers aStream
over the classes in this ontology model that represent the uppermost nodes of the class hierarchy.id()
Finds an Ontology ID object.imports()
Lists all sub-models that belong to the top-level hierarchy and haveowl:import
reference inside the base graph.Lists all class-asserted individuals.default Stream<OntStatement>
localStatements
(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.RDFNode o) Lists all statements from thebase graph
for the specified subject, predicate and object.lock()
default Stream<OntIndividual.Named>
Lists all named individuals, i.e.default Stream<OntObjectProperty.Named>
Lists all named object property expressions (object properties in short).Lists all entities declared in the model.ontEntities
(Class<E> type) ontObjects
(Class<? extends O> type) Lists all ont-objects of the specified type.default Stream<OntProperty>
Lists all OntProperties.read
(InputStream in, String base) read
(InputStream in, String base, String lang) remove
(org.apache.jena.rdf.model.Model m) remove
(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.RDFNode o) remove
(org.apache.jena.rdf.model.Statement s) remove
(org.apache.jena.rdf.model.Statement[] statements) remove
(org.apache.jena.rdf.model.StmtIterator it) removeAll
(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.RDFNode o) removeImport
(String uri) Removes the import (bothowl:import
declaration and the corresponding graph) by the given uri if it is found.Removes a sub-model fromowl:import
and from the graph hierarchy.removeNsPrefix
(String prefix) removeOntObject
(OntObject obj) Removes the givenOntology Object
from the graph-model including itscontent
and annotations.removeOntStatement
(OntStatement statement) Removes the statement from the graph-model including its annotations with sub-annotations hierarchy.Creates a new@uri rdf:type owl:Ontology
statement for the specifieduri
and wraps it as Ontology ID Resource.setNsPrefix
(String prefix, String uri) setNsPrefixes
(Map<String, String> map) setNsPrefixes
(org.apache.jena.shared.PrefixMapping other) Lists all ont-statements.statements
(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.RDFNode o) Lists all statements for the specified subject, predicate and object (SPO).withDefaultMappings
(org.apache.jena.shared.PrefixMapping map) write
(OutputStream out) Writes a serialized representation of a model in a specified language.write
(OutputStream out, String lang) Writes a serialized representation of a model in a specified language.write
(OutputStream out, String lang, String base) Writes a serialized representation of a model in a specified language.Writes a serialized representation of a model in a specified language.Writes a serialized representation of a model in a specified language.Writes a serialized representation of a model in a specified language.writeAll
(OutputStream out, String lang) Writes a serialized representation of all the model's contents, including inferred statements and statements imported from other documents.writeAll
(OutputStream out, String lang, String base) Writes a serialized representation of all the model's contents, including inferred statements and statements imported from other documents.Writes a serialized representation of all the model's contents, including inferred statements and statements imported from other documents.Writes a serialized representation of all the model's contents, including inferred statements and statements imported from other documents.Methods inherited from interface org.apache.jena.shared.Lock
enterCriticalSection, leaveCriticalSection
Methods inherited from interface org.apache.jena.rdf.model.Model
abort, begin, calculateInTxn, clearNsPrefixMap, close, commit, contains, contains, contains, containsAll, containsAll, containsAny, containsAny, containsResource, createList, createList, createList, createLiteral, createProperty, createResource, createResource, createResource, createResource, createStatement, 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, register, removeNsPrefix, setNsPrefix, setNsPrefixes, setNsPrefixes, size, supportsSetOperations, supportsTransactions, union, unregister, withDefaultMappings
Methods inherited from interface org.apache.jena.rdf.model.ModelCon
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, listSubjectsWithProperty, listSubjectsWithProperty
Methods inherited from interface org.apache.jena.rdf.model.ModelGraphInterface
asRDFNode, getGraph, wrapAsResource
Methods inherited from interface org.apache.jena.shared.PrefixMapping
expandPrefix, getNsPrefixMap, getNsPrefixURI, getNsURIPrefix, hasNoMappings, numPrefixes, qnameFor, samePrefixMappingAs, shortForm
-
Method Details
-
getBaseGraph
org.apache.jena.graph.Graph getBaseGraph()Returns the baseGraph
, i.e., the primary ontologicalGraph
that does not contain any subgraph hierarchy. Only the base graph can be edited from this interface view. To get the whole union graph use the methodModelGraphInterface.getGraph()
.- Returns:
Graph
- See Also:
-
ModelGraphInterface.getGraph()
-
id
Finds an Ontology ID object.Since OWL2 graph requires only one
@uri rdf:type owl:Ontology
triple, the method returnsOptional#empty
in other cases. No changes in theGraph
is made. The method works only with thebase graph
.- Returns:
- an
Optional
that contains theOntID
- See Also:
-
setID
Creates a new@uri rdf:type owl:Ontology
statement for the specifieduri
and wraps it as Ontology ID Resource. Removes all extra ontology objects if they are present and moves their content to the new one, to have a single Ontology header as it is required by OWL2 specification.- Parameters:
uri
- String, can benull
to make this ontology to be anonymous- Returns:
- the new
OntID
instance - Throws:
OntJenaException
- if ontology can't be added (e.g. due to collision with imports)- See Also:
-
addImport
Adds a sub-model both to theowl:import
section and to the graph hierarchy.- Parameters:
m
-ont jena model
to add, notnull
- Returns:
- this model to allow cascading calls
- Throws:
OntJenaException
- if specified, ontology is anonymous or already present in the imports (both as graph and in owl-declaration)- See Also:
-
removeImport
Removes a sub-model fromowl:import
and from the graph hierarchy. Does nothing if the specified model does not belong to this ontology. Matching is performed by graph, not uri (seehasImport(OntModel)
description).- Parameters:
m
-ont jena model
to remove, notnull
- Returns:
- this model to allow cascading calls
- See Also:
-
removeImport
Removes the import (bothowl:import
declaration and the corresponding graph) by the given uri if it is found.- Parameters:
uri
- String, an iri of ontology to find, notnull
- Returns:
- this model to allow cascading calls
- See Also:
-
imports
Lists all sub-models that belong to the top-level hierarchy and haveowl:import
reference inside the base graph. Caution: since recursive hierarchies are not prohibited, the rectilinear usage of this method may cause a StackOverflow Error.- Returns:
Stream
ofOntModel
s- See Also:
-
hasImport
Answerstrue
if the given model is present in theowl:imports
of this model. This means that at the top-level of the import hierarchy there is a base graph of the givenother
model. Please note: the model may contain the same uri as that of the specified model, but a different (base) graph, i.e. if the methodhasImport(String)
returnstrue
, it does not mean this method also returnstrue
.- Parameters:
other
-OntModel
to test, notnull
- Returns:
true
if the model is in imports
-
hasImport
Answerstrue
if the model has a graph with the given uri both inowl:imports
and graph-hierarchy.- Parameters:
uri
- String, notnull
- Returns:
- boolean
- See Also:
-
ontObjects
Lists all ont-objects of the specified type. Note: this method may return non-distinct results, it is implementation dependent. -
ontEntities
Lists all entities declared in the model. Built-ins are not included. The retrieved entities can belong to the underlying graphs also. Note: this method returns non-distinct stream. The duplicate elements (byequals
andhasCode
, not by real class-type) means that there is so-called punning.- Returns:
Stream
ofOntEntity
- See Also:
-
individuals
Stream<OntIndividual> individuals()Lists all class-asserted individuals.A class assertion axiom is a statement
a rdf:type C
, wherea
is a retrieving individual (named or anonymous) andC
is any class expression. Notice, that the methodontObjects(Class)
called with the parameterOntIndividual.class
(i.e.model.ontObject(OntIndividual.class)
) must return all individuals from a model, even those which have no explicit declarations (e.g. any part ofowl:sameAs
is an individual), while this method returns only class-asserted individuals. Also notice: the methodnamedIndividuals()
must return only explicitly declared named individuals, while this method does not require the declarationowl:NamedIndividual
to be present for an individual: according to the specification, it is optional; for more details see 5.8.1 Typing Constraints of OWL 2 DL. Also note: in case of valid distinctRDF graph
the returnedStream
is also distinct, which means an individual that has more than one class assertions, must appear in the stream only once.- Returns:
Stream
ofOntIndividual
s- See Also:
-
getOntEntity
Returns an ont-entity for the specified type and uri. This method can also be used to wrap builtin entities, which, in fact, do not belong to the RDF graph, but can be considered as belonged to the OWL model. An IRI for such a built-in entity must be in theBuiltins Vocabulary
, otherwise the method returnsnull
. -
statements
Stream<OntStatement> statements()Lists all ont-statements.- Returns:
Stream
ofOntStatement
- See Also:
-
Model.listStatements()
-
statements
Stream<OntStatement> statements(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.RDFNode o) Lists all statements for the specified subject, predicate and object (SPO).- Parameters:
s
-Resource
, the subjectp
-Property
, the predicateo
-RDFNode
, the object- Returns:
Stream
ofOntStatement
- See Also:
-
Model.listStatements(Resource, Property, RDFNode)
-
localStatements
Stream<OntStatement> localStatements(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.RDFNode o) Lists all statements from thebase graph
for the specified subject, predicate and object. Effectively equivalent to themodel.statements(s, p, o).filter(OntStatement::isLocal)
expression.- Parameters:
s
-Resource
, the subjectp
-Property
, the predicateo
-RDFNode
, the object- Returns:
Stream
ofOntStatement
- See Also:
-
asStatement
Answers anOntology Statement
in this model who's SPO is that of thetriple
.- Specified by:
asStatement
in interfaceorg.apache.jena.rdf.model.ModelGraphInterface
- Parameters:
triple
-Triple
, notnull
- Returns:
OntStatement
-
removeOntObject
Removes the givenOntology Object
from the graph-model including itscontent
and annotations. This operation does not guarantee the removal of all references to objects: it takes into account only statements where the given object in a subject position. For example, in case of deleting an OWL class that is on the right side in a statement with the predicaterdfs:subClassOf
, that statement remains unchanged in the graph, but becomes meaningless: its right side will no longer be a class, but just uri. But if a class is on the left side of the statement with therdfs:subClassOf
predicate, that statement is being removed from the graph along with its annotations, because it belongs to the class content.- Parameters:
obj
-OntObject
- Returns:
- this model
- See Also:
-
removeOntStatement
Removes the statement from the graph-model including its annotations with sub-annotations hierarchy.- Parameters:
statement
-OntStatement
- Returns:
- this model
- See Also:
-
Model.remove(Statement)
-
createOntEntity
Creates an owl-entity by thetype
andiri
.- Type Parameters:
E
- type of ont-entity- Parameters:
type
-Class
, the type ofOntEntity
, notnull
iri
- String, notnull
- Returns:
OntEntity
- Throws:
OntJenaException.Creation
- in case something is wrong (e.g. configuration does not support creation of the specified type)- See Also:
-
createFacetRestriction
<F extends OntFacetRestriction> F createFacetRestriction(Class<F> type, org.apache.jena.rdf.model.Literal literal) Creates a facet restriction by the given type and literal value. Each call to this method creates a fresh b-node within the graph.- Type Parameters:
F
- type of ont-facet-restriction- Parameters:
type
-Class
, the type ofOntFacetRestriction
, notnull
literal
-Literal
, notnull
- Returns:
OntFacetRestriction
- See Also:
-
OntDataRange.Restriction
CreateRanges.createDataRestriction(OntDataRange.Named, Collection)
-
getBaseModel
org.apache.jena.rdf.model.Model getBaseModel()Returns thestandard jena model
that corresponds to thebase graph
. Note: there is theJena Builtin Personality
within the returned model.- Returns:
Model
- See Also:
-
asInferenceModel
default org.apache.jena.rdf.model.InfModel asInferenceModel()Returns a view of this model that supports inference, if possible.- Returns:
InfModel
, notnull
- Throws:
OntJenaException.Unsupported
- if implementation does not support inference, or there is no reasoner attached to the model
-
getID
Gets the Ontology ID object.Since OWL2 graph can only contain the one
@uri rdf:type owl:Ontology
triple inside, this method creates such a statement if it absent; in case there are more than oneResource
with the type equaled toowl:Ontology
, it chooses the most bulky one (i.e. those that contains the largest number of associated statements) and all the others leave intact.- Returns:
OntID
an existing or freshResource
, that is subject in the_:x rdf:type owl:Ontology
statement
-
createOntClass
Creates named class (owl-entity)- Parameters:
uri
- IRI of class- Returns:
- named class
-
createDatatype
Creates named datatype (owl-entity), only for OWL2- Parameters:
uri
- IRI of datarange- Returns:
- named datarange
-
createIndividual
Creates named individual (owl-entity), only for OWL2 ifowl:NamedIndividual
is enabled.- Parameters:
uri
- IRI of individual- Returns:
- named individual
-
createRDFProperty
Creates namedrdf:Property
.- Parameters:
uri
-<uri> a rdf:Property
- Returns:
OntProperty
-
createAnnotationProperty
Creates annotation property (owl-entity).- Parameters:
uri
- IRI of annotation property- Returns:
- annotation property
-
createDataProperty
Creates datatype property (owl-entity).- Parameters:
uri
- IRI of datatype property- Returns:
- datatype property
-
createObjectProperty
Creates named object property (owl-entity).- Parameters:
uri
- IRI of object property- Returns:
- named object property
-
createIndividual
Creates individual (named or anonymous) of the specified type.- Parameters:
uri
- String, ornull
for anonymous individualtype
-OntClass
- Returns:
OntIndividual
-
getOntClass
-
getDatatype
-
getIndividual
-
getAnnotationProperty
-
getDataProperty
-
getObjectProperty
-
getOntClass
-
getDatatype
-
getIndividual
-
getAnnotationProperty
-
getDataProperty
-
getObjectProperty
-
localStatements
-
ontEntities
-
getDatatype
Retrieves adatatype
from the given literal.- Parameters:
literal
-Literal
, notnull
- Returns:
OntDataRange.Named
-
fetchOntEntity
Returns an entity of the given type and with the specified URI, creating it if needed.- Type Parameters:
E
- any subtype ofOntEntity
- Parameters:
type
- a class-type of entityuri
- String uri, notnull
- Returns:
E
-
classes
Lists all named class expressions (OWL classes).- Returns:
Stream
ofOntology Class
es
-
hierarchyRoots
Answers aStream
over the classes in this ontology model that represent the uppermost nodes of the class hierarchy. Built-ins are not included.- Returns:
- a
Stream
of the rootclasses
in the local class hierarchy
-
properties
Lists all OntProperties. The result includes not only OWL properties (Named and Inverse ObjectProperties, DatatypeProperties, AnnotationProperties), but also RDF-properties (<uri> rdf:type rdf:Property
).For getting only OWL Properties, use
Stream.of(m.objectProperties(), m.dataProperties(), m.annotationProperties()).flatMap(it -> it)
. If you need all named properties, usethis.ontEntities(OntNamedProperty.class)
This is analogous of
OntModel.listAllOntProperties()
. Note that this method does not care about punnings: it will return property even if it has bothowl:ObjectProperty
andowl:DatatypeProperty
declarations and such punning is prohibited in the model settings.- Returns:
- distinct
Stream
ofOntProperty
s
-
annotationProperties
Lists all annotation properties.- Returns:
Stream
ofAnnotation Property
s
-
dataProperties
Lists all data properties.- Returns:
Stream
ofData Property
s
-
objectProperties
Lists all named object property expressions (object properties in short).- Returns:
Stream
ofNamed Object Property
s
-
datatypes
Lists all datatypes (named data range expressions).- Returns:
Stream
ofOntology Datatype
s
-
namedIndividuals
Lists all named individuals, i.e. all those individuals which have explicitlyowl:NamedIndividual
declaration.- Returns:
Stream
ofNamed Individual
s- See Also:
-
getOntEntity
ReturnsOWL Entity
with the specified class-type anduri
.- Type Parameters:
E
- anyOntEntity
subtype, notnull
- Parameters:
type
-Class
, notnull
uri
-Resource
, must be URI, notnull
- Returns:
- a
E
instance
-
getRDFSComment
-
getRDFSLabel
-
getRDFSSeeAlso
-
getRDFSIsDefinedBy
-
getOWLDeprecated
-
getOWLVersionInfo
-
getOWLPriorVersion
-
getOWLBackwardCompatibleWith
-
getOWLIncompatibleWith
-
getOWLThing
-
getOWLNothing
-
getRDFSLiteral
-
getOWLTopObjectProperty
-
getOWLBottomObjectProperty
-
getOWLTopDataProperty
-
getOWLBottomDataProperty
-
add
- Specified by:
add
in interfaceorg.apache.jena.rdf.model.Model
-
add
OntModel add(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.RDFNode o) - Specified by:
add
in interfaceorg.apache.jena.rdf.model.ModelCon
-
add
- Specified by:
add
in interfaceorg.apache.jena.rdf.model.Model
-
add
- Specified by:
add
in interfaceorg.apache.jena.rdf.model.Model
-
add
- Specified by:
add
in interfaceorg.apache.jena.rdf.model.Model
-
add
- Specified by:
add
in interfaceorg.apache.jena.rdf.model.Model
-
remove
- Specified by:
remove
in interfaceorg.apache.jena.rdf.model.Model
-
remove
OntModel remove(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.RDFNode o) - Specified by:
remove
in interfaceorg.apache.jena.rdf.model.ModelCon
-
remove
- Specified by:
remove
in interfaceorg.apache.jena.rdf.model.ModelCon
-
remove
- Specified by:
remove
in interfaceorg.apache.jena.rdf.model.ModelCon
-
removeAll
OntModel removeAll(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.RDFNode o) - Specified by:
removeAll
in interfaceorg.apache.jena.rdf.model.Model
-
remove
- Specified by:
remove
in interfaceorg.apache.jena.rdf.model.Model
-
remove
- Specified by:
remove
in interfaceorg.apache.jena.rdf.model.Model
-
removeAll
OntModel removeAll()- Specified by:
removeAll
in interfaceorg.apache.jena.rdf.model.Model
-
addLiteral
OntModel addLiteral(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, boolean v) - Specified by:
addLiteral
in interfaceorg.apache.jena.rdf.model.ModelCon
-
addLiteral
OntModel addLiteral(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, long v) - Specified by:
addLiteral
in interfaceorg.apache.jena.rdf.model.ModelCon
-
addLiteral
OntModel addLiteral(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, int v) - Specified by:
addLiteral
in interfaceorg.apache.jena.rdf.model.ModelCon
-
addLiteral
OntModel addLiteral(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, char v) - Specified by:
addLiteral
in interfaceorg.apache.jena.rdf.model.ModelCon
-
addLiteral
OntModel addLiteral(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, float v) - Specified by:
addLiteral
in interfaceorg.apache.jena.rdf.model.ModelCon
-
addLiteral
OntModel addLiteral(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, double v) - Specified by:
addLiteral
in interfaceorg.apache.jena.rdf.model.ModelCon
-
addLiteral
OntModel addLiteral(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.Literal o) - Specified by:
addLiteral
in interfaceorg.apache.jena.rdf.model.ModelCon
-
add
OntModel add(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, String lex) - Specified by:
add
in interfaceorg.apache.jena.rdf.model.ModelCon
-
add
OntModel add(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, String lex, org.apache.jena.datatypes.RDFDatatype datatype) - Specified by:
add
in interfaceorg.apache.jena.rdf.model.ModelCon
-
add
OntModel add(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, String lex, String lang) - Specified by:
add
in interfaceorg.apache.jena.rdf.model.ModelCon
-
setNsPrefix
- Specified by:
setNsPrefix
in interfaceorg.apache.jena.shared.PrefixMapping
-
removeNsPrefix
- Specified by:
removeNsPrefix
in interfaceorg.apache.jena.shared.PrefixMapping
-
clearNsPrefixMap
OntModel clearNsPrefixMap()- Specified by:
clearNsPrefixMap
in interfaceorg.apache.jena.shared.PrefixMapping
-
setNsPrefixes
- Specified by:
setNsPrefixes
in interfaceorg.apache.jena.shared.PrefixMapping
-
lock
OntModel lock()- Specified by:
lock
in interfaceorg.apache.jena.shared.PrefixMapping
-
read
- Specified by:
read
in interfaceorg.apache.jena.rdf.model.Model
-
read
- Specified by:
read
in interfaceorg.apache.jena.rdf.model.Model
-
read
- Specified by:
read
in interfaceorg.apache.jena.rdf.model.Model
-
read
- Specified by:
read
in interfaceorg.apache.jena.rdf.model.Model
-
read
- Specified by:
read
in interfaceorg.apache.jena.rdf.model.Model
-
read
- Specified by:
read
in interfaceorg.apache.jena.rdf.model.Model
-
read
- Specified by:
read
in interfaceorg.apache.jena.rdf.model.Model
-
write
Writes a serialized representation of a model in a specified language. Note(1): this method is adapted for the ontology model to write out only the base model (which contains the asserted data). To write all triples, including imported data and inferred triples, usewriteAll
. Note(2): it is often better to use anOutputStream
rather than aWriter
, since this will avoid character encoding errors.The language in which to write the model is specified by the
lang
argument. Some of the supported formats are "RDF/XML", "RDF/XML-ABBREV", "N-TRIPLE", "TURTLE". SeeLang
for all supported formats. The default value, represented bynull
, is "RDF/XML".- Specified by:
write
in interfaceorg.apache.jena.rdf.model.Model
- Parameters:
writer
- the output writer- Returns:
- this model
-
write
Writes a serialized representation of a model in a specified language. Note(1): this method is adapted for the ontology model to write out only the base model (which contains the asserted data). To write all triples, including imported data and inferred triples, usewriteAll
. Note(2): it is often better to use anOutputStream
rather than aWriter
, since this will avoid character encoding errors.The language in which to write the model is specified by the
lang
argument. Some of the supported formats are "RDF/XML", "RDF/XML-ABBREV", "N-TRIPLE", "TURTLE". SeeLang
for all supported formats. The default value, represented bynull
, is "RDF/XML".- Specified by:
write
in interfaceorg.apache.jena.rdf.model.Model
- Parameters:
writer
- the output writerlang
- the language in which the RDF should be written- Returns:
- this model
-
write
Writes a serialized representation of a model in a specified language. Note(1): this method is adapted for the ontology model to write out only the base model (which contains the asserted data). To write all triples, including imported data and inferred triples, usewriteAll
. Note(2): it is often better to use anOutputStream
rather than aWriter
, since this will avoid character encoding errors.The language in which to write the model is specified by the
lang
argument. Some of the supported formats are "RDF/XML", "RDF/XML-ABBREV", "N-TRIPLE", "TURTLE". SeeLang
for all supported formats. The default value, represented bynull
, is "RDF/XML".- Specified by:
write
in interfaceorg.apache.jena.rdf.model.Model
- Parameters:
writer
- the output writerlang
- the language in which the RDF should be writtenbase
- the base URI for relative URI calculations;null
means use only absolute URI's.- Returns:
- this model
-
write
Writes a serialized representation of a model in a specified language. Note: this method is adapted for the ontology model to write out only the base model (which contains the asserted data). To write all triples, including imported data and inferred triples, usewriteAll
.The language in which to write the model is specified by the
lang
argument. Some of the supported formats are "RDF/XML", "RDF/XML-ABBREV", "N-TRIPLE", "TURTLE". SeeLang
for all supported formats. The default value, represented bynull
, is "RDF/XML".- Specified by:
write
in interfaceorg.apache.jena.rdf.model.Model
- Parameters:
out
- tre output stream to which the RDF is written- Returns:
- this model
-
write
Writes a serialized representation of a model in a specified language. Note: this method is adapted for the ontology model to write out only the base model (which contains the asserted data). To write all triples, including imported data and inferred triples, usewriteAll
.The language in which to write the model is specified by the
lang
argument. Some of the supported formats are "RDF/XML", "RDF/XML-ABBREV", "N-TRIPLE", "TURTLE". SeeLang
for all supported formats. The default value, represented bynull
, is "RDF/XML".- Specified by:
write
in interfaceorg.apache.jena.rdf.model.Model
- Parameters:
out
- tre output stream to which the RDF is writtenlang
- the language in which the RDF should be written- Returns:
- this model
-
write
Writes a serialized representation of a model in a specified language. Note: this method is adapted for the ontology model to write out only the base model (which contains the asserted data). To write all triples, including imported data and inferred triples, usewriteAll
.The language in which to write the model is specified by the
lang
argument. Some of the supported formats are "RDF/XML", "RDF/XML-ABBREV", "N-TRIPLE", "TURTLE". SeeLang
for all supported formats. The default value, represented bynull
, is "RDF/XML".- Specified by:
write
in interfaceorg.apache.jena.rdf.model.Model
- Parameters:
out
- tre output stream to which the RDF is writtenlang
- the language in which the RDF should be writtenbase
- the base URI for relative URI calculations;null
means use only absolute URI's.- Returns:
- this model
-
writeAll
Writes a serialized representation of all the model's contents, including inferred statements and statements imported from other documents. To write only the data asserted in the base model, usewrite
. Note: it is often better to use anOutputStream
rather than aWriter
, since this will avoid character encoding errors.The language in which to write the model is specified by the
lang
argument. Some of the supported formats are "RDF/XML", "RDF/XML-ABBREV", "N-TRIPLE", "TURTLE". SeeLang
for all supported formats. 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;null
means use only absolute URI's.- Returns:
- this model
-
writeAll
Writes a serialized representation of all the model's contents, including inferred statements and statements imported from other documents. To write only the data asserted in the base model, usewrite
. Note: it is often better to use anOutputStream
rather than aWriter
, since this will avoid character encoding errors.The language in which to write the model is specified by the
lang
argument. Some of the supported formats are "RDF/XML", "RDF/XML-ABBREV", "N-TRIPLE", "TURTLE". SeeLang
for all supported formats. 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
Writes a serialized representation of all the model's contents, including inferred statements and statements imported from other documents. To write only the data asserted in the base model, usewrite
.The language in which to write the model is specified by the
lang
argument. Some of the supported formats are "RDF/XML", "RDF/XML-ABBREV", "N-TRIPLE", "TURTLE". SeeLang
for all supported formats. The default value, represented bynull
, is "RDF/XML".- Parameters:
out
- tre output stream to which the RDF is writtenlang
- the language in which the RDF should be writtenbase
- the base URI for relative URI calculations;null
means use only absolute URI's.- Returns:
- this model
-
writeAll
Writes a serialized representation of all the model's contents, including inferred statements and statements imported from other documents. To write only the data asserted in the base model, usewrite
.The language in which to write the model is specified by the
lang
argument. Some of the supported formats are "RDF/XML", "RDF/XML-ABBREV", "N-TRIPLE", "TURTLE". SeeLang
for all supported formats. The default value, represented bynull
, is "RDF/XML".- Parameters:
out
- tre output stream to which the RDF is writtenlang
- the language in which the RDF should be written- Returns:
- this model
-
createObjectSomeValuesFrom
Creates an Existential Quantification Object Property Restriction. The RDF structure:_:x rdf:type owl:Restriction . _:x owl:onProperty P . _:x owl:someValuesFrom C .
- Parameters:
property
-object property expression
, notnull
ce
-class expression
, notnull
- Returns:
OntClass.ObjectSomeValuesFrom
- See Also:
-
createDataSomeValuesFrom
Creates an Existential Quantification Data Property Restriction. The RDF structure:_:x rdf:type owl:Restriction . _:x owl:onProperty R . _:x owl:someValuesFrom D .
- Parameters:
property
-data property
, notnull
dr
-data range
, notnull
- Returns:
OntClass.DataSomeValuesFrom
- See Also:
-
createObjectAllValuesFrom
Creates a Universal Quantification Object Property Restriction. The RDF structure:_:x rdf:type owl:Restriction . _:x owl:onProperty P . _:x owl:allValuesFrom C .
- Parameters:
property
-object property expression
, notnull
ce
-class expression
, notnull
- Returns:
OntClass.ObjectAllValuesFrom
- See Also:
-
createDataAllValuesFrom
Creates a Universal Quantification Data Property Restriction. The RDF structure:_:x rdf:type owl:Restriction . _:x owl:onProperty R . _:x owl:allValuesFrom D .
- Parameters:
property
-data property
, notnull
dr
-data range
, notnull
- Returns:
OntClass.DataAllValuesFrom
- See Also:
-
createObjectHasValue
Creates an Individual Value Restriction. The RDF structure:_:x rdf:type owl:Restriction . _:x owl:onProperty P . _:x owl:hasValue a .
- Parameters:
property
-object property expression
, notnull
individual
-OntIndividual
, notnull
- Returns:
OntClass.ObjectHasValue
- See Also:
-
createDataHasValue
OntClass.DataHasValue createDataHasValue(OntDataProperty property, org.apache.jena.rdf.model.Literal literal) Creates a Literal Value Restriction. The RDF structure:_:x rdf:type owl:Restriction . _:x owl:onProperty R . _:x owl:hasValue v .
- Parameters:
property
-data property
, notnull
literal
-Literal
, notnull
- Returns:
OntClass.DataHasValue
- See Also:
-
createObjectMinCardinality
OntClass.ObjectMinCardinality createObjectMinCardinality(OntObjectProperty property, int cardinality, OntClass ce) Creates an Object Minimum Cardinality Restriction, possible Qualified. Ifce
isnull
, it is taken to beowl:Thing
. In that case the return restriction is unqualified. The RDF structure:
or_:x rdf:type owl:Restriction . _:x owl:onProperty P . _:x owl:minCardinality n .
_:x rdf:type owl:Restriction . _:x owl:onProperty P . _:x owl:minQualifiedCardinality n . _:x owl:onClass C .
- Parameters:
property
-object property expression
, notnull
cardinality
-int
, non-negative numberce
-class expression
ornull
- Returns:
OntClass.ObjectMinCardinality
- See Also:
-
createDataMinCardinality
OntClass.DataMinCardinality createDataMinCardinality(OntDataProperty property, int cardinality, OntDataRange dr) Creates a Data Minimum Cardinality Restriction, possible Qualified. Ifdr
isnull
, it is taken to berdfs:Literal
. The RDF structure:
or_:x rdf:type owl:Restriction . _:x owl:onProperty R . _:x owl:minCardinality n .
_:x rdf:type owl:Restriction . _:x owl:onProperty R . _:x owl:minQualifiedCardinality n . _:x owl:onDataRange D .
- Parameters:
property
-data property
, notnull
cardinality
-int
, non-negative numberdr
-data range
ornull
- Returns:
OntClass.DataMinCardinality
- See Also:
-
createObjectMaxCardinality
OntClass.ObjectMaxCardinality createObjectMaxCardinality(OntObjectProperty property, int cardinality, OntClass ce) Creates an Object Maximum Cardinality Restriction, possible Qualified. Ifce
isnull
, it is taken to beowl:Thing
. In that case the return restriction is unqualified. The RDF structure:
or_:x rdf:type owl:Restriction . _:x owl:onProperty P . _:x owl:maxCardinality n .
_:x rdf:type owl:Restriction . _:x owl:onProperty P . _:x owl:maxQualifiedCardinality n . _:x owl:onClass C .
- Parameters:
property
-object property expression
, notnull
cardinality
-int
, non-negative numberce
-class expression
ornull
- Returns:
OntClass.ObjectMaxCardinality
- See Also:
-
createDataMaxCardinality
OntClass.DataMaxCardinality createDataMaxCardinality(OntDataProperty property, int cardinality, OntDataRange dr) Creates a Data Maximum Cardinality Restriction, possible Qualified. Ifdr
isnull
, it is taken to berdfs:Literal
. The RDF structure:
or_:x rdf:type owl:Restriction . _:x owl:onProperty R . _:x owl:maxCardinality n .
_:x rdf:type owl:Restriction . _:x owl:onProperty R . _:x owl:maxQualifiedCardinality n . _:x owl:onDataRange D .
- Parameters:
property
-data property
, notnull
cardinality
-int
, non-negative numberdr
-data range
ornull
- Returns:
OntClass.DataMaxCardinality
- See Also:
-
createObjectCardinality
OntClass.ObjectCardinality createObjectCardinality(OntObjectProperty property, int cardinality, OntClass ce) Creates an Object Exact Cardinality Restriction, possible Qualified. Ifce
isnull
, it is taken to beowl:Thing
. In that case the return restriction is unqualified. The RDF structure:
or_:x rdf:type owl:Restriction . _:x owl:onProperty P . _:x owl:cardinality n .
_:x rdf:type owl:Restriction . _:x owl:onProperty P . _:x owl:qualifiedCardinality n . _:x owl:onClass C .
- Parameters:
property
-object property expression
, notnull
cardinality
-int
, non-negative numberce
-class expression
ornull
- Returns:
OntClass.ObjectCardinality
- See Also:
-
createDataCardinality
OntClass.DataCardinality createDataCardinality(OntDataProperty property, int cardinality, OntDataRange dr) Creates a Data Exact Cardinality Restriction, possible Qualified. Ifdr
isnull
, it is taken to berdfs:Literal
. The RDF structure:
or_:x rdf:type owl:Restriction . _:x owl:onProperty R . _:x owl:cardinality n .
_:x rdf:type owl:Restriction . _:x owl:onProperty R . _:x owl:qualifiedCardinality n . _:x owl:onDataRange D .
- Parameters:
property
-data property
, notnull
cardinality
-int
, non-negative numberdr
-data range
ornull
- Returns:
OntClass.DataCardinality
- See Also:
-
createHasSelf
Creates a Local Reflexivity Class Expression (Self-Restriction). The RDF structure:_:x rdf:type owl:Restriction . _:x owl:onProperty P . _:x owl:hasSelf "true"^^xsd:boolean .
- Parameters:
property
-object property expression
, notnull
- Returns:
OntClass.HasSelf
- See Also:
-
createObjectUnionOf
Creates a Union of Class Expressions. The RDF structure:_:x rdf:type owl:Class . _:x owl:unionOf ( C1 ... Cn ) .
- Parameters:
classes
-Collection
ofclass expression
s withoutnull
s- Returns:
OntClass.UnionOf
- See Also:
-
createObjectIntersectionOf
Creates an Intersection of Class Expressions. The RDF structure:_:x rdf:type owl:Class . _:x owl:intersectionOf ( C1 ... Cn ) .
- Parameters:
classes
-Collection
ofclass expression
s withoutnull
s- Returns:
OntClass.IntersectionOf
- See Also:
-
createObjectOneOf
Creates an Enumeration of Individuals. The RDF structure:_:x rdf:type owl:Class . _:x owl:oneOf ( a1 ... an ).
- Parameters:
individuals
-Collection
ofindividual
s withoutnull
s- Returns:
OntClass.OneOf
- See Also:
-
createObjectComplementOf
Create a Complement of Class Expressions. The RDF structure:_:x rdf:type owl:Class . _:x owl:complementOf C .
- Parameters:
ce
-class expression
ornull
- Returns:
OntClass.ComplementOf
- See Also:
-
createDataAllValuesFrom
OntClass.NaryDataAllValuesFrom createDataAllValuesFrom(Collection<OntDataProperty> properties, OntDataRange dr) Creates an N-Ary Data Universal Quantification N-Ary Restriction. Note: currently a Unary Restriction is preferable since in OWL2 data-range arity is always1
. The RDF structure:_:x rdf:type owl:Restriction . _:x owl:onProperties ( R1 ... Rn ) . _:x owl:allValuesFrom Dn .
- Parameters:
properties
-Collection
ofdata range
s withoutnull
sdr
-data range
, notnull
- Returns:
OntClass.NaryDataAllValuesFrom
- See Also:
-
createDataSomeValuesFrom
OntClass.NaryDataSomeValuesFrom createDataSomeValuesFrom(Collection<OntDataProperty> properties, OntDataRange dr) Creates an N-Ary Data Existential Quantification N-Ary Restriction. Note: currently a Unary Restriction is preferable since in OWL2 data-range arity is always1
. The RDF structure:_:x rdf:type owl:Restriction . _:x owl:onProperties ( R1 ... Rn ) . _:x owl:someValuesFrom Dn .
- Parameters:
properties
-Collection
ofdata range
s withoutnull
sdr
-data range
, notnull
- Returns:
OntClass.NaryDataAllValuesFrom
- See Also:
-
createObjectIntersectionOf
Creates an Intersection of Class Expressions.- Parameters:
classes
- Array ofclass expression
s withoutnull
s- Returns:
OntClass.IntersectionOf
- See Also:
-
createObjectUnionOf
Creates a Union of Class Expressions.- Parameters:
classes
- Array ofclass expression
s withoutnull
s- Returns:
OntClass.UnionOf
- See Also:
-
createObjectOneOf
Creates an Enumeration of Individuals.- Parameters:
individuals
- Array ofindividual
s withoutnull
s- Returns:
OntClass.OneOf
- See Also:
-
createDataOneOf
Creates an Enumeration of Literals. RDF (turtle) syntax:_:x rdf:type rdfs:Datatype . _:x owl:oneOf ( v1 ... vn ) .
- Parameters:
values
-Collection
ofliteral
s, withoutnull
s- Returns:
OntDataRange.OneOf
- See Also:
-
createDataRestriction
OntDataRange.Restriction createDataRestriction(OntDataRange.Named other, Collection<OntFacetRestriction> values) Creates a Datatype Restriction. RDF (turtle) syntax:_:x rdf:type rdfs:Datatype . _:x owl:onDatatype DN . _:x owl:withRestrictions ( _:x1 ... _:xn ) . _:xj fj vj .
- Parameters:
other
-OntDataRange.Named
, notnull
values
-Collection
offacet restriction
s, withoutnull
s- Returns:
OntDataRange.Restriction
- See Also:
-
createDataComplementOf
Creates a Complement of Data Ranges. RDF (turtle) syntax:_:x rdf:type rdfs:Datatype . _:x owl:datatypeComplementOf D .
- Parameters:
other
-OntDataRange
, notnull
- Returns:
OntDataRange.ComplementOf
- See Also:
-
createDataUnionOf
Creates a Union of Data Ranges. RDF (turtle) syntax:_:x rdf:type rdfs:Datatype . _:x owl:unionOf ( D1 ... Dn ) .
- Parameters:
values
-Collection
ofdata range
s, withoutnull
s- Returns:
OntDataRange.UnionOf
- See Also:
-
createDataIntersectionOf
Creates an Intersection of Data Ranges. RDF (turtle) syntax:_:x rdf:type rdfs:Datatype . _:x owl:intersectionOf ( D1 ... Dn ) .
- Parameters:
values
-Collection
ofdata range
s, withoutnull
s- Returns:
OntDataRange.IntersectionOf
- See Also:
-
createDataOneOf
Creates an Enumeration of Literals.- Parameters:
values
- Array ofliteral
s, withoutnull
-elements- Returns:
OntDataRange.OneOf
- See Also:
-
createDataRestriction
default OntDataRange.Restriction createDataRestriction(OntDataRange.Named other, OntFacetRestriction... values) Creates a Datatype Restriction.- Parameters:
other
-Named Data Range
, notnull
values
- Array offacet restriction
s, withoutnull
s- Returns:
OntDataRange.Restriction
- See Also:
-
createDataUnionOf
Creates a Union of Data Ranges.- Parameters:
values
-Collection
ofdata range
s, withoutnull
-elements- Returns:
OntDataRange.UnionOf
- See Also:
-
createDataIntersectionOf
Creates an Intersection of Data Ranges.- Parameters:
values
- Array ofdata range
s, withoutnull
-elements- Returns:
OntDataRange.IntersectionOf
- See Also:
-
createDisjointClasses
Creates a Disjoint Classes Axiom Resource. The RDF structure:_:x rdf:type owl:AllDisjointClasses . _:x owl:members ( C1 ... Cn ) .
- Parameters:
classes
-Collection
ofClass Expression
s withoutnull
-elements- Returns:
OntDisjoint.Classes
- See Also:
-
createDifferentIndividuals
Creates a Different Individuals Axiom Resource. The RDF structure:
Note: instead of_:x rdf:type owl:AllDifferent . _:x owl:members ( a1 ... an ).
owl:members
, alternatively, the predicateowl:distinctMembers
can be used.- Parameters:
individuals
-Collection
ofIndividual
s withoutnull
-elements- Returns:
OntDisjoint.Individuals
- See Also:
-
createDisjointObjectProperties
OntDisjoint.ObjectProperties createDisjointObjectProperties(Collection<OntObjectProperty> properties) Creates a Disjoint Object Properties Axiom Resource. The RDF structure:_:x rdf:type owl:AllDisjointProperties . _:x owl:members ( P1 ... Pn ) .
- Parameters:
properties
-Collection
ofobject property expression
s withoutnull
-elements- Returns:
OntDisjoint.ObjectProperties
- See Also:
-
createDisjointDataProperties
Creates a Disjoint Data Properties Axiom Resource. The RDF structure:_:x rdf:type owl:AllDisjointProperties . _:x owl:members ( R1 ... Rn ) .
- Parameters:
properties
-Collection
ofdata properties
withoutnull
-elements- Returns:
OntDisjoint.DataProperties
- See Also:
-
createDisjointClasses
Creates a Disjoint Classes Axiom Resource.- Parameters:
classes
- Array ofClass Expression
s withoutnull
-elements- Returns:
OntDisjoint.Classes
- See Also:
-
createDifferentIndividuals
Creates a Different Individuals Axiom Resource.- Parameters:
individuals
- Array ofindividual
s withoutnull
-elements- Returns:
OntDisjoint.Individuals
- See Also:
-
createDisjointObjectProperties
default OntDisjoint.ObjectProperties createDisjointObjectProperties(OntObjectProperty... properties) Creates a Disjoint Object Properties Axiom Resource.- Parameters:
properties
- Array ofObject Property Expression
s withoutnull
-elements- Returns:
OntDisjoint.ObjectProperties
- See Also:
-
createDisjointDataProperties
Creates a Disjoint Data Properties Axiom Resource.- Parameters:
properties
- Array ofData Properties
withoutnull
-elements- Returns:
OntDisjoint.DataProperties
- See Also:
-
createSWRLVariable
Creates a SWRL Variable, that is a URI resource with a typeswrl:Variable
.- Parameters:
uri
- String, notnull
- Returns:
OntSWRL.Variable
-
createBuiltInSWRLAtom
OntSWRL.Atom.WithBuiltin createBuiltInSWRLAtom(org.apache.jena.rdf.model.Resource predicate, Collection<OntSWRL.DArg> arguments) Creates a BuiltIn Atom. An input predicate can be taken fromSWRL Builins Vocabulary
. Turtle syntax:_:x rdf:type swrl:BuiltinAtom . _:x swrl:arguments ( d1 ... d2 ) . _:x swrl:builtin U .
- Parameters:
predicate
- an URI,Resource
, notnull
arguments
-Collection
ofOntSWRL.DArg
s- Returns:
OntSWRL.Atom.WithBuiltin
- See Also:
-
SWRLB
-
createClassSWRLAtom
Creates a Class Atom. Turtle syntax:_:x rdf:type swrl:ClassAtom . _:x swrl:argument1 i . _:x swrl:classPredicate C .
- Parameters:
clazz
-OntClass
, notnull
arg
-OntSWRL.IArg
(eitherOntIndividual
orOntSWRL.Variable
), notnull
- Returns:
OntSWRL.Atom.WithClass
-
createDataRangeSWRLAtom
Creates a Data Range Atom. Turtle syntax:_:x rdf:type swrl:DataRangeAtom . _:x swrl:argument1 d . _:x swrl:dataRange D .
- Parameters:
range
-OntDataRange
, notnull
arg
-OntSWRL.DArg
(eitherOntSWRL.Variable
orLiteral
), notnull
- Returns:
OntSWRL.Atom.WithDataRange
-
createDataPropertySWRLAtom
OntSWRL.Atom.WithDataProperty createDataPropertySWRLAtom(OntDataProperty property, OntSWRL.IArg first, OntSWRL.DArg second) Creates a Data Property Atom. Turtle syntax:_:x rdf:type swrl:DatavaluedPropertyAtom . _:x swrl:argument1 i . _:x swrl:argument2 d . _:x swrl:propertyPredicate R .
- Parameters:
property
-OntDataProperty
, notnull
first
-OntSWRL.IArg
(eitherOntIndividual
orOntSWRL.Variable
), notnull
second
-OntSWRL.DArg
(eitherOntSWRL.Variable
orLiteral
), notnull
- Returns:
OntSWRL.Atom.WithDataProperty
-
createObjectPropertySWRLAtom
OntSWRL.Atom.WithObjectProperty createObjectPropertySWRLAtom(OntObjectProperty property, OntSWRL.IArg first, OntSWRL.IArg second) Creates an Object Property Atom. Turtle syntax:_:x rdf:type swrl:IndividualPropertyAtom . _:x swrl:argument1 i1 . _:x swrl:argument2 i2 . _:x swrl:propertyPredicate P .
- Parameters:
property
-OntObjectProperty
, notnull
first
-OntSWRL.IArg
(eitherOntIndividual
orOntSWRL.Variable
), notnull
second
-OntSWRL.IArg
(eitherOntIndividual
orOntSWRL.Variable
), notnull
- Returns:
OntSWRL.Atom.WithObjectProperty
-
createDifferentIndividualsSWRLAtom
OntSWRL.Atom.WithDifferentIndividuals createDifferentIndividualsSWRLAtom(OntSWRL.IArg first, OntSWRL.IArg second) Creates a Different Individuals Atom. Turtle syntax:_:x rdf:type swrl:DifferentIndividualsAtom . _:x swrl:argument1 i1 . _:x swrl:argument2 i2 .
- Parameters:
first
-OntSWRL.IArg
(eitherOntIndividual
orOntSWRL.Variable
), notnull
second
-OntSWRL.IArg
(eitherOntIndividual
orOntSWRL.Variable
), notnull
- Returns:
OntSWRL.Atom.WithDifferentIndividuals
-
createSameIndividualsSWRLAtom
OntSWRL.Atom.WithSameIndividuals createSameIndividualsSWRLAtom(OntSWRL.IArg first, OntSWRL.IArg second) Creates a Same Individuals Atom. Turtle syntax:_:x rdf:type swrl:SameIndividualAtom . _:x swrl:argument1 i1 . _:x swrl:argument2 i2 .
- Parameters:
first
-OntSWRL.IArg
(eitherOntIndividual
orOntSWRL.Variable
), notnull
second
-OntSWRL.IArg
(eitherOntIndividual
orOntSWRL.Variable
), notnull
- Returns:
OntSWRL.Atom.WithSameIndividuals
-
createSWRLImp
Creates a SWRL Rule. A rule consists of a head and a body. Both the head and the body consist of a conjunction of Atoms. In RDF, instead of a regular []-list, a typed version of []-lis is used, whererdf:type
isswrl:AtomList
. Turtle syntax:_:x rdf:type swrl:Impl . _:x swrl:body (swrl:AtomList: A1 ... An ) . _:x swrl:head (swrl:AtomList: A1 ... Am ) .
- Parameters:
head
-Collection
ofOntSWRL.Atom
sbody
-Collection
ofOntSWRL.Atom
s- Returns:
OntSWRL.Imp
-