- All Superinterfaces:
org.apache.jena.graph.FrontsNode
,OntClass
,OntEntity
,OntObject
,org.apache.jena.rdf.model.RDFNode
,org.apache.jena.rdf.model.Resource
- All Known Implementing Classes:
OntSimpleClassImpl.NamedImpl
,OntSimpleClassImpl.RLNamedImpl
- Enclosing interface:
- OntClass
An OWL Class
Entity
, a named class expression.
This is an analogue of OntClass
, but for OWL2.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.jena.ontapi.model.OntClass
OntClass.CardinalityRestriction<O extends OntObject,
P extends OntRelationalProperty>, OntClass.CollectionOf<O extends OntObject>, OntClass.ComplementOf, OntClass.ComponentRestriction<O extends org.apache.jena.rdf.model.RDFNode, P extends OntRelationalProperty>, 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 extends OntObject, P extends OntRelationalProperty>, OntClass.ObjectAllValuesFrom, OntClass.ObjectCardinality, OntClass.ObjectHasValue, OntClass.ObjectMaxCardinality, OntClass.ObjectMinCardinality, OntClass.ObjectSomeValuesFrom, OntClass.OneOf, OntClass.Restriction, OntClass.UnaryRestriction<P extends OntRelationalProperty>, OntClass.UnionOf, OntClass.ValueRestriction<O extends org.apache.jena.rdf.model.RDFNode, P extends OntRelationalProperty> -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptiondefault OntClass.Named
addComment
(String txt) Creates_:this rdfs:comment "txt"^^xsd:string
statement.default OntClass.Named
addComment
(String txt, String lang) Adds the given localized text annotation with builtinrdfs:comment
predicate.default OntClass.Named
addDisjointClass
(OntClass other) Adds the given class as a disjoint class and returns this class expression instance to allow cascading calls.default OntClass.Named
addDisjointUnion
(Collection<OntClass> classes) default OntClass.Named
addDisjointUnion
(OntClass... classes) default OntStatement
addDisjointUnionOfStatement
(Collection<OntClass> classes) Creates a disjoint-union section returning its root statement to allow adding annotations.default OntStatement
addDisjointUnionOfStatement
(OntClass... classes) Creates aDisjointUnion
ontology list
and returns the statementCN owl:disjointUnionOf ( C1 ... Cn )
to allow the addition of annotations.default OntClass.Named
addEquivalentClass
(OntClass other) Adds a new equivalent class.default OntClass.Named
addHasKey
(Collection<OntObjectProperty> objectProperties, Collection<OntDataProperty> dataProperties) Creates anowl:hasKey
statement returning this class to allow cascading calls.default OntClass.Named
addHasKey
(OntRelationalProperty... properties) Creates anowl:hasKey
statement returning this class to allow cascading calls.default OntClass.Named
Creates_:this rdfs:label "txt"^^xsd:string
statement.default OntClass.Named
Adds the given localized text annotation with builtinrdfs:label
predicate.default OntClass.Named
addSubClass
(OntClass other) Adds the given class as a subclass and returns this class expression instance to allow cascading calls.default OntClass.Named
addSuperClass
(OntClass other) Adds the given class as a superclass and returns this class expression instance to allow cascading calls.default OntClass.Named
annotate
(OntAnnotationProperty predicate, String txt, String lang) Adds a language-tagged text for this object and the givenpredicate
default OntClass.Named
annotate
(OntAnnotationProperty predicate, org.apache.jena.rdf.model.RDFNode value) Annotates the object with the givenpredicate
andvalue
.default OntClass.Named
Deletes allDisjointUnion
[]-lists including their annotations, i.e., all those statements with the predicateowl:disjointUnionOf
for which this resource is a subject.default OntClass.Named
Deletes allHasKey
[]-list including its annotations, i.e., all those statements with the predicateowl:hasKey
for which this resource is a subject.createDisjointUnion
(Collection<OntClass> classes) Creates aDisjointUnion
asontology []-list
ofClass Expression
s that is attached to this OWL Class using the predicateowl:disjointUnionOf
.Lists allDisjointUnion
ontology list
s that are attached to this OWL Class on predicateowl:disjointUnionOf
.findDisjointUnion
(org.apache.jena.rdf.model.RDFNode list) Finds aDisjointUnion
logical construction attached to this class by the specified rdf-node in the form ofOntList
.Returns all class expressions from the right part of the statement with this class as a subject andowl:disjointUnionOf
as a predicate (the triple pattern:CN owl:disjointUnionOf ( C1 ... Cn )
).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
isLocal()
Determines if this Ontology Resource is locally defined.default OntClass.Named
removeDisjointClass
(org.apache.jena.rdf.model.Resource other) Removes the specified disjoint class resource.removeDisjointUnion
(org.apache.jena.rdf.model.Resource list) Deletes the givenDisjointUnion
list including its annotations.default OntClass.Named
removeEquivalentClass
(org.apache.jena.rdf.model.Resource other) Removes the given equivalent class resource including the statement's annotations.default OntClass.Named
removeSuperClass
(org.apache.jena.rdf.model.Resource other) Removes a superclass relationship for the given resource including all possible annotations.Methods inherited from interface org.apache.jena.graph.FrontsNode
asNode
Methods inherited from interface org.apache.jena.ontapi.model.OntClass
addDisjointWithStatement, addEquivalentClassStatement, addHasKeyStatement, addHasKeyStatement, addSubClassOfStatement, asAssertionClass, asDisjointClass, asEquivalentClass, asNamed, asSubClass, asSuperClass, canAsAssertionClass, canAsDisjointClass, canAsEquivalentClass, canAsSubClass, canAsSuperClass, createHasKey, createIndividual, createIndividual, declaredProperties, declaredProperties, disjointClasses, disjoints, equivalentClasses, findHasKey, fromHasKey, hasDeclaredProperty, hasKeys, hasSubClass, hasSuperClass, individuals, individuals, isDisjoint, isHierarchyRoot, properties, removeHasKey, removeIndividual, removeSubClass, subClass, subClasses, subClasses, superClass, superClasses, superClasses
Methods inherited from interface org.apache.jena.ontapi.model.OntObject
addAnnotation, addAnnotation, addAnnotation, addStatement, 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
-
disjointUnions
Lists allDisjointUnion
ontology list
s that are attached to this OWL Class on predicateowl:disjointUnionOf
.- Returns:
Stream
ofOntList
s with parameter-typeOntCE
-
createDisjointUnion
Creates aDisjointUnion
asontology []-list
ofClass Expression
s that is attached to this OWL Class using the predicateowl:disjointUnionOf
. 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 aboutDisjointUnion
logical construction see 9.1.4 Disjoint Union of Class Expressions.- Parameters:
classes
-Collection
(preferablySet
) ofclass expression
s- Returns:
OntList
ofOntClass
s- See Also:
-
removeDisjointUnion
Deletes the givenDisjointUnion
list including its annotations.- Parameters:
list
-Resource
can beOntList
orRDFList
- Returns:
- this instance to allow cascading calls
- Throws:
OntJenaException
- if the list is not found- See Also:
-
findDisjointUnion
Finds aDisjointUnion
logical construction attached to this class by the specified rdf-node in the form ofOntList
.- Parameters:
list
-RDFNode
- Returns:
Optional
aroundOntList
ofclass expression
s
-
addDisjointUnionOfStatement
Creates aDisjointUnion
ontology list
and returns the statementCN owl:disjointUnionOf ( C1 ... Cn )
to allow the addition of annotations. About RDF Graph annotation specification see, for example, 2.3.1 Axioms that Generate a Main Triple.- Parameters:
classes
- Array ofclass expressions
withoutnull
s, duplicates will be discarded and order will be saved- Returns:
OntStatement
to allow the subsequent annotations addition- See Also:
-
addDisjointUnionOfStatement
Creates a disjoint-union section returning its root statement to allow adding annotations. The triple pattern:CN owl:disjointUnionOf ( C1 ... Cn )
.- Parameters:
classes
- a collection ofclass expression
s withoutnull
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.- Specified by:
addSuperClass
in interfaceOntClass
- 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.- Specified by:
addSubClass
in interfaceOntClass
- Parameters:
other
-OntClass
, notnull
- Returns:
- this instance to allow cascading calls
- See Also:
-
addEquivalentClass
Adds a new equivalent class.- Specified by:
addEquivalentClass
in interfaceOntClass
- Parameters:
other
-OntClass
, notnull
- Returns:
- this instance to allow cascading calls
- See Also:
-
addHasKey
default OntClass.Named addHasKey(Collection<OntObjectProperty> objectProperties, Collection<OntDataProperty> dataProperties) Creates anowl:hasKey
statement returning this class to allow cascading calls.- Specified by:
addHasKey
in interfaceOntClass
- 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.- Specified by:
addHasKey
in interfaceOntClass
- Parameters:
properties
- Array ofOntRelationalProperty
s withoutnull
s- Returns:
- this instance to allow cascading calls
- See Also:
-
addDisjointUnion
- Parameters:
classes
- a collection ofclass expression
s withoutnull
s- Returns:
- this instance to allow cascading calls
-
addDisjointUnion
- Parameters:
classes
- Array ofclass expressions
withoutnull
s, duplicates will be discarded and order will be saved- Returns:
- this instance to allow cascading calls
-
addDisjointClass
Adds the given class as a disjoint class and returns this class expression instance to allow cascading calls.- Specified by:
addDisjointClass
in interfaceOntClass
- Parameters:
other
-OntClass
, notnull
- Returns:
- this instance to allow cascading calls
- See Also:
-
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.- Specified by:
removeSuperClass
in interfaceOntClass
- 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.- Specified by:
removeDisjointClass
in interfaceOntClass
- 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.- Specified by:
removeEquivalentClass
in interfaceOntClass
- 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.- Specified by:
clearHasKeys
in interfaceOntClass
- Returns:
- this instance to allow cascading calls
-
clearDisjointUnions
Deletes allDisjointUnion
[]-lists including their annotations, i.e., all those statements with the predicateowl:disjointUnionOf
for which this resource is a subject.- Returns:
- this instance to allow cascading calls
- See Also:
-
fromDisjointUnionOf
Returns all class expressions from the right part of the statement with this class as a subject andowl:disjointUnionOf
as a predicate (the triple pattern:CN owl:disjointUnionOf ( C1 ... Cn )
). If there are several []-lists in the model that satisfy these conditions, all their content will be merged into the one distinct stream.- Returns:
- distinct stream of
class expressions
s - See Also:
-
addComment
Creates_:this rdfs:comment "txt"^^xsd:string
statement.- Specified by:
addComment
in interfaceOntObject
- Parameters:
txt
- String, notnull
- Returns:
- this object to allow cascading calls
- See Also:
-
addComment
Adds the given localized text annotation with builtinrdfs:comment
predicate.- Specified by:
addComment
in interfaceOntObject
- Parameters:
txt
- String, the literal lexical form, notnull
lang
- String, the language tag, nullable- Returns:
- this object to allow cascading calls
- See Also:
-
addLabel
Creates_:this rdfs:label "txt"^^xsd:string
statement. -
addLabel
Adds the given localized text annotation with builtinrdfs:label
predicate. -
annotate
Adds a language-tagged text for this object and the givenpredicate
- Specified by:
annotate
in interfaceOntObject
- Parameters:
predicate
-OntAnnotationProperty
- named annotation property, notnull
txt
- String, the literal lexical form, cannot benull
lang
- String, the language tag, can benull
- Returns:
- this object to allow cascading calls
-
annotate
default OntClass.Named annotate(OntAnnotationProperty predicate, org.apache.jena.rdf.model.RDFNode value) Annotates the object with the givenpredicate
andvalue
.- Specified by:
annotate
in interfaceOntObject
- Parameters:
predicate
-OntAnnotationProperty
- named annotation property, notnull
value
-RDFNode
- the value: uri-resource, literal or anonymous individual, notnull
- Returns:
- this object 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)
-