- 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
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceOntClass.CardinalityRestriction<O extends OntObject,P extends OntRelationalProperty> An abstraction for Cardinality Restrictions.static interfaceOntClass.CollectionOf<O extends OntObject>An abstract class expression that unites class expressions consisting of multiple components.static interfacestatic interfaceOntClass.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 interfacestatic interfacestatic interfacestatic interfacestatic interfacestatic interfacestatic interfacestatic interfacestatic interfaceDescribes Boolean Connectives and Enumeration of Individuals (OntClass.ComplementOf,OntClass.UnionOf,OntClass.IntersectionOfandOntClass.OneOf).static interfaceAn Ontology ClassEntity, a named class expression.static interfacestatic interfacestatic interfaceOntClass.NaryRestriction<O extends OntObject,P extends OntRelationalProperty> An abstraction that unites allRestrictions with the predicateowl:onProperties.static interfacestatic interfacestatic interfacestatic interfacestatic interfacestatic interfacestatic interfacestatic interfaceA supertype for all class expressions with the typeOWL2.Restriction.static interfaceAn abstract class expression that unites allRestrictions with the predicateowl:onProperty.static interfacestatic interfaceOntClass.ValueRestriction<O extends org.apache.jena.rdf.model.RDFNode,P extends OntRelationalProperty> An abstract for *Value*Restrictions (e.g. -
Method Summary
Modifier and TypeMethodDescriptiondefault OntClassaddDisjointClass(OntClass other) Adds the given class as a disjoint class and returns this class expression instance to allow cascading calls.default OntStatementaddDisjointWithStatement(OntClass other) Adds the given class as a disjoint class and returns the corresponding statement to provide the ability to add annotations.default OntClassaddEquivalentClass(OntClass other) Adds a new equivalent class.default OntStatementAdds the given class as an equivalent class and returns the corresponding statement to provide the ability to add annotations.default OntClassaddHasKey(Collection<OntObjectProperty> objectProperties, Collection<OntDataProperty> dataProperties) Creates anowl:hasKeystatement returning this class to allow cascading calls.default OntClassaddHasKey(OntRelationalProperty... properties) Creates anowl:hasKeystatement returning this class to allow cascading calls.default OntStatementaddHasKeyStatement(Collection<OntObjectProperty> objectProperties, Collection<OntDataProperty> dataProperties) Creates anowl:hasKeystatement returning the root statement to allow the subsequent annotations adding.addHasKeyStatement(OntRelationalProperty... properties) Creates aHasKeylogical construction asontology listand returns the statementC owl:hasKey ( P1 ... Pm R1 ... Rn )to allow the subsequent addition of annotations.default OntClassaddSubClass(OntClass other) Adds the given class as a subclass and returns this class expression instance to allow cascading calls.default OntStatementaddSubClassOfStatement(OntClass other) Adds the given class as a superclass and returns the corresponding statement to provide the ability to add annotations.default OntClassaddSuperClass(OntClass other) Adds the given class as a superclass and returns this class expression instance to allow cascading calls.default OntClassReturns the assertion-view of this class if the specification allows this class to make class assertions, otherwise throws exception.default OntClassReturns 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 OntClassReturns 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.NamedasNamed()Represents this OWL class expression as a named OWL class if it is possible, otherwise throws an exception.default OntClassReturns the subclass-view of this class if the specification allows this class to be in subclass position, otherwise throws exception.default OntClassReturns the superclass-view of this class if the specification allows this class to be in superclass position, otherwise throws exception.default booleanAnswers if this class can be an object in class-assertion statement (a type of individual).default booleanAnswers if this class can be disjoint with another class.default booleanAnswers if this class can be an equivalent of another class.default booleanAnswers if this class can be a subclass of another class.default booleanAnswers if this class can be a superclass of another class.default OntClassDeletes allHasKey[]-list including its annotations, i.e., all those statements with the predicateowl:hasKeyfor which this resource is a subject.createHasKey(Collection<OntObjectProperty> objectProperties, Collection<OntDataProperty> dataProperties) Creates aHasKeylogical construction asontology []-listofObject or Data Property Expressions 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 aStreamover thepropertiesassociated with a frame-like view of this class.Returns disjoint class-objects.default Stream<OntDisjoint.Classes>Lists allOntDisjointsections where this class is a member.Lists all equivalent classes.default Optional<OntList<OntRelationalProperty>>findHasKey(org.apache.jena.rdf.model.RDFNode list) Finds aHasKeylogical 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 giventypeinterface, if it is possible.getModel()Returns the ontology model associated with this resource.booleanhasDeclaredProperty(OntProperty property, boolean direct) Returnstrueif the given property is associated with a frame-like view of this class.hasKeys()Lists allHasKeyontology []-lists that are attached to this class expression on predicateowl:hasKey.default booleanhasSubClass(OntClass clazz, boolean direct) Answerstrueif the given class is a subclass of this class.default booleanhasSuperClass(OntClass clazz, boolean direct) Answerstrueif 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.booleanisDisjoint(org.apache.jena.rdf.model.Resource candidate) Answerstrueif this class is disjoint with the given class.booleanAnswers true if this class is one of the roots of the local class hierarchy.booleanisLocal()Determines if this Ontology Resource is locally defined.default Stream<OntProperty>Lists all properties attached to this class in ardfs:domainstatement.default OntClassremoveDisjointClass(org.apache.jena.rdf.model.Resource other) Removes the specified disjoint class resource.default OntClassremoveEquivalentClass(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 givenHasKeylist including its annotations.default OntClassremoveIndividual(org.apache.jena.rdf.model.Resource individual) Removes the given individual from the set of instances that are members of this class.default OntClassremoveSubClass(org.apache.jena.rdf.model.Resource other) Removes a subclass relationship for the given resource including all possible annotations.default OntClassremoveSuperClass(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 aStreamover 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 aStreamover the class-expressions for which this class expression is declared a subclass.Methods inherited from interface org.apache.jena.graph.FrontsNode
asNodeMethods 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, typesMethods inherited from interface org.apache.jena.rdf.model.RDFNode
as, asLiteral, asResource, asStatementTerm, canAs, isAnon, isLiteral, isResource, isStatementTerm, isURIResource, visitWithMethods 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, getURI, hasLiteral, hasLiteral, hasLiteral, hasLiteral, hasLiteral, hasLiteral, hasProperty, hasProperty, hasProperty, hasProperty, hasURI, inModel, listProperties, listProperties, listProperties, removeAll, removeProperties, toString
-
Method Details
-
subClasses
Answers aStreamover all the class expressions that are declared to be subclasses of this class expression. The returnStreamis distinct and this instance is not included in it. The flagdirectallows 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.Ahas two subclasses,BandC, andChas subclassD) In a raw model, with no inference support, listing the subclasses ofAwill answerBandC. In an inferencing model,rdfs:subClassOfis known to be transitive, so the subclasses iterator will includeD. Thedirectsubclasses 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 ofAareBandConly, 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.Ahas subclassC. But the direct subclasses ofAremainBandC, since there is a longer pathA-C-Dthat means thatDis not a direct subclass ofA. The assertion in the raw graph thatAhas subclassDis essentially redundant, since this can be inferred from the closure of the graph.- Parameters:
direct-boolean- iftrueanswers 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; iffalseanswers all subclasses found by inferencer, which usually means entire hierarchy down the tree; this class is not included- Returns:
- distinct
Streamof subclass expressions - See Also:
-
superClasses
Answers aStreamover the class-expressions for which this class expression is declared a subclass. The returnStreamis distinct and this instance is not included in it.The flag
directallows 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 .Ahas superclassesBandC, andChas superclassD) In a raw model, with no inference support, listing the superclasses ofAwill answerBandC. In an inferencing model,rdfs:subClassOfis known to be transitive, so the superclasses iterator will includeD. Thedirectsuperclasses 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 ofAareBandConly, 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 .Ahas superclassesB,C,D. But the direct superclasses ofAremain onlyBand C, since there is a longer pathA-C-Dthat means thatDis not a direct superclass ofA. The assertion in the raw graph thatAhas superclassDis essentially redundant, since this can be inferred from the closure of the graph.- Parameters:
direct-boolean: iftrueanswers 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; iffalseanswers all superclasses found by inferencer, which usually means entire hierarchy up the tree; this class is not included- Returns:
- distinct
Streamof superclass expressions - See Also:
-
individuals
Lists all individuals, directly or indirectly connected to this class. The search pattern isa rdf:type C, whereCis class expression andaindividual.- Parameters:
direct-booleanif true, only direct instances are counted (i.e., not instances of subclasses of this class)- Returns:
- a
StreamofOntIndividuals
-
hasDeclaredProperty
Returnstrueif 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, notnulldirect-boolean: iftrueanalyses only the directly adjacent domains in the subclass relation, otherwise takes into account the class hierarchy- Returns:
boolean,trueif the property is associated with this class by its domain, otherwisefalse
-
declaredProperties
Returns aStreamover thepropertiesassociated 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'sOntModelwith the class itself. See: Apache Jena: Presenting RDF as frames for more details.- Parameters:
direct-boolean: iftrueanalyses only the directly adjacent domains in the subclass relation, otherwise takes into account the class hierarchy- Returns:
- a distinct
Streamofobject, 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:Thingorrdfs:Resourceas a direct superclass, or (ii) it has no declared superclasses.owl:Nothingcannot be root.- Returns:
trueif this class is the root of the class hierarchy in the model it is attached to
-
hasKeys
Stream<OntList<OntRelationalProperty>> hasKeys()Lists allHasKeyontology []-lists that are attached to this class expression on predicateowl:hasKey.- Returns:
StreamofOntLists 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 aHasKeylogical construction asontology []-listofObject or Data Property Expressions 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:nulls in the collection will causeexception. For additional information aboutHasKeylogical construction see 9.5 Keys specification.- Parameters:
objectProperties-Collection(preferablySet) ofobject property expressionsdataProperties-Collection(preferablySet) ofdata property expressions- Returns:
OntListofOntRelationalPropertys- See Also:
-
addHasKeyStatement
Creates aHasKeylogical construction asontology listand 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 ofOntRelationalPropertys withoutnulls- Returns:
OntStatementwith a possibility to annotate- See Also:
-
removeHasKey
Deletes the givenHasKeylist including its annotations.- Parameters:
list-Resourcecan beOntListorRDFList; ifnullthe method will remove all hasKey's- Returns:
- this instance to allow cascading calls
-
isDisjoint
boolean isDisjoint(org.apache.jena.rdf.model.Resource candidate) Answerstrueif this class is disjoint with the given class.- Parameters:
candidate-Resourcea class to test- Returns:
trueif this class is disjoint with the given class
-
disjointClasses
Returns disjoint class-objects. This includesthisClass owl:disjointWith otherClass,otherClass owl:disjointWith thisClassstatements andowl:AllDisjointClassesconstruct.- Returns:
- a
StreamofOntClasss - See Also:
-
equivalentClasses
Lists all equivalent classes. The statement patter to search for isC1 owl:equivalentClass C2.- Returns:
StreamofOntClasss- 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
StreamofOntIndividuals - See Also:
-
properties
Lists all properties attached to this class in ardfs:domainstatement. 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-Ris a data property,C- this class expressionP rdfs:domain C-Pis an object property expression,C- this class expressionA rdfs:domain U-Ais annotation property,Uis IRI (this class expression)
- Returns:
StreamofOntPropertys- See Also:
-
declaredProperties
Equivalent tothis.declaredProperties(false)- Returns:
- a distinct
Streamof (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:
StreamofOntClasss- 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:
StreamofOntClasss- 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
Answerstrueif the given class is a subclass of this class. SeesubClasses(boolean)for a full explanation of the direct parameter.- Parameters:
clazz- aOntClassto testdirect-boolean; If true, only search the classes that are directly adjacent to this class in the class hierarchy- Returns:
boolean
-
hasSuperClass
Answerstrueif the given class is a superclass of this class. SeesuperClasses(boolean)for a full explanation of the direct parameter- Parameters:
clazz- aOntClassto testdirect-boolean; If true, only search the classes that are directly adjacent to this class in the class hierarchy.- Returns:
boolean
-
disjoints
Lists allOntDisjointsections where this class is a member.- Returns:
- a
StreamofOntDisjoint.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:
OntStatementto 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:
OntStatementto 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:
OntStatementto allow the subsequent annotations addition- See Also:
-
addHasKeyStatement
default OntStatement addHasKeyStatement(Collection<OntObjectProperty> objectProperties, Collection<OntDataProperty> dataProperties) Creates anowl:hasKeystatement returning the root statement to allow the subsequent annotations adding.- Parameters:
objectProperties- the collection ofOntObjectPropertys, notnulland cannot containnullsdataProperties- the collection ofOntDataPropertys, notnulland cannot containnulls- Returns:
OntStatementto 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:hasKeystatement returning this class to allow cascading calls.- Parameters:
objectProperties- the collection ofOntObjectPropertysdataProperties- the collection ofOntDataPropertys- Returns:
- this instance to allow cascading calls
- See Also:
-
addHasKey
Creates anowl:hasKeystatement returning this class to allow cascading calls.- Parameters:
properties- Array ofOntRelationalPropertys withoutnulls- 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-Resourcea 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:subClassOfstatements with all their annotations in casenullis specified.- Parameters:
other-Resourceornullto remove allrdfs:subClassOfstatements- 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:subClassOfstatements with all their annotations in casenullis specified.- Parameters:
other-Resourceornullto remove allrdfs:subClassOfstatements- 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:disjointWithstatements with all their annotations in casenullis specified.- Parameters:
other-Resource, ornullto 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:equivalentClassstatements with all their annotations in casenullis specified.- Parameters:
other-Resource, ornullto 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:hasKeyfor which this resource is a subject.- Returns:
- this instance to allow cascading calls
- Throws:
OntJenaException- if the list is not found
-
findHasKey
Finds aHasKeylogical construction attached to this class expression by the specified rdf-node in the form ofOntList.- Parameters:
list-RDFNode- Returns:
OptionalaroundOntListofdata and object property expressions
-
fromHasKey
Lists all key properties. I.e., returns all object- and datatype-properties that belong to theC owl:hasKey ( P1 ... Pm R1 ... Rn )statements, whereCis this class expression,Piis a property expression, andRiis 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:
trueif 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:
OntClassornull- 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:
trueif 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:
OntClassornull- 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:
trueif 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:
OntClassornull- 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:
trueif 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:
OntClassornull- 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:
trueif 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:
getModelin 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:importsin OWL) and the resource is defined in one of them, than this method called from top-level interface will returnfalse.- Returns:
trueif this resource is local to the base model graph.
-
getAs
Safely converts this RDF resource to the giventypeinterface, 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
Xornull - See Also:
-
RDFNode.as(Class)RDFNode.canAs(Class)
-