- All Superinterfaces:
org.apache.jena.graph.FrontsNode
,OntObject
,OntProperty
,OntRelationalProperty
,org.apache.jena.rdf.model.RDFNode
,org.apache.jena.rdf.model.Resource
- All Known Subinterfaces:
OntObjectProperty.Inverse
,OntObjectProperty.Named
- All Known Implementing Classes:
OntObjectPropertyImpl
,OntObjectPropertyImpl.InversePropertyImpl
,OntObjectPropertyImpl.NamedImpl
A common interface for any Ontology Object Property Expression.
In OWL2, there are two types of object property expressions:
named object property (entity) and InverseOf anonymous property expression.
Range values for this property expression are restricted to individuals
(as distinct from datatype valued
properties
).-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Represents a ObjectInverseOf.static interface
Interface encapsulating an Ontology Named Object Property. -
Method Summary
Modifier and TypeMethodDescriptiondefault OntStatement
Creates theP rdf:type owl:AsymmetricProperty
property declaration statement, whereP
is this property.default OntObjectProperty
Adds a newowl:propertyDisjointWith
statement for this and the specified property.default OntObjectProperty
Adds a statement with theRDFS.domain
as predicate and the specifiedclass expression
as an object.default OntObjectProperty
Adds a newowl:equivalentProperty
statement.default OntStatement
Creates and returns a newowl:equivalentProperty
statement with the given property as an object and this property as a subject.default OntStatement
Creates theP rdf:type owl:InverseFunctionalProperty
property declaration statement, whereP
is this property.default OntStatement
Adds a new inverse-of statement.default OntObjectProperty
Adds a new inverse-of a statement, returns this property instance.default OntStatement
Creates theP rdf:type owl:IrreflexiveProperty
property declaration statement, whereP
is this property.addNegativeAssertion
(OntIndividual source, OntIndividual target) Adds a negative property assertion ontology object.default OntObjectProperty
addPropertyChain
(Collection<OntObjectProperty> properties) Adds a new sub-property-of a chain statement and returns this object itself.default OntObjectProperty
addPropertyChain
(OntObjectProperty... properties) Adds a new sub-property-of a chain statement and returns this object itself.default OntStatement
addPropertyChainAxiomStatement
(Collection<OntObjectProperty> properties) Adds a new sub-property-of chain statement.default OntStatement
addPropertyChainAxiomStatement
(OntObjectProperty... properties) Creates a property chainontology list
and returns the statementP owl:propertyChainAxiom ( P1 ... Pn )
to allow the addition of annotations.default OntStatement
Adds a disjoint object property (i.e., the_:this owl:propertyDisjointWith @other
statement).default OntObjectProperty
Adds a statement with theRDFS.range
as predicate and the specifiedclass expression
as an object.default OntStatement
Creates theP rdf:type owl:ReflexiveProperty
property declaration statement, whereP
is this property.default OntObjectProperty
addSubProperty
(OntObjectProperty property) Adds the given property as sub property returning this property itself.default OntObjectProperty
addSuperProperty
(OntObjectProperty property) Adds the given property as super property returning this property itself.default OntStatement
Creates theP rdf:type owl:SymmetricProperty
property declaration statement, whereP
is this property.default OntStatement
Creates theP rdf:type owl:TransitiveProperty
property declaration statement, whereP
is this property.default OntObjectProperty.Named
asNamed()
default OntObjectProperty
Deletes all property chain lists including their annotations.createPropertyChain
(Collection<OntObjectProperty> properties) Creates a property chain logical constructions as aontology []-list
ofObject Property Expression
s that is attached to this Object Property Expression at object positions with the predicateowl:propertyChainAxiom
.default Stream<OntObjectProperty>
Returns disjoint properties (statement:P1 owl:propertyDisjointWith P2
).default Stream<OntDisjoint.ObjectProperties>
Lists allOntDisjoint
sections where this object property is a member.default Stream<OntObjectProperty>
Returns all equivalent object properties (i.e.default Optional<OntList<OntObjectProperty>>
findPropertyChain
(org.apache.jena.rdf.model.RDFNode list) Finds the firstPropertyChain
logical construction attached to this property for the specified []-list as an object.default Stream<OntObjectProperty>
Lists all members from the right part of statementP owl:propertyChainAxiom ( P1 ... Pn )
, whereP
is this property.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.default Stream<OntObjectProperty>
Lists all object properties from the right part of the statement_:this owl:inverseOf P
.default Optional<OntObjectProperty>
Finds the first object property from the right part of the statements_:x owl:inverseOf PN
orP1 owl:inverseOf P2
.default boolean
default boolean
default boolean
boolean
isLocal()
Determines if this Ontology Resource is locally defined.default boolean
default boolean
default boolean
Returns all associated negative object property assertions.negativeAssertions
(OntIndividual source) Returns all associated negative object property assertions for the specified source individual.Returns aStream
over all property chainontology list
s that are attached to this Object Property Expression on the predicateowl:propertyChainAxiom
.ranges()
Returns all ranges.ranges
(boolean direct) Gets all direct or indirect ranges that present in RDF graph.default OntObjectProperty
removeDisjointProperty
(org.apache.jena.rdf.model.Resource property) Removes theowl:propertyDisjointWith
statement (a statement with the predicateowl:propertyDisjointWith
) for the specified resource (considered as an object), including the corresponding statement's annotations.default OntObjectProperty
removeDomain
(org.apache.jena.rdf.model.Resource domain) Removes the specified domain resource (predicate isrdfs:domain
), including the corresponding statement's annotations.default OntObjectProperty
removeEquivalentProperty
(org.apache.jena.rdf.model.Resource property) Removes the equivalent property statement (a statement with the predicateowl:equivalentProperty
) for the specified resource (considered as an object), including the corresponding statement's annotations.default OntObjectProperty
removeInverseProperty
(org.apache.jena.rdf.model.Resource other) Removes the statement with the predicateowl:inverseOf
and the given object property as an object.removePropertyChain
(org.apache.jena.rdf.model.Resource list) Deletes the given property chain list including all its annotations.default OntObjectProperty
removeRange
(org.apache.jena.rdf.model.Resource range) Removes the specified range resource (predicate isrdfs:range
), including the corresponding statement's annotations.default OntObjectProperty
removeSubProperty
(org.apache.jena.rdf.model.Resource property) Removes the specified sub property (predicate isrdfs:subPropertyOf
), including the corresponding statement's annotations.default OntObjectProperty
removeSuperProperty
(org.apache.jena.rdf.model.Resource property) Removes the specified super property (predicate isrdfs:subPropertyOf
), including the corresponding statement's annotations.default OntObjectProperty
setAsymmetric
(boolean asymmetric) Adds or removes theP rdf:type owl:AsymmetricProperty
statement depending on the given flag and returns this property to allow cascading calls.default OntObjectProperty
setFunctional
(boolean functional) Adds or removesowl:FunctionalProperty
declaration for this property according to the given boolean flag.default OntObjectProperty
setInverseFunctional
(boolean inverseFunctional) Adds or removes theP rdf:type owl:InverseFunctionalProperty
statement depending on the given flag and returns this property to allow cascading calls.default OntObjectProperty
setIrreflexive
(boolean irreflexive) Adds or removes theP rdf:type owl:IrreflexiveProperty
statement depending on the given flag and returns this property to allow cascading calls.default OntObjectProperty
setReflexive
(boolean reflexive) Adds or removes theP rdf:type owl:ReflexiveProperty
statement depending on the given flag and returns this property to allow cascading calls.default OntObjectProperty
setSymmetric
(boolean symmetric) Adds or removes theP rdf:type owl:SymmetricProperty
statement depending on the given flag and returns this property to allow cascading calls.default OntObjectProperty
setTransitive
(boolean transitive) Adds or removes theP rdf:type owl:TransitiveProperty
statement depending on the given flag and returns this property to allow cascading calls.default Stream<OntObjectProperty>
Lists all the properties that are declared to be sub-properties of this property (directly or indirectly).subProperties
(boolean direct) Answers aStream
over all the properties that are declared to be sub-properties of this property.default Stream<OntObjectProperty>
Lists all the properties that are declared to be super-properties of this property (directly or indirectly).superProperties
(boolean direct) Answers aStream
over all the properties that are declared to be super-properties of this property.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.ontapi.model.OntProperty
addDomainStatement, addRangeStatement, addSubPropertyOfStatement, asProperty, declaringClasses, hasSubProperty, hasSuperProperty
Methods inherited from interface org.apache.jena.ontapi.model.OntRelationalProperty
addFunctionalDeclaration, domains, domains, isFunctional, referringRestrictions
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
-
subProperties
Answers aStream
over all the properties that are declared to be sub-properties of this property. Each element of theStream
will have the same type as this property instance: if it is datatype property the method will return only data properties, etc. The parameterdirect
controls selectivity over the properties that appear in theStream
. Consider the following scenario:
(so:D rdfs:subPropertyOf :C . :C rdfs:subPropertyOf :A . :B rdfs:subPropertyOf :A .
A
has two sub-properties,B
andC
, andC
has sub-propertyD
) In a raw model, with no inference support, listing the sub-property ofA
will answerB
andC
. In an inferencing model,rdfs:subPropertyOf
is known to be transitive, so the sub-properties iterator will includeD
. Thedirect
sub-properties are those members of the closure of the subPropertyOf relation, restricted to properties that cannot be reached by a longer route, i.e., the ones that are directly adjacent to the given root. Thus, the direct sub-properties ofA
areB
andC
only, and notD
- even in an inferencing graph. Note that this is different from the entailments from the raw graph. Suppose we add to this example:
Now, in the raw graph,:D rdfs:subPropertyOf :A.
A
has sub-propertyC
. But the direct sub-properties ofA
remainB
andC
, since there is a longer pathA-C-D
that means thatD
is not a direct sub-property ofA
. The assertion in the raw graph thatA
has sub-propertyD
is essentially redundant, since this can be inferred from the closure of the graph.- Specified by:
subProperties
in interfaceOntProperty
- Specified by:
subProperties
in interfaceOntRelationalProperty
- Parameters:
direct
-boolean
iftrue
answers the directly adjacent properties in the sub-property relation: i.e., eliminate any properties for which there is a longer route to reach that parent under the sub-property relation- Returns:
- distinct
Stream
of object property expressions - See Also:
-
superProperties
Answers aStream
over all the properties that are declared to be super-properties of this property. Each element of theStream
will have the same type as this property instance: if it is datatype property the method will return only data properties, etc. The parameterdirect
controls selectivity over the properties that appear in theStream
. Consider the following scenario:
(so:A rdfs:subPropertyOf :B . :A rdfs:subPropertyOf :C . :C rdfs:subPropertyOf :D .
A
has super-propertyB
andC
, andC
has super-propertyD
) In a raw model, with no inference support, listing the super-property ofA
will answerB
andC
. In an inferencing model,rdfs:subPropertyOf
is known to be transitive, so the super-property iterator will includeD
. Thedirect
super-properties are those members of the closure of the inverse-subPropertyOf relation, restricted to properties that cannot be reached by a longer route, i.e., the ones that are directly adjacent to the given root. Thus, the direct super-property ofA
areB
andC
only, and notD
- even in an inferencing graph. Note that this is different from the entailments from the raw graph. Suppose we add to this example:
Now, in the raw graph,:A rdfs:subPropertyOf :D .
A
has super-propertyB
,C
,D
. But the direct super-property ofA
remain onlyB
and C, since there is a longer pathA-C-D
that means thatD
is not a direct super-property ofA
. The assertion in the raw graph thatA
has super-propertyD
is essentially redundant, since this can be inferred from the closure of the graph.- Specified by:
superProperties
in interfaceOntProperty
- Specified by:
superProperties
in interfaceOntRelationalProperty
- Parameters:
direct
-boolean
: iftrue
answers the directly adjacent properties in the super-property relation, i.e., eliminate any property for which there is a longer route to reach that parent under the super-property relation- Returns:
- distinct
Stream
of object property expressions - See Also:
-
propertyChains
Stream<OntList<OntObjectProperty>> propertyChains()Returns aStream
over all property chainontology list
s that are attached to this Object Property Expression on the predicateowl:propertyChainAxiom
.- Returns:
Stream
ofOntList
s with generic-parameterOntOPE
-
addNegativeAssertion
OntNegativeAssertion.WithObjectProperty addNegativeAssertion(OntIndividual source, OntIndividual target) Adds a negative property assertion ontology object.- Parameters:
source
-OntIndividual
target
-OntIndividual
- Returns:
OntNegativeAssertion.WithObjectProperty
- See Also:
-
createPropertyChain
Creates a property chain logical constructions as aontology []-list
ofObject Property Expression
s that is attached to this Object Property Expression at object positions with the predicateowl:propertyChainAxiom
. The resulting rdf-list will consist of all the elements of the specified collection in the given order with the possibility of duplication. Note: Anynull
s in a collection will causeexception
.- Parameters:
properties
-Collection
(preferablyList
) ofobject property expression
s- Returns:
OntList
ofOntObjectProperty
s- See Also:
-
removePropertyChain
OntObjectProperty removePropertyChain(org.apache.jena.rdf.model.Resource list) throws OntJenaException Deletes the given property chain list including all its annotations.- Parameters:
list
-Resource
can beOntList
orRDFList
- Returns:
- this instance to allow cascading calls
- Throws:
OntJenaException
- if in the whole graph, there is no property chain with the specified []-list- See Also:
-
asNamed
-
ranges
Returns all ranges. The statement pattern isP rdfs:range C
, whereP
is this object property, andC
is one of the return class expressions.- Specified by:
ranges
in interfaceOntProperty
- Specified by:
ranges
in interfaceOntRelationalProperty
- Returns:
Stream
ofOntClass
s- See Also:
-
ranges
Gets all direct or indirect ranges that present in RDF graph. Indirect ranges are calculated usingOntClass.subClasses(true)
relationship. For example, consider the following statements (if someone has some dog, then this dog is a Dog)::Dog rdf:type owl:Class . :Labrador rdf:type owl:Class . :Labrador rdfs:subClassOf :Dog . :hasDog rdf:type owl:ObjectProperty . :hasDog rdfs:range :Dog .
:hasDog rdfs:domain :Labrador .
- Parameters:
direct
-boolean
- Returns:
Stream
ofOntClass
es, distinct
-
subProperties
Lists all the properties that are declared to be sub-properties of this property (directly or indirectly). Note: the return elements have the same type as this instance.Equivalent to
this.subProperties(false)
.The pattern is
Pi rdfs:subPropertyOf Pj
wherePi, Pj
are object properties.- Specified by:
subProperties
in interfaceOntProperty
- Specified by:
subProperties
in interfaceOntRelationalProperty
- Returns:
Stream
ofOntObjectProperty
s- See Also:
-
superProperties
Lists all the properties that are declared to be super-properties of this property (directly or indirectly). Note: the return elements have the same type as this instance.Equivalent to
this.superProperties(false)
.The pattern is
Pi rdfs:subPropertyOf Pj
wherePi, Pj
are object properties.- Specified by:
superProperties
in interfaceOntProperty
- Specified by:
superProperties
in interfaceOntRelationalProperty
- Returns:
Stream
ofOntObjectProperty
s- See Also:
-
disjoints
Lists allOntDisjoint
sections where this object property is a member.- Returns:
- a
Stream
ofOntDisjoint.ObjectProperties
-
disjointProperties
Returns disjoint properties (statement:P1 owl:propertyDisjointWith P2
).- Specified by:
disjointProperties
in interfaceOntRelationalProperty
- Returns:
Stream
ofOntObjectProperty
s- See Also:
-
equivalentProperties
Returns all equivalent object properties (i.e.Pi owl:equivalentProperty Pj
, wherePi
- this property).- Specified by:
equivalentProperties
in interfaceOntRelationalProperty
- Returns:
Stream
ofOntObjectProperty
s.- See Also:
-
inverseProperties
Lists all object properties from the right part of the statement_:this owl:inverseOf P
. Please note: the return list items are not required to beInverse Object Property Expression
s.- Returns:
Stream
ofOntObjectProperty
s (eitherOntObjectProperty.Inverse
orOntObjectProperty.Named
)- See Also:
-
negativeAssertions
Returns all associated negative object property assertions.- Specified by:
negativeAssertions
in interfaceOntRelationalProperty
- Returns:
Stream
ofOntNegativeAssertion.WithObjectProperty
s- See Also:
-
negativeAssertions
Returns all associated negative object property assertions for the specified source individual.- Parameters:
source
-OntIndividual
- Returns:
Stream
ofOntNegativeAssertion.WithObjectProperty
s- See Also:
-
findPropertyChain
default Optional<OntList<OntObjectProperty>> findPropertyChain(org.apache.jena.rdf.model.RDFNode list) Finds the firstPropertyChain
logical construction attached to this property for the specified []-list as an object.- Parameters:
list
-RDFNode
- Returns:
Optional
around theontology []-list
withobject property expression
s as items
-
clearPropertyChains
Deletes all property chain lists including their annotations.- Returns:
- this instance to allow cascading calls
- See Also:
-
fromPropertyChain
Lists all members from the right part of statementP owl:propertyChainAxiom ( P1 ... Pn )
, whereP
is this property. Note: the result ignores repetitions, e.g., forSubObjectPropertyOf( ObjectPropertyChain( :hasParent :hasParent ) :hasGrandparent )
, it returns only:hasParent
property.- Returns:
- distinct
Stream
of all sub-object properties
, possible empty in case of nil-list or if there is no property-chains at all - See Also:
-
addPropertyChainAxiomStatement
Creates a property chainontology list
and returns the statementP owl:propertyChainAxiom ( P1 ... Pn )
to allow the addition of annotations. See RDF Graph annotation specification, for example, 2.3.1 Axioms that Generate a Main Triple.- Parameters:
properties
- Array ofOntObjectProperty
s withoutnull
s- Returns:
OntStatement
to provide the ability to add annotations subsequently- See Also:
-
addPropertyChainAxiomStatement
Adds a new sub-property-of chain statement.- Parameters:
properties
- Collection ofOntObjectProperty
s- Returns:
OntStatement
(i.e._:this owl:propertyChainAxiom ( ... )
) to provide the ability to add annotations subsequently- See Also:
-
addInverseFunctionalDeclaration
Creates theP rdf:type owl:InverseFunctionalProperty
property declaration statement, whereP
is this property.- Returns:
OntStatement
to allow the subsequent addition of annotations- See Also:
-
addTransitiveDeclaration
Creates theP rdf:type owl:TransitiveProperty
property declaration statement, whereP
is this property.- Returns:
OntStatement
to allow the subsequent addition of annotations- See Also:
-
addSymmetricDeclaration
Creates theP rdf:type owl:SymmetricProperty
property declaration statement, whereP
is this property.- Returns:
OntStatement
to allow the subsequent addition of annotations- See Also:
-
addAsymmetricDeclaration
Creates theP rdf:type owl:AsymmetricProperty
property declaration statement, whereP
is this property.- Returns:
OntStatement
to allow the subsequent addition of annotations- See Also:
-
addReflexiveDeclaration
Creates theP rdf:type owl:ReflexiveProperty
property declaration statement, whereP
is this property.- Returns:
OntStatement
to allow the subsequent addition of annotations- See Also:
-
addIrreflexiveDeclaration
Creates theP rdf:type owl:IrreflexiveProperty
property declaration statement, whereP
is this property.- Returns:
OntStatement
to allow the subsequent addition of annotations- See Also:
-
addInverseOfStatement
Adds a new inverse-of statement.- Parameters:
other
-OntObjectProperty
, notnull
- Returns:
OntStatement
to allow subsequent annotations adding- See Also:
-
addEquivalentPropertyStatement
Creates and returns a newowl:equivalentProperty
statement with the given property as an object and this property as a subject.- Parameters:
other
-OntObjectProperty
, notnull
- Returns:
OntStatement
to allow subsequent annotations adding- See Also:
-
addPropertyDisjointWithStatement
Adds a disjoint object property (i.e., the_:this owl:propertyDisjointWith @other
statement).- Parameters:
other
-OntObjectProperty
, notnull
- Returns:
OntStatement
to allow subsequent annotations adding- See Also:
-
addSuperProperty
Adds the given property as super property returning this property itself.- Parameters:
property
-OntObjectProperty
, notnull
- Returns:
- this instance to allow cascading calls
- See Also:
-
addSubProperty
Adds the given property as sub property returning this property itself.- Parameters:
property
-OntObjectProperty
, notnull
- Returns:
- this instance to allow cascading calls
- See Also:
-
addRange
Adds a statement with theRDFS.range
as predicate and the specifiedclass expression
as an object.- Parameters:
range
-OntClass
, notnull
- Returns:
- this instance to allow cascading calls
- See Also:
-
addDomain
Adds a statement with theRDFS.domain
as predicate and the specifiedclass expression
as an object.- Specified by:
addDomain
in interfaceOntRelationalProperty
- Parameters:
ce
-OntClass
, notnull
- Returns:
- this instance to allow cascading calls
- See Also:
-
addEquivalentProperty
Adds a newowl:equivalentProperty
statement.- Parameters:
other
-OntObjectProperty
, notnull
- Returns:
- this instance to allow cascading calls
- See Also:
-
addDisjointProperty
Adds a newowl:propertyDisjointWith
statement for this and the specified property.- Parameters:
other
-OntDataProperty
, notnull
- Returns:
OntDataProperty
this instance to allow cascading calls- See Also:
-
addInverseProperty
Adds a new inverse-of a statement, returns this property instance.- Parameters:
other
-OntObjectProperty
, notnull
- Returns:
- this instance to allow cascading calls
- See Also:
-
addPropertyChain
Adds a new sub-property-of a chain statement and returns this object itself. Note: the method saves a collection order with possible duplicates.- Parameters:
properties
- anArray
ofobject properties
- Returns:
- this instance to allow cascading calls
- See Also:
-
addPropertyChain
Adds a new sub-property-of a chain statement and returns this object itself. Note: the method saves a collection order with possible duplicates.- Parameters:
properties
- aCollection
ofobject properties
- Returns:
- this instance to allow cascading calls
- See Also:
-
removeSuperProperty
Removes the specified super property (predicate isrdfs:subPropertyOf
), including the corresponding statement's annotations. No-op in case no such super-property is found. Ifnull
is specified, the method removes all triples with predicaterdfs:subPropertyOf
and this property as a subject.- Specified by:
removeSuperProperty
in interfaceOntProperty
- Specified by:
removeSuperProperty
in interfaceOntRelationalProperty
- Parameters:
property
-Resource
ornull
to remove all direct super properties- Returns:
- this instance to allow cascading calls
-
removeSubProperty
Removes the specified sub property (predicate isrdfs:subPropertyOf
), including the corresponding statement's annotations. No-op in case no such super-property is found. Ifnull
is specified, the method removes all triples with predicaterdfs:subPropertyOf
and this property as an object.- Specified by:
removeSubProperty
in interfaceOntProperty
- Parameters:
property
-Resource
ornull
to remove all direct super properties- Returns:
- this instance to allow cascading calls
-
removeEquivalentProperty
Removes the equivalent property statement (a statement with the predicateowl:equivalentProperty
) for the specified resource (considered as an object), including the corresponding statement's annotations. No-op in case no such equivalent property relationship is found. Removes all triples with predicateowl:equivalentProperty
(and all theirs annotation triples) ifnull
is given.- Specified by:
removeEquivalentProperty
in interfaceOntRelationalProperty
- Parameters:
property
-Resource
ornull
to remove all equivalent properties- Returns:
- this instance to allow cascading calls
-
removeDisjointProperty
Removes theowl:propertyDisjointWith
statement (a statement with the predicateowl:propertyDisjointWith
) for the specified resource (considered as an object), including the corresponding statement's annotations. No-op in case no such disjoint property relationship is found. Removes all triples with predicateowl:propertyDisjointWith
(and all theirs annotation triples) ifnull
is given.- Specified by:
removeDisjointProperty
in interfaceOntRelationalProperty
- Parameters:
property
-Resource
ornull
to remove all disjoint properties- Returns:
- this instance to allow cascading calls
- See Also:
-
removeDomain
Removes the specified domain resource (predicate isrdfs:domain
), including the corresponding statement's annotations. No-op in case no such domain is found. Removes all domains ifnull
is specified.- Specified by:
removeDomain
in interfaceOntProperty
- Specified by:
removeDomain
in interfaceOntRelationalProperty
- Parameters:
domain
-Resource
, ornull
to remove all domains- Returns:
- this instance to allow cascading calls
-
removeRange
Removes the specified range resource (predicate isrdfs:range
), including the corresponding statement's annotations. No-op in case no such range is found. Removes all ranges ifnull
is specified.- Specified by:
removeRange
in interfaceOntProperty
- Specified by:
removeRange
in interfaceOntRelationalProperty
- Parameters:
range
-Resource
, ornull
to remove all ranges- Returns:
- this instance to allow cascading calls
-
removeInverseProperty
Removes the statement with the predicateowl:inverseOf
and the given object property as an object. If the argument isnull
, allowl:inverseOf
statements will be removed for this object property. No-op in case there is noowl:inverseOf
statements.- Parameters:
other
-OntObjectProperty
ornull
to remove allowl:inverseOf
statements- Returns:
- this instance to allow cascading calls
- See Also:
-
setFunctional
Adds or removesowl:FunctionalProperty
declaration for this property according to the given boolean flag. Note: the statement is removed along with all its annotations.- Specified by:
setFunctional
in interfaceOntRelationalProperty
- Parameters:
functional
-true
if should be functional- Returns:
- this instance to allow cascading calls
- See Also:
-
inverseProperty
Finds the first object property from the right part of the statements_:x owl:inverseOf PN
orP1 owl:inverseOf P2
. Here_:x
is an anonymous object property expression (i.e.Inverse Object Property
),PN
is anamed object property
andP1
,P2
are any object property expressions. What exactly is the first statement is defined at the level of model; in general, it is unpredictable.- Returns:
Optional
ofOntObjectProperty
- See Also:
-
isInverseFunctional
default boolean isInverseFunctional()- Returns:
true
iff it is an inverse functional property
-
setInverseFunctional
Adds or removes theP rdf:type owl:InverseFunctionalProperty
statement depending on the given flag and returns this property to allow cascading calls. Note: the statement is removed along with all its annotations.- Parameters:
inverseFunctional
- iftrue
the property must be inverse-functional- Returns:
- this instance to allow cascading calls
- See Also:
-
isTransitive
default boolean isTransitive()- Returns:
true
iff it is a transitive property
-
setTransitive
Adds or removes theP rdf:type owl:TransitiveProperty
statement depending on the given flag and returns this property to allow cascading calls. Note: the statement is removed along with all its annotations.- Parameters:
transitive
- iftrue
the property must be transitive- Returns:
- this instance to allow cascading calls
- See Also:
-
isSymmetric
default boolean isSymmetric()- Returns:
true
iff it is a symmetric property
-
setSymmetric
Adds or removes theP rdf:type owl:SymmetricProperty
statement depending on the given flag and returns this property to allow cascading calls. Note: the statement is removed along with all its annotations.- Parameters:
symmetric
- iftrue
the property must be symmetric- Returns:
- this instance to allow cascading calls
- See Also:
-
isAsymmetric
default boolean isAsymmetric()- Returns:
true
iff it is an asymmetric property
-
setAsymmetric
Adds or removes theP rdf:type owl:AsymmetricProperty
statement depending on the given flag and returns this property to allow cascading calls. Note: the statement is removed along with all its annotations.- Parameters:
asymmetric
- iftrue
the property must be asymmetric- Returns:
- this instance to allow cascading calls
- See Also:
-
isReflexive
default boolean isReflexive()- Returns:
true
iff it is a reflexive property
-
setReflexive
Adds or removes theP rdf:type owl:ReflexiveProperty
statement depending on the given flag and returns this property to allow cascading calls. Note: the statement is removed along with all its annotations.- Parameters:
reflexive
- iftrue
the property must be reflexive- Returns:
- this instance to allow cascading calls
- See Also:
-
isIrreflexive
default boolean isIrreflexive()- Returns:
true
iff it is an irreflexive property
-
setIrreflexive
Adds or removes theP rdf:type owl:IrreflexiveProperty
statement depending on the given flag and returns this property to allow cascading calls. Note: the statement is removed along with all its annotations.- Parameters:
irreflexive
- iftrue
the property must be irreflexive- Returns:
- this instance to allow cascading calls
- 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)
-