Module org.apache.jena.ontapi
Class OntSimpleClassImpl.NamedImpl
java.lang.Object
org.apache.jena.enhanced.Polymorphic<org.apache.jena.rdf.model.RDFNode>
org.apache.jena.enhanced.EnhNode
org.apache.jena.rdf.model.impl.ResourceImpl
org.apache.jena.ontapi.impl.objects.OntObjectImpl
org.apache.jena.ontapi.impl.objects.OntSimpleClassImpl
org.apache.jena.ontapi.impl.objects.OntSimpleClassImpl.NamedImpl
- All Implemented Interfaces:
org.apache.jena.graph.FrontsNode
,OntClass
,OntClass.Named
,OntEntity
,OntObject
,org.apache.jena.rdf.model.RDFNode
,org.apache.jena.rdf.model.Resource
- Direct Known Subclasses:
OntSimpleClassImpl.RLNamedImpl
- Enclosing class:
- OntSimpleClassImpl
public static class OntSimpleClassImpl.NamedImpl
extends OntSimpleClassImpl
implements OntClass.Named
Primary (named) class (
<uri> a owl:Class
).
This is also OntEntity
.
Note:
In jena OWL1, class expressions, such as OntClass.ComplementOf
can also be named.-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.jena.ontapi.impl.objects.OntSimpleClassImpl
OntSimpleClassImpl.NamedImpl, OntSimpleClassImpl.RLNamedImpl
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
Fields inherited from class org.apache.jena.rdf.model.impl.ResourceImpl
factory, rdfNodeFactory
-
Constructor Summary
ConstructorsConstructorDescriptionNamedImpl
(org.apache.jena.graph.Node n, org.apache.jena.enhanced.EnhGraph eg) -
Method Summary
Modifier and TypeMethodDescriptionaddDisjointClass
(OntClass other) Adds the given class as a disjoint class and returns this class expression instance to allow cascading calls.asNamed()
Represents this OWL class expression as a named OWL class if it is possible, otherwise throws an exception.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
.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
Determines if this is a builtin entity.boolean
isLocal()
Determines if this Ontology Resource is locally defined.Gets a public ont-object type identifier.removeDisjointClass
(org.apache.jena.rdf.model.Resource other) Removes the specified disjoint class resource.removeDisjointUnion
(org.apache.jena.rdf.model.Resource rdfList) Deletes the givenDisjointUnion
list including its annotations.removeEquivalentClass
(org.apache.jena.rdf.model.Resource other) Removes the given equivalent class resource including the statement's annotations.Methods inherited from class org.apache.jena.ontapi.impl.objects.OntSimpleClassImpl
addDisjointWithStatement, addEquivalentClassStatement, addHasKeyStatement, createHasKey, createIndividual, createIndividual, declaredProperties, disjointClasses, equivalentClasses, findRootStatement, hasDeclaredProperty, hasKeys, hasSuperClass, individuals, isDisjoint, isHierarchyRoot, removeHasKey, subClasses, superClasses
Methods inherited from class org.apache.jena.ontapi.impl.objects.OntObjectImpl
addAnnotation, addStatement, annotations, annotationValues, assertions, checkNamed, checkNamed, clearAnnotations, content, findActualClass, findActualClass, getAs, getMainStatement, getModel, getNodeAs, getRequiredObject, getRequiredProperty, isLocal, isReservedOrBuiltin, listAnnotationLiterals, listAnnotations, listAssertions, listObjects, listObjects, listProperties, listProperties, listSpec, listStatements, listStatements, listSubjects, object, objects, objects, remove, spec, statement, statement, statements, statements, subjects, toString, wrapAsOntObject
Methods inherited from class org.apache.jena.rdf.model.impl.ResourceImpl
abort, addLiteral, addLiteral, addLiteral, addLiteral, addLiteral, addLiteral, addLiteral, addProperty, addProperty, addProperty, addProperty, addProperty, addProperty, addProperty, asLiteral, asResource, begin, commit, getId, getLocalName, getNameSpace, getProperty, getProperty, getPropertyResourceValue, getRequiredProperty, getStmtTerm, getURI, hasLiteral, hasLiteral, hasLiteral, hasLiteral, hasLiteral, hasLiteral, hasProperty, hasProperty, hasProperty, hasProperty, hasURI, inModel, listProperties, removeAll, removeProperties, visitWith
Methods inherited from class org.apache.jena.enhanced.EnhNode
as, asNode, canAs, equals, getGraph, hashCode, isAnon, isLiteral, isResource, isStmtResource, isURIResource, isValid, viewAs
Methods inherited from class org.apache.jena.enhanced.Polymorphic
addView, supports
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, 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.OntClass.Named
addComment, addComment, addDisjointUnion, addDisjointUnion, addDisjointUnionOfStatement, addDisjointUnionOfStatement, addEquivalentClass, addHasKey, addHasKey, addLabel, addLabel, addSubClass, addSuperClass, annotate, annotate, clearDisjointUnions, clearHasKeys, findDisjointUnion, fromDisjointUnionOf, removeSuperClass
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, 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
-
Constructor Details
-
NamedImpl
public NamedImpl(org.apache.jena.graph.Node n, org.apache.jena.enhanced.EnhGraph eg)
-
-
Method Details
-
asNamed
Description copied from interface:OntClass
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)
. -
objectType
Description copied from class:OntObjectImpl
Gets a public ont-object type identifier.- Specified by:
objectType
in interfaceOntObject
- Overrides:
objectType
in classOntSimpleClassImpl
- Returns:
- Class, the actual type of this object
-
isBuiltIn
public boolean isBuiltIn()Description copied from interface:OntEntity
Determines if this is a builtin entity. In a standard (default) OWL2 vocabulary an entity is builtin if it is:- a
class
and its IRI is eitherowl:Thing
orowl:Nothing
- an
object property
and its IRI is eitherowl:topObjectProperty
orowl:bottomObjectProperty
- a
data property
and its IRI is eitherowl:topDataProperty
orowl:bottomDataProperty
- a
datatype
and its IRI is eitherrdfs:Literal
, orrdf:PlainLiteral
, or it is from the OWL 2 datatype map - an
annotation property
and its IRI is one of the following:rdfs:label
rdfs:comment
rdfs:seeAlso
rdfs:isDefinedBy
owl:deprecated
owl:versionInfo
owl:priorVersion
owl:backwardCompatibleWith
owl:incompatibleWith
Builtins Vocabulary
. A model with differentBuiltins
vocabulary will naturally have a differentSet
of builtin IRIs, and this method will return a different result. - a
-
disjointUnions
Description copied from interface:OntClass.Named
Lists allDisjointUnion
ontology list
s that are attached to this OWL Class on predicateowl:disjointUnionOf
.- Specified by:
disjointUnions
in interfaceOntClass.Named
- Returns:
Stream
ofOntList
s with parameter-typeOntCE
-
createDisjointUnion
Description copied from interface:OntClass.Named
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.- Specified by:
createDisjointUnion
in interfaceOntClass.Named
- Parameters:
classes
-Collection
(preferablySet
) ofclass expression
s- Returns:
OntList
ofOntClass
s- See Also:
-
removeDisjointUnion
public OntClass.Named removeDisjointUnion(org.apache.jena.rdf.model.Resource rdfList) throws OntJenaException.IllegalArgument Description copied from interface:OntClass.Named
Deletes the givenDisjointUnion
list including its annotations.- Specified by:
removeDisjointUnion
in interfaceOntClass.Named
- Parameters:
rdfList
-Resource
can beOntList
orRDFList
- Returns:
- this instance to allow cascading calls
- Throws:
OntJenaException.IllegalArgument
- See Also:
-
removeDisjointClass
Description copied from interface:OntClass
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
- Specified by:
removeDisjointClass
in interfaceOntClass.Named
- Overrides:
removeDisjointClass
in classOntSimpleClassImpl
- Parameters:
other
-Resource
, ornull
to remove all disjoint classes- Returns:
- this instance to allow cascading calls
- See Also:
-
removeEquivalentClass
Description copied from interface:OntClass
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
- Specified by:
removeEquivalentClass
in interfaceOntClass.Named
- Overrides:
removeEquivalentClass
in classOntSimpleClassImpl
- Parameters:
other
-Resource
, ornull
to remove all equivalent classes- Returns:
- this instance to allow cascading calls
- See Also:
-
addDisjointClass
Description copied from interface:OntClass
Adds the given class as a disjoint class and returns this class expression instance to allow cascading calls.- Specified by:
addDisjointClass
in interfaceOntClass
- Specified by:
addDisjointClass
in interfaceOntClass.Named
- Overrides:
addDisjointClass
in classOntSimpleClassImpl
- Parameters:
other
-OntClass
, notnull
- 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)
-