- All Superinterfaces:
org.apache.jena.graph.FrontsNode
,OntObject
,org.apache.jena.rdf.model.RDFNode
,org.apache.jena.rdf.model.Resource
- All Known Subinterfaces:
OntClass.CardinalityRestriction<O,
,P> OntClass.CollectionOf<O>
,OntClass.ComplementOf
,OntClass.ComponentRestriction<O,
,P> OntClass.DataAllValuesFrom
,OntClass.DataCardinality
,OntClass.DataHasValue
,OntClass.DataMaxCardinality
,OntClass.DataMinCardinality
,OntClass.DataSomeValuesFrom
,OntClass.HasSelf
,OntClass.IntersectionOf
,OntClass.LogicalExpression
,OntClass.Named
,OntClass.NaryDataAllValuesFrom
,OntClass.NaryDataSomeValuesFrom
,OntClass.NaryRestriction<O,
,P> OntClass.ObjectAllValuesFrom
,OntClass.ObjectCardinality
,OntClass.ObjectHasValue
,OntClass.ObjectMaxCardinality
,OntClass.ObjectMinCardinality
,OntClass.ObjectSomeValuesFrom
,OntClass.OneOf
,OntClass.Restriction
,OntClass.UnaryRestriction<P>
,OntClass.UnionOf
,OntClass.ValueRestriction<O,
P>
- All Known Implementing Classes:
OntClassImpl
,OntClassImpl.CardinalityRestrictionImpl
,OntClassImpl.ComplementOfImpl
,OntClassImpl.ComponentRestrictionImpl
,OntClassImpl.DataAllValuesFromImpl
,OntClassImpl.DataCardinalityImpl
,OntClassImpl.DataHasValueImpl
,OntClassImpl.DataMaxCardinalityImpl
,OntClassImpl.DataMinCardinalityImpl
,OntClassImpl.DataSomeValuesFromImpl
,OntClassImpl.HasSelfImpl
,OntClassImpl.IntersectionOfImpl
,OntClassImpl.NaryDataAllValuesFromImpl
,OntClassImpl.NaryDataSomeValuesFromImpl
,OntClassImpl.NaryRestrictionImpl
,OntClassImpl.ObjectAllValuesFromImpl
,OntClassImpl.ObjectCardinalityImpl
,OntClassImpl.ObjectHasValueImpl
,OntClassImpl.ObjectMaxCardinalityImpl
,OntClassImpl.ObjectMinCardinalityImpl
,OntClassImpl.ObjectSomeValuesFromImpl
,OntClassImpl.OneOfImpl
,OntClassImpl.OnPropertyRestrictionImpl
,OntClassImpl.QLComplementOfImpl
,OntClassImpl.QLDataSomeValuesFromImpl
,OntClassImpl.QLIntersectionOfImpl
,OntClassImpl.QLObjectSomeValuesFromImpl
,OntClassImpl.RestrictionImpl
,OntClassImpl.RLComplementOfImpl
,OntClassImpl.RLDataAllValuesFromImpl
,OntClassImpl.RLDataMaxCardinalityImpl
,OntClassImpl.RLDataSomeValuesFromImpl
,OntClassImpl.RLIntersectionOfImpl
,OntClassImpl.RLObjectAllValuesFromImpl
,OntClassImpl.RLObjectMaxCardinalityImpl
,OntClassImpl.RLObjectSomeValuesFromImpl
,OntClassImpl.RLOneOfImpl
,OntClassImpl.RLUnionOfImpl
,OntClassImpl.UnionOfImpl
,OntSimpleClassImpl
,OntSimpleClassImpl.NamedImpl
,OntSimpleClassImpl.RLNamedImpl
A base abstraction for any Class Expressions (both named and anonymous).
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
OntClass.CardinalityRestriction<O extends OntObject,
P extends OntRelationalProperty> An abstraction for Cardinality Restrictions.static interface
OntClass.CollectionOf<O extends OntObject>
An abstract class expression that unites class expressions consisting of multiple components.static interface
static interface
OntClass.ComponentRestriction<O extends org.apache.jena.rdf.model.RDFNode,
P extends OntRelationalProperty> An abstract class expression (Restriction) that has component (i.e., 'filler' in OWL-API terms): all Cardinality Restrictions, Existential/Universal Restrictions, Individual/Literal Value Restrictions.static interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
Describes Boolean Connectives and Enumeration of Individuals (OntClass.ComplementOf
,OntClass.UnionOf
,OntClass.IntersectionOf
andOntClass.OneOf
).static interface
An Ontology ClassEntity
, a named class expression.static interface
static interface
static interface
OntClass.NaryRestriction<O extends OntObject,
P extends OntRelationalProperty> An abstraction that unites allRestriction
s with the predicateowl:onProperties
.static interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
A supertype for all class expressions with the typeOWL2.Restriction
.static interface
An abstract class expression that unites allRestriction
s with the predicateowl:onProperty
.static interface
static interface
OntClass.ValueRestriction<O extends org.apache.jena.rdf.model.RDFNode,
P extends OntRelationalProperty> An abstract for *Value*Restrictions (e.g. -
Method Summary
Modifier and TypeMethodDescriptiondefault OntClass
addDisjointClass
(OntClass other) Adds the given class as a disjoint class and returns this class expression instance to allow cascading calls.default OntStatement
addDisjointWithStatement
(OntClass other) Adds the given class as a disjoint class and returns the corresponding statement to provide the ability to add annotations.default OntClass
addEquivalentClass
(OntClass other) Adds a new equivalent class.default OntStatement
Adds the given class as an equivalent class and returns the corresponding statement to provide the ability to add annotations.default OntClass
addHasKey
(Collection<OntObjectProperty> objectProperties, Collection<OntDataProperty> dataProperties) Creates anowl:hasKey
statement returning this class to allow cascading calls.default OntClass
addHasKey
(OntRelationalProperty... properties) Creates anowl:hasKey
statement returning this class to allow cascading calls.default OntStatement
addHasKeyStatement
(Collection<OntObjectProperty> objectProperties, Collection<OntDataProperty> dataProperties) Creates anowl:hasKey
statement returning the root statement to allow the subsequent annotations adding.addHasKeyStatement
(OntRelationalProperty... properties) Creates aHasKey
logical construction asontology list
and returns the statementC owl:hasKey ( P1 ... Pm R1 ... Rn )
to allow the subsequent addition of annotations.default OntClass
addSubClass
(OntClass other) Adds the given class as a subclass and returns this class expression instance to allow cascading calls.default OntStatement
addSubClassOfStatement
(OntClass other) Adds the given class as a superclass and returns the corresponding statement to provide the ability to add annotations.default OntClass
addSuperClass
(OntClass other) Adds the given class as a superclass and returns this class expression instance to allow cascading calls.default OntClass
Returns the assertion-view of this class if the specification allows this class to make class assertions, otherwise throws exception.default OntClass
Returns the disjoint-class-view of this class if the specification allows this to be in disjoint position (owl:disjointWith
,owl:AllDisjointClasses
), otherwise throws exception.default OntClass
Returns the equivalent-class-view of this class if the specification allows this class to be in equivalent position (owl:equivalentClass
), otherwise throws exception.default OntClass.Named
asNamed()
Represents this OWL class expression as a named OWL class if it is possible, otherwise throws an exception.default OntClass
Returns the subclass-view of this class if the specification allows this class to be in subclass position, otherwise throws exception.default OntClass
Returns the superclass-view of this class if the specification allows this class to be in superclass position, otherwise throws exception.default boolean
Answers if this class can be an object in class-assertion statement (a type of individual).default boolean
Answers if this class can be disjoint with another class.default boolean
Answers if this class can be an equivalent of another class.default boolean
Answers if this class can be a subclass of another class.default boolean
Answers if this class can be a superclass of another class.default OntClass
Deletes allHasKey
[]-list including its annotations, i.e., all those statements with the predicateowl:hasKey
for which this resource is a subject.createHasKey
(Collection<OntObjectProperty> objectProperties, Collection<OntDataProperty> dataProperties) Creates aHasKey
logical construction asontology []-list
ofObject or Data Property Expression
s that is attached to this Class Expression using the predicateowl:hasKey
.Creates an anonymous individual which is of this class-expression type.createIndividual
(String uri) Creates a named individual which is of this class type.default Stream<OntProperty>
Equivalent tothis.declaredProperties(false)
declaredProperties
(boolean direct) Returns aStream
over theproperties
associated with a frame-like view of this class.Returns disjoint class-objects.default Stream<OntDisjoint.Classes>
Lists allOntDisjoint
sections where this class is a member.Lists all equivalent classes.default Optional<OntList<OntRelationalProperty>>
findHasKey
(org.apache.jena.rdf.model.RDFNode list) Finds aHasKey
logical construction attached to this class expression by the specified rdf-node in the form ofOntList
.default Stream<OntRelationalProperty>
Lists all key properties.default <X extends org.apache.jena.rdf.model.RDFNode>
XSafely converts this RDF resource to the giventype
interface, if it is possible.getModel()
Returns the ontology model associated with this resource.boolean
hasDeclaredProperty
(OntProperty property, boolean direct) Returnstrue
if the given property is associated with a frame-like view of this class.hasKeys()
Lists allHasKey
ontology []-list
s that are attached to this class expression on predicateowl:hasKey
.default boolean
hasSubClass
(OntClass clazz, boolean direct) Answerstrue
if the given class is a subclass of this class.default boolean
hasSuperClass
(OntClass clazz, boolean direct) Answerstrue
if the given class is a superclass of this class.default Stream<OntIndividual>
Lists all individuals taking into account class hierarchy.individuals
(boolean direct) Lists all individuals, directly or indirectly connected to this class.boolean
isDisjoint
(org.apache.jena.rdf.model.Resource candidate) Answerstrue
if this class is disjoint with the given class.boolean
Answers true if this class is one of the roots of the local class hierarchy.boolean
isLocal()
Determines if this Ontology Resource is locally defined.default Stream<OntProperty>
Lists all properties attached to this class in ardfs:domain
statement.default OntClass
removeDisjointClass
(org.apache.jena.rdf.model.Resource other) Removes the specified disjoint class resource.default OntClass
removeEquivalentClass
(org.apache.jena.rdf.model.Resource other) Removes the given equivalent class resource including the statement's annotations.removeHasKey
(org.apache.jena.rdf.model.Resource list) Deletes the givenHasKey
list including its annotations.default OntClass
removeIndividual
(org.apache.jena.rdf.model.Resource individual) Removes the given individual from the set of instances that are members of this class.default OntClass
removeSubClass
(org.apache.jena.rdf.model.Resource other) Removes a subclass relationship for the given resource including all possible annotations.default OntClass
removeSuperClass
(org.apache.jena.rdf.model.Resource other) Removes a superclass relationship for the given resource including all possible annotations.subClass()
Answers a class that is the subclass of this class.Lists all direct or indirect subclasses for this class expression, i.e., all subclasses found by inferencer, which usually means entire hierarchy down the tree; this class is not included.subClasses
(boolean direct) Answers aStream
over all the class expressions that are declared to be subclasses of this class expression.Answers a class that is the superclass of this class.Lists all direct and indirect superclasses for this class expression, i.e., all superclasses found by inferencer, which usually means entire hierarchy up the tree; this class is not included.superClasses
(boolean direct) Answers aStream
over the class-expressions for which this class expression is declared a subclass.Methods inherited from interface org.apache.jena.graph.FrontsNode
asNode
Methods inherited from interface org.apache.jena.ontapi.model.OntObject
addAnnotation, addAnnotation, addAnnotation, addComment, addComment, addLabel, addLabel, addStatement, annotate, annotate, annotations, annotationValues, annotationValues, clearAnnotations, content, getComment, getComment, getLabel, getLabel, getMainStatement, getRequiredProperty, hasType, objects, objects, objectType, remove, spec, statement, statement, statements, statements, types
Methods inherited from interface org.apache.jena.rdf.model.RDFNode
as, asLiteral, asResource, canAs, isAnon, isLiteral, isResource, isStmtResource, isURIResource, visitWith
Methods inherited from interface org.apache.jena.rdf.model.Resource
abort, addLiteral, addLiteral, addLiteral, addLiteral, addLiteral, addLiteral, addLiteral, addProperty, addProperty, addProperty, addProperty, begin, commit, equals, getId, getLocalName, getNameSpace, getProperty, getProperty, getPropertyResourceValue, getRequiredProperty, getStmtTerm, getURI, hasLiteral, hasLiteral, hasLiteral, hasLiteral, hasLiteral, hasLiteral, hasProperty, hasProperty, hasProperty, hasProperty, hasURI, inModel, listProperties, listProperties, listProperties, removeAll, removeProperties, toString
-
Method Details
-
subClasses
Answers aStream
over all the class expressions that are declared to be subclasses of this class expression. The returnStream
is distinct and this instance is not included in it. The flagdirect
allows some selectivity over the classes that appear in theStream
. Consider the following scenario:
(so:B rdfs:subClassOf :A. :C rdfs:subClassOf :A. :D rdfs:subClassOf :C.
A
has two subclasses,B
andC
, andC
has subclassD
) In a raw model, with no inference support, listing the subclasses ofA
will answerB
andC
. In an inferencing model,rdfs:subClassOf
is known to be transitive, so the subclasses iterator will includeD
. Thedirect
subclasses are those members of the closure of the subClassOf relation, restricted to classes that cannot be reached by a longer route, i.e., the ones that are directly adjacent to the given root. Thus, the direct subclasses ofA
areB
andC
only, and notD
- even in an inferencing graph. Note that this is not the same as the entailments from the raw graph. Suppose we add to this example:
Now, in the raw graph,:D rdfs:subClassOf :A.
A
has subclassC
. But the direct subclasses ofA
remainB
andC
, since there is a longer pathA-C-D
that means thatD
is not a direct subclass ofA
. The assertion in the raw graph thatA
has subclassD
is essentially redundant, since this can be inferred from the closure of the graph.- Parameters:
direct
-boolean
- iftrue
answers the directly adjacent classes in the subclass relation: i.e., eliminate any class for which there is a longer route to reach that parent under the subclass relation; iffalse
answers all subclasses found by inferencer, which usually means entire hierarchy down the tree; this class is not included- Returns:
- distinct
Stream
of subclass expression
s - See Also:
-
superClasses
Answers aStream
over the class-expressions for which this class expression is declared a subclass. The returnStream
is distinct and this instance is not included in it.The flag
direct
allows some selectivity over the classes that appear in theStream
. Consider the following scenario:
(so:A rdfs:subClassOf :B . :A rdfs:subClassOf :C . :C rdfs:subClassOf :D .
A
has superclassesB
andC
, andC
has superclassD
) In a raw model, with no inference support, listing the superclasses ofA
will answerB
andC
. In an inferencing model,rdfs:subClassOf
is known to be transitive, so the superclasses iterator will includeD
. Thedirect
superclasses are those members of the closure of the inverse-subClassOf relation, restricted to classes that cannot be reached by a longer route, i.e., the ones that are directly adjacent to the given root. Thus, the direct superclasses ofA
areB
andC
only, and notD
- even in an inferencing graph. Note that this is not the same as the entailments from the raw graph. Suppose we add to this example:
Now, in the raw graph,:A rdfs:subClassOf :D .
A
has superclassesB
,C
,D
. But the direct superclasses ofA
remain onlyB
and C, since there is a longer pathA-C-D
that means thatD
is not a direct superclass ofA
. The assertion in the raw graph thatA
has superclassD
is essentially redundant, since this can be inferred from the closure of the graph.- Parameters:
direct
-boolean
: iftrue
answers the directly adjacent classes in the superclass relation, i.e., eliminate any class for which there is a longer route to reach that parent under the superclass relation; iffalse
answers all superclasses found by inferencer, which usually means entire hierarchy up the tree; this class is not included- Returns:
- distinct
Stream
of superclass expression
s - See Also:
-
individuals
Lists all individuals, directly or indirectly connected to this class. The search pattern isa rdf:type C
, whereC
is class expression anda
individual.- Parameters:
direct
-boolean
if true, only direct instances are counted (i.e., not instances of subclasses of this class)- Returns:
- a
Stream
ofOntIndividual
s
-
hasDeclaredProperty
Returnstrue
if the given property is associated with a frame-like view of this class. This captures an informal notion of the properties of a class, by looking at the domains of the property in this class's model, and matching them to this class. A full description of the frame-like view of a class may be found in: Apache Jena: RDF frames how-to for full details.Note that many cases of determining whether a property is associated with a class depend on RDFS or OWL reasoning. This method may therefore return complete results only in models that have an attached reasoner. For built-in properties the method returns always
false
. If there are no domains for the property, then it is considered as global and is attached to root classes.- Parameters:
property
-OntProperty
, notnull
direct
-boolean
: iftrue
analyses only the directly adjacent domains in the subclass relation, otherwise takes into account the class hierarchy- Returns:
boolean
,true
if the property is associated with this class by its domain, otherwisefalse
-
declaredProperties
Returns aStream
over theproperties
associated with a frame-like view of this class. This captures an intuitive notion of the properties of a class. This can be useful in presenting an ontology class in a user interface, for example, by automatically constructing a form to instantiate instances of the class. The properties in the frame-like view of the class are determined by comparing the domain of properties in this class'sOntModel
with the class itself. See: Apache Jena: Presenting RDF as frames for more details.- Parameters:
direct
-boolean
: iftrue
analyses only the directly adjacent domains in the subclass relation, otherwise takes into account the class hierarchy- Returns:
- a distinct
Stream
ofobject, datatype and annotation properties
, attached to this class - See Also:
-
isHierarchyRoot
boolean isHierarchyRoot()Answers true if this class is one of the roots of the local class hierarchy. This will be true if either (i) this class has eitherowl:Thing
orrdfs:Resource
as a direct superclass, or (ii) it has no declared superclasses.owl:Nothing
cannot be root.- Returns:
true
if this class is the root of the class hierarchy in the model it is attached to
-
hasKeys
Stream<OntList<OntRelationalProperty>> hasKeys()Lists allHasKey
ontology []-list
s that are attached to this class expression on predicateowl:hasKey
.- Returns:
Stream
ofOntList
s with parameter-typeOntDOP
-
createIndividual
OntIndividual.Anonymous createIndividual()Creates an anonymous individual which is of this class-expression type.- Returns:
OntIndividual.Anonymous
- See Also:
-
createIndividual
Creates a named individual which is of this class type.- Parameters:
uri
- String, notnull
- Returns:
OntIndividual.Named
- See Also:
-
createHasKey
OntList<OntRelationalProperty> createHasKey(Collection<OntObjectProperty> objectProperties, Collection<OntDataProperty> dataProperties) Creates aHasKey
logical construction asontology []-list
ofObject or Data Property Expression
s that is attached to this Class Expression using the predicateowl:hasKey
. The resulting rdf-list will consist of all the elements of the specified collection in the same order but with exclusion of duplicates. Note:null
s in the collection will causeexception
. For additional information aboutHasKey
logical construction see 9.5 Keys specification.- Parameters:
objectProperties
-Collection
(preferablySet
) ofobject property expression
sdataProperties
-Collection
(preferablySet
) ofdata property expression
s- Returns:
OntList
ofOntRelationalProperty
s- See Also:
-
addHasKeyStatement
Creates aHasKey
logical construction asontology list
and returns the statementC owl:hasKey ( P1 ... Pm R1 ... Rn )
to allow the subsequent addition of annotations. About RDF Graph annotation specification sees, for example, 2.3.1 Axioms that Generate a Main Triple.- Parameters:
properties
- Array ofOntRelationalProperty
s withoutnull
s- Returns:
OntStatement
with a possibility to annotate- See Also:
-
removeHasKey
Deletes the givenHasKey
list including its annotations.- Parameters:
list
-Resource
can beOntList
orRDFList
; ifnull
the method will remove all hasKey's- Returns:
- this instance to allow cascading calls
-
isDisjoint
boolean isDisjoint(org.apache.jena.rdf.model.Resource candidate) Answerstrue
if this class is disjoint with the given class.- Parameters:
candidate
-Resource
a class to test- Returns:
true
if this class is disjoint with the given class
-
disjointClasses
Returns disjoint class-objects. This includesthisClass owl:disjointWith otherClass
,otherClass owl:disjointWith thisClass
statements andowl:AllDisjointClasses
construct.- Returns:
- a
Stream
ofOntClass
s - See Also:
-
equivalentClasses
Lists all equivalent classes. The statement patter to search for isC1 owl:equivalentClass C2
.- Returns:
Stream
ofOntClass
s- See Also:
-
asNamed
Represents this OWL class expression as a named OWL class if it is possible, otherwise throws an exception. Effectively equivalent to the expressionthis.as(Named.class)
.- Throws:
org.apache.jena.enhanced.UnsupportedPolymorphismException
- if the expression is not named OWL entity
-
individuals
Lists all individuals taking into account class hierarchy. Equivalent tothis.individuals(false)
- Returns:
- a
Stream
ofOntIndividual
s - See Also:
-
properties
Lists all properties attached to this class in ardfs:domain
statement. The property is considered as attached if the property and the class expression are both included in the property domain axiom statement:R rdfs:domain C
-R
is a data property,C
- this class expressionP rdfs:domain C
-P
is an object property expression,C
- this class expressionA rdfs:domain U
-A
is annotation property,U
is IRI (this class expression)
- Returns:
Stream
ofOntProperty
s- See Also:
-
declaredProperties
Equivalent tothis.declaredProperties(false)
- Returns:
- a distinct
Stream
of (object, datatype & annotation properties), attached to this class - See Also:
-
subClasses
Lists all direct or indirect subclasses for this class expression, i.e., all subclasses found by inferencer, which usually means entire hierarchy down the tree; this class is not included. The search pattern isCi rdfs:subClassOf C
.Equivalent to
this.subClasses(false)
.- Returns:
Stream
ofOntClass
s- See Also:
-
subClass
Answers a class that is the subclass of this class. If there is more than one such class, an arbitrary selection is made. Unlike the methodsubClasses()
, this method can return this class itself. -
superClasses
Lists all direct and indirect superclasses for this class expression, i.e., all superclasses found by inferencer, which usually means entire hierarchy up the tree; this class is not included. The search pattern isC rdfs:subClassOf Ci
.Equivalent to
this.superClasses(false)
.- Returns:
Stream
ofOntClass
s- See Also:
-
superClass
Answers a class that is the superclass of this class. If there is more than one such class, an arbitrary selection is made. Unlike the methodsuperClasses()
, this method can return this class itself. -
hasSubClass
Answerstrue
if the given class is a subclass of this class. SeesubClasses(boolean)
for a full explanation of the direct parameter.- Parameters:
clazz
- aOntClass
to testdirect
-boolean
; If true, only search the classes that are directly adjacent to this class in the class hierarchy- Returns:
boolean
-
hasSuperClass
Answerstrue
if the given class is a superclass of this class. SeesuperClasses(boolean)
for a full explanation of the direct parameter- Parameters:
clazz
- aOntClass
to testdirect
-boolean
; If true, only search the classes that are directly adjacent to this class in the class hierarchy.- Returns:
boolean
-
disjoints
Lists allOntDisjoint
sections where this class is a member.- Returns:
- a
Stream
ofOntDisjoint.Classes
-
addSubClassOfStatement
Adds the given class as a superclass and returns the corresponding statement to provide the ability to add annotations.- Parameters:
other
-OntClass
, notnull
- Returns:
OntStatement
to allow the subsequent annotations addition- See Also:
-
addDisjointWithStatement
Adds the given class as a disjoint class and returns the corresponding statement to provide the ability to add annotations.- Parameters:
other
-OntClass
, notnull
- Returns:
OntStatement
to allow the subsequent annotations addition- See Also:
-
addEquivalentClassStatement
Adds the given class as an equivalent class and returns the corresponding statement to provide the ability to add annotations.- Parameters:
other
-OntClass
, notnull
- Returns:
OntStatement
to allow the subsequent annotations addition- See Also:
-
addHasKeyStatement
default OntStatement addHasKeyStatement(Collection<OntObjectProperty> objectProperties, Collection<OntDataProperty> dataProperties) Creates anowl:hasKey
statement returning the root statement to allow the subsequent annotations adding.- Parameters:
objectProperties
- the collection ofOntObjectProperty
s, notnull
and cannot containnull
sdataProperties
- the collection ofOntDataProperty
s, notnull
and cannot containnull
s- Returns:
OntStatement
to allow the subsequent annotations addition- See Also:
-
addSuperClass
Adds the given class as a superclass and returns this class expression instance to allow cascading calls.- Parameters:
other
-OntClass
, notnull
- Returns:
- this instance to allow cascading calls
- See Also:
-
addSubClass
Adds the given class as a subclass and returns this class expression instance to allow cascading calls.- Parameters:
other
-OntClass
, notnull
- Returns:
- this instance to allow cascading calls
- See Also:
-
addDisjointClass
Adds the given class as a disjoint class and returns this class expression instance to allow cascading calls.- Parameters:
other
-OntClass
, notnull
- Returns:
- this instance to allow cascading calls
- See Also:
-
addEquivalentClass
Adds a new equivalent class.- Parameters:
other
-OntClass
, notnull
- Returns:
- this instance to allow cascading calls
- See Also:
-
addHasKey
default OntClass addHasKey(Collection<OntObjectProperty> objectProperties, Collection<OntDataProperty> dataProperties) Creates anowl:hasKey
statement returning this class to allow cascading calls.- Parameters:
objectProperties
- the collection ofOntObjectProperty
sdataProperties
- the collection ofOntDataProperty
s- Returns:
- this instance to allow cascading calls
- See Also:
-
addHasKey
Creates anowl:hasKey
statement returning this class to allow cascading calls.- Parameters:
properties
- Array ofOntRelationalProperty
s withoutnull
s- Returns:
- this instance to allow cascading calls
- See Also:
-
removeIndividual
Removes the given individual from the set of instances that are members of this class. This is effectively equivalent to theOntIndividual.detachClass(Resource)
method if the specified resource isOntIndividual
.- Parameters:
individual
-Resource
a resource denoting an individual that is no longer to be a member of this class- Returns:
- this instance to allow cascading calls
-
removeSuperClass
Removes a superclass relationship for the given resource including all possible annotations. No-op in case no match found. Removes allrdfs:subClassOf
statements with all their annotations in casenull
is specified.- Parameters:
other
-Resource
ornull
to remove allrdfs:subClassOf
statements- Returns:
- this instance to allow cascading calls
- See Also:
-
removeSubClass
Removes a subclass relationship for the given resource including all possible annotations. No-op in case no match found. Removes allrdfs:subClassOf
statements with all their annotations in casenull
is specified.- Parameters:
other
-Resource
ornull
to remove allrdfs:subClassOf
statements- Returns:
- this instance to allow cascading calls
- See Also:
-
removeDisjointClass
Removes the specified disjoint class resource. No-op in case no match found. Removes allowl:disjointWith
statements with all their annotations in casenull
is specified.- Parameters:
other
-Resource
, ornull
to remove all disjoint classes- Returns:
- this instance to allow cascading calls
- See Also:
-
removeEquivalentClass
Removes the given equivalent class resource including the statement's annotations. No-op in case no match found. Removes allowl:equivalentClass
statements with all their annotations in casenull
is specified.- Parameters:
other
-Resource
, ornull
to remove all equivalent classes- Returns:
- this instance to allow cascading calls
- See Also:
-
clearHasKeys
Deletes allHasKey
[]-list including its annotations, i.e., all those statements with the predicateowl:hasKey
for which this resource is a subject.- Returns:
- this instance to allow cascading calls
- Throws:
OntJenaException
- if the list is not found
-
findHasKey
Finds aHasKey
logical construction attached to this class expression by the specified rdf-node in the form ofOntList
.- Parameters:
list
-RDFNode
- Returns:
Optional
aroundOntList
ofdata and object property expression
s
-
fromHasKey
Lists all key properties. I.e., returns all object- and datatype-properties that belong to theC owl:hasKey ( P1 ... Pm R1 ... Rn )
statements, whereC
is this class expression,Pi
is a property expression, andRi
is a data(-type) property. If there are several []-lists in the model that satisfy these conditions, all their content will be merged into the one distinct stream. -
asSubClass
Returns the subclass-view of this class if the specification allows this class to be in subclass position, otherwise throws exception. Some profiles (e.g., OWL2 QL, OWL2 RL) distinguish constructions with respect to their position in the axiom statements. Note that the returned class may differ in behavior from this class.- Returns:
OntClass
, notnull
- Throws:
OntJenaException.Unsupported
- if this feature is not supported- See Also:
-
canAsSubClass
default boolean canAsSubClass()Answers if this class can be a subclass of another class. Some profiles (e.g., OWL2 QL, OWL2 RL) distinguish constructions with respect to their position in the axiom statements.- Returns:
true
if this class can be a subclass- See Also:
-
asSuperClass
Returns the superclass-view of this class if the specification allows this class to be in superclass position, otherwise throws exception. Some profiles (e.g., OWL2 QL, OWL2 RL) distinguish constructions with respect to their position in the axiom statements. Note that the returned class may differ in behavior from this class.- Returns:
OntClass
ornull
- Throws:
OntJenaException.Unsupported
- if this feature is not supported- See Also:
-
canAsSuperClass
default boolean canAsSuperClass()Answers if this class can be a superclass of another class. Some profiles (e.g., OWL2 QL, OWL2 RL) distinguish constructions with respect to their position in the axiom statements.- Returns:
true
if this class can be a superclass- See Also:
-
asAssertionClass
Returns the assertion-view of this class if the specification allows this class to make class assertions, otherwise throws exception. Some profiles (e.g., OWL2 QL, OWL2 RL) distinguish constructions with respect to their position in the axiom statements. Note that the returned class may differ in behavior from this class.- Returns:
OntClass
ornull
- Throws:
OntJenaException.Unsupported
- if this feature is not supported- See Also:
-
canAsAssertionClass
default boolean canAsAssertionClass()Answers if this class can be an object in class-assertion statement (a type of individual). Some profiles (e.g., OWL2 QL, OWL2 RL) distinguish constructions with respect to their position in the axiom statements.- Returns:
true
if this class can be a class-type of an individual- See Also:
-
asEquivalentClass
Returns the equivalent-class-view of this class if the specification allows this class to be in equivalent position (owl:equivalentClass
), otherwise throws exception. Some profiles (e.g., OWL2 QL, OWL2 RL) distinguish constructions with respect to their position in the axiom statements. Note that the returned class may differ in behavior from this class.- Returns:
OntClass
ornull
- Throws:
OntJenaException.Unsupported
- if this feature is not supported- See Also:
-
canAsEquivalentClass
default boolean canAsEquivalentClass()Answers if this class can be an equivalent of another class. Some profiles (e.g., OWL2 QL, OWL2 RL) distinguish constructions with respect to their position in the axiom statements.- Returns:
true
if this class can be equivalent of another class- See Also:
-
asDisjointClass
Returns the disjoint-class-view of this class if the specification allows this to be in disjoint position (owl:disjointWith
,owl:AllDisjointClasses
), otherwise throws exception. Some profiles (e.g., OWL2 QL, OWL2 RL) distinguish constructions with respect to their position in the axiom statements.- Returns:
OntClass
ornull
- Throws:
OntJenaException.Unsupported
- if this feature is not supported- See Also:
-
canAsDisjointClass
default boolean canAsDisjointClass()Answers if this class can be disjoint with another class. Some profiles (e.g., OWL2 QL, OWL2 RL) distinguish constructions with respect to their position in the axiom statements.- Returns:
true
if this class can be disjoint with another class- See Also:
-
getModel
OntModel getModel()Returns the ontology model associated with this resource. If the Resource was not created by a Model, the result may be null.- Specified by:
getModel
in interfaceorg.apache.jena.rdf.model.RDFNode
- Returns:
OntModel
-
isLocal
boolean isLocal()Determines if this Ontology Resource is locally defined. This means that the resource definition (i.e., a theroot statement
) belongs to the base ontology graph. If the ontology contains subgraphs (which should matchowl:imports
in OWL) and the resource is defined in one of them, than this method called from top-level interface will returnfalse
.- Returns:
true
if this resource is local to the base model graph.
-
getAs
Safely converts this RDF resource to the giventype
interface, if it is possible. Otherwise, returnsnull
. A calling of this method is effectively equivalent to the expressionthis.canAs(type) ? this.as(type) : null
.- Type Parameters:
X
- any subtype ofRDFNode
- Parameters:
type
- aClass
-type of the desired RDF view (interface)- Returns:
- an instance of the type
X
ornull
- See Also:
-
RDFNode.as(Class)
RDFNode.canAs(Class)
-