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.OntIndividualImpl
- All Implemented Interfaces:
org.apache.jena.graph.FrontsNode
,OntIndividual
,OntObject
,org.apache.jena.rdf.model.RDFNode
,org.apache.jena.rdf.model.Resource
- Direct Known Subclasses:
OntIndividualImpl.AnonymousImpl
,OntIndividualImpl.NamedImpl
An
OntIndividual
implementation, both for anonymous and named individuals.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
See description to the interfaceOntIndividual.Anonymous
.static class
Represents a named individual.Nested classes/interfaces inherited from interface org.apache.jena.ontapi.model.OntIndividual
OntIndividual.Anonymous, OntIndividual.Named
-
Field Summary
Fields inherited from class org.apache.jena.rdf.model.impl.ResourceImpl
factory, rdfNodeFactory
-
Constructor Summary
ConstructorsConstructorDescriptionOntIndividualImpl
(org.apache.jena.graph.Node n, org.apache.jena.enhanced.EnhGraph m) -
Method Summary
Modifier and TypeMethodDescriptionAdds aowl:differentFrom
individual statement.addSameAsStatement
(OntIndividual other) Adds a same individual reference.classes
(boolean direct) Returns aStream
of all class-types, including their super-classes if the parameterdirect
isfalse
.static OntIndividual.Anonymous
createAnonymousIndividual
(org.apache.jena.rdf.model.RDFNode node) Lists all different individuals.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
hasOntClass
(OntClass clazz, boolean direct) Answerstrue
if the given class is in the class-type closure.boolean
isLocal()
org.apache.jena.util.iterator.ExtendedIterator<OntStatement>
Lists all class assertion statements.org.apache.jena.util.iterator.ExtendedIterator<OntClass>
Lists all right parts from class assertion statements where this individual is at subject position.org.apache.jena.util.iterator.ExtendedIterator<OntNegativeAssertion>
Lists all negative property assertions for this individual.removeDifferentIndividual
(org.apache.jena.rdf.model.Resource other) Removes a different individual statement for this and specified individuals, including the statement's annotation.removeSameIndividual
(org.apache.jena.rdf.model.Resource other) Removes a same individual statement for this and specified individuals, including the statement's annotation.Lists all same individuals.Methods inherited from class org.apache.jena.ontapi.impl.objects.OntObjectImpl
addAnnotation, addStatement, annotations, annotationValues, assertions, checkNamed, checkNamed, clearAnnotations, content, findActualClass, findActualClass, findRootStatement, getAs, getMainStatement, getModel, getNodeAs, getRequiredObject, getRequiredProperty, isReservedOrBuiltin, listAnnotationLiterals, listAnnotations, listAssertions, listObjects, listObjects, listProperties, listProperties, listSpec, listStatements, listStatements, listSubjects, object, objects, objects, objectType, 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.OntIndividual
addAssertion, addAssertion, addAssertion, addClassAssertion, addComment, addComment, addDifferentIndividual, addLabel, addLabel, addNegativeAssertion, addNegativeAssertion, addProperty, addSameIndividual, annotate, annotate, asNamed, attachClass, classes, content, detachClass, disjoints, negativeAssertions, ontClass, positiveAssertions, positiveAssertions, removeAssertion, removeNegativeAssertion
Methods inherited from interface org.apache.jena.ontapi.model.OntObject
addAnnotation, addAnnotation, addAnnotation, addStatement, annotations, annotationValues, annotationValues, clearAnnotations, 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
-
Constructor Details
-
OntIndividualImpl
public OntIndividualImpl(org.apache.jena.graph.Node n, org.apache.jena.enhanced.EnhGraph m)
-
-
Method Details
-
createAnonymousIndividual
public static OntIndividual.Anonymous createAnonymousIndividual(org.apache.jena.rdf.model.RDFNode node) -
classes
Returns aStream
of all class-types, including their super-classes if the parameterdirect
isfalse
.- Specified by:
classes
in interfaceOntIndividual
- Parameters:
direct
- iftrue
returns only direct types- Returns:
- a
Stream
of allclass
-types - See Also:
-
hasOntClass
Description copied from interface:OntIndividual
Answerstrue
if the given class is in the class-type closure.- Specified by:
hasOntClass
in interfaceOntIndividual
- Parameters:
clazz
-OntClass
to testdirect
- seeOntIndividual.classes(boolean)
- Returns:
- true if the specified class found
-
sameIndividuals
Description copied from interface:OntIndividual
Lists all same individuals. The pattern to search for isai owl:sameAs aj
, whereai
is this individual.- Specified by:
sameIndividuals
in interfaceOntIndividual
- Returns:
Stream
ofOntIndividual
s
-
addSameAsStatement
Description copied from interface:OntIndividual
Adds a same individual reference.- Specified by:
addSameAsStatement
in interfaceOntIndividual
- Parameters:
other
-OntIndividual
, notnull
- Returns:
OntStatement
to allow subsequent annotations adding- See Also:
-
removeSameIndividual
Description copied from interface:OntIndividual
Removes a same individual statement for this and specified individuals, including the statement's annotation. No-op in case no same individuals are found. Removes all triples with the predicateowl:sameAs
ifnull
is specified.- Specified by:
removeSameIndividual
in interfaceOntIndividual
- Parameters:
other
-Resource
ornull
to remove all same individuals- Returns:
- this instance to allow cascading calls
- See Also:
-
differentIndividuals
Description copied from interface:OntIndividual
Lists all different individuals. The pattern to search for isthisIndividual owl:differentFrom otherIndividual
, whereotherIndividual
is one of the returned.- Specified by:
differentIndividuals
in interfaceOntIndividual
- Returns:
Stream
ofOntIndividual
s- See Also:
-
addDifferentFromStatement
Description copied from interface:OntIndividual
Adds aowl:differentFrom
individual statement.- Specified by:
addDifferentFromStatement
in interfaceOntIndividual
- Parameters:
other
-OntIndividual
, notnull
- Returns:
OntStatement
to provide the ability to add annotations subsequently- See Also:
-
removeDifferentIndividual
Description copied from interface:OntIndividual
Removes a different individual statement for this and specified individuals, including the statement's annotation. No-op in case no different individuals are found. Removes all triples with the predicateowl:differentFrom
ifnull
is specified.- Specified by:
removeDifferentIndividual
in interfaceOntIndividual
- Parameters:
other
-Resource
ornull
to remove all different individuals- Returns:
- this instance to allow cascading calls
- See Also:
-
listClasses
Lists all right parts from class assertion statements where this individual is at subject position.- Returns:
ExtendedIterator
over all directclass
-types
-
isLocal
public boolean isLocal()- Overrides:
isLocal
in classOntObjectImpl
- Returns:
true
if the root statement belongs to the base graph
-
listClassAssertions
Lists all class assertion statements.- Returns:
ExtendedIterator
over all class assertions.
-
negativeAssertions
Description copied from interface:OntIndividual
Lists all negative property assertions for this individual.- Specified by:
negativeAssertions
in interfaceOntIndividual
- Returns:
Stream
ofnegative property assertion
s
-
listNegativeAssertions
public org.apache.jena.util.iterator.ExtendedIterator<OntNegativeAssertion> listNegativeAssertions() -
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
-
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)
-