- 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 Ontology Class
Entity, a named class expression.- 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.NamedaddComment(String txt) Creates_:this rdfs:comment "txt"^^xsd:stringstatement.default OntClass.NamedaddComment(String txt, String lang) Adds the given localized text annotation with builtinrdfs:commentpredicate.default OntClass.NamedaddDisjointClass(OntClass other) Adds the given class as a disjoint class and returns this class expression instance to allow cascading calls.default OntClass.NamedaddDisjointUnion(Collection<OntClass> classes) default OntClass.NamedaddDisjointUnion(OntClass... classes) default OntStatementaddDisjointUnionOfStatement(Collection<OntClass> classes) Creates a disjoint-union section returning its root statement to allow adding annotations.default OntStatementaddDisjointUnionOfStatement(OntClass... classes) Creates aDisjointUnionontology listand returns the statementCN owl:disjointUnionOf ( C1 ... Cn )to allow the addition of annotations.default OntClass.NamedaddEquivalentClass(OntClass other) Adds a new equivalent class.default OntClass.NamedaddHasKey(Collection<OntObjectProperty> objectProperties, Collection<OntDataProperty> dataProperties) Creates anowl:hasKeystatement returning this class to allow cascading calls.default OntClass.NamedaddHasKey(OntRelationalProperty... properties) Creates anowl:hasKeystatement returning this class to allow cascading calls.default OntClass.NamedCreates_:this rdfs:label "txt"^^xsd:stringstatement.default OntClass.NamedAdds the given localized text annotation with builtinrdfs:labelpredicate.default OntClass.NamedaddSubClass(OntClass other) Adds the given class as a subclass and returns this class expression instance to allow cascading calls.default OntClass.NamedaddSuperClass(OntClass other) Adds the given class as a superclass and returns this class expression instance to allow cascading calls.default OntClass.Namedannotate(OntAnnotationProperty predicate, String txt, String lang) Adds a language-tagged text for this object and the givenpredicatedefault OntClass.Namedannotate(OntAnnotationProperty predicate, org.apache.jena.rdf.model.RDFNode value) Annotates the object with the givenpredicateandvalue.default OntClass.NamedDeletes allDisjointUnion[]-lists including their annotations, i.e., all those statements with the predicateowl:disjointUnionOffor which this resource is a subject.default OntClass.NamedDeletes allHasKey[]-list including its annotations, i.e., all those statements with the predicateowl:hasKeyfor which this resource is a subject.createDisjointUnion(Collection<OntClass> classes) Creates aDisjointUnionasontology []-listofClass Expressions that is attached to this OWL Class using the predicateowl:disjointUnionOf.Lists allDisjointUnionontology lists that are attached to this OWL Class on predicateowl:disjointUnionOf.findDisjointUnion(org.apache.jena.rdf.model.RDFNode list) Finds aDisjointUnionlogical 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:disjointUnionOfas 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 giventypeinterface, if it is possible.getModel()Returns the ontology model associated with this resource.booleanisLocal()Determines if this Ontology Resource is locally defined.default OntClass.NamedremoveDisjointClass(org.apache.jena.rdf.model.Resource other) Removes the specified disjoint class resource.removeDisjointUnion(org.apache.jena.rdf.model.Resource list) Deletes the givenDisjointUnionlist including its annotations.default OntClass.NamedremoveEquivalentClass(org.apache.jena.rdf.model.Resource other) Removes the given equivalent class resource including the statement's annotations.default OntClass.NamedremoveSuperClass(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
asNodeMethods 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, superClassesMethods 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, 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
-
disjointUnions
Lists allDisjointUnionontology lists that are attached to this OWL Class on predicateowl:disjointUnionOf.- Returns:
StreamofOntLists with parameter-typeOntCE
-
createDisjointUnion
Creates aDisjointUnionasontology []-listofClass Expressions 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:nulls in the collection will causeexception. For additional information aboutDisjointUnionlogical construction see 9.1.4 Disjoint Union of Class Expressions.- Parameters:
classes-Collection(preferablySet) ofclass expressions- Returns:
OntListofOntClasss- See Also:
-
removeDisjointUnion
Deletes the givenDisjointUnionlist including its annotations.- Parameters:
list-Resourcecan beOntListorRDFList- Returns:
- this instance to allow cascading calls
- Throws:
OntJenaException- if the list is not found- See Also:
-
findDisjointUnion
Finds aDisjointUnionlogical construction attached to this class by the specified rdf-node in the form ofOntList.- Parameters:
list-RDFNode- Returns:
OptionalaroundOntListofclass expressions
-
addDisjointUnionOfStatement
Creates aDisjointUnionontology listand 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 expressionswithoutnulls, duplicates will be discarded and order will be saved- Returns:
OntStatementto 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 expressions withoutnulls- 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.- Specified by:
addSuperClassin 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:
addSubClassin interfaceOntClass- Parameters:
other-OntClass, notnull- Returns:
- this instance to allow cascading calls
- See Also:
-
addEquivalentClass
Adds a new equivalent class.- Specified by:
addEquivalentClassin 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:hasKeystatement returning this class to allow cascading calls.- Specified by:
addHasKeyin interfaceOntClass- 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.- Specified by:
addHasKeyin interfaceOntClass- Parameters:
properties- Array ofOntRelationalPropertys withoutnulls- Returns:
- this instance to allow cascading calls
- See Also:
-
addDisjointUnion
- Parameters:
classes- a collection ofclass expressions withoutnulls- Returns:
- this instance to allow cascading calls
-
addDisjointUnion
- Parameters:
classes- Array ofclass expressionswithoutnulls, 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:
addDisjointClassin 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:subClassOfstatements with all their annotations in casenullis specified.- Specified by:
removeSuperClassin interfaceOntClass- 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.- Specified by:
removeDisjointClassin interfaceOntClass- 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.- Specified by:
removeEquivalentClassin interfaceOntClass- 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.- Specified by:
clearHasKeysin interfaceOntClass- Returns:
- this instance to allow cascading calls
-
clearDisjointUnions
Deletes allDisjointUnion[]-lists including their annotations, i.e., all those statements with the predicateowl:disjointUnionOffor 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:disjointUnionOfas 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 expressionss - See Also:
-
addComment
Creates_:this rdfs:comment "txt"^^xsd:stringstatement.- Specified by:
addCommentin interfaceOntObject- Parameters:
txt- String, notnull- Returns:
- this object to allow cascading calls
- See Also:
-
addComment
Adds the given localized text annotation with builtinrdfs:commentpredicate.- Specified by:
addCommentin interfaceOntObject- Parameters:
txt- String, the literal lexical form, notnulllang- String, the language tag, nullable- Returns:
- this object to allow cascading calls
- See Also:
-
addLabel
Creates_:this rdfs:label "txt"^^xsd:stringstatement. -
addLabel
Adds the given localized text annotation with builtinrdfs:labelpredicate. -
annotate
Adds a language-tagged text for this object and the givenpredicate- Specified by:
annotatein interfaceOntObject- Parameters:
predicate-OntAnnotationProperty- named annotation property, notnulltxt- String, the literal lexical form, cannot benulllang- 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 givenpredicateandvalue.- Specified by:
annotatein interfaceOntObject- Parameters:
predicate-OntAnnotationProperty- named annotation property, notnullvalue-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:
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)
-