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 classSee description to the interfaceOntIndividual.Anonymous.static classRepresents 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:differentFromindividual statement.addSameAsStatement(OntIndividual other) Adds a same individual reference.classes(boolean direct) Returns aStreamof all class-types, including their super-classes if the parameterdirectisfalse.static OntIndividual.AnonymouscreateAnonymousIndividual(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 giventypeinterface, if it is possible.getModel()Returns the ontology model associated with this resource.booleanhasOntClass(OntClass clazz, boolean direct) Answerstrueif the given class is in the class-type closure.booleanisLocal()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, wrapAsOntObjectMethods 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, asStatementTerm, begin, commit, getId, getLocalName, getNameSpace, getProperty, getProperty, getPropertyResourceValue, getRequiredProperty, getURI, hasLiteral, hasLiteral, hasLiteral, hasLiteral, hasLiteral, hasLiteral, hasProperty, hasProperty, hasProperty, hasProperty, hasURI, inModel, listProperties, removeAll, removeProperties, visitWithMethods inherited from class org.apache.jena.enhanced.EnhNode
as, asNode, canAs, equals, getGraph, hashCode, isAnon, isLiteral, isResource, isStatementTerm, isURIResource, isValid, viewAsMethods inherited from class org.apache.jena.enhanced.Polymorphic
addView, supportsMethods inherited from interface org.apache.jena.graph.FrontsNode
asNodeMethods 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, removeNegativeAssertionMethods 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, 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
-
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 aStreamof all class-types, including their super-classes if the parameterdirectisfalse.- Specified by:
classesin interfaceOntIndividual- Parameters:
direct- iftruereturns only direct types- Returns:
- a
Streamof allclass-types - See Also:
-
hasOntClass
Description copied from interface:OntIndividualAnswerstrueif the given class is in the class-type closure.- Specified by:
hasOntClassin interfaceOntIndividual- Parameters:
clazz-OntClassto testdirect- seeOntIndividual.classes(boolean)- Returns:
- true if the specified class found
-
sameIndividuals
Description copied from interface:OntIndividualLists all same individuals. The pattern to search for isai owl:sameAs aj, whereaiis this individual.- Specified by:
sameIndividualsin interfaceOntIndividual- Returns:
StreamofOntIndividuals
-
addSameAsStatement
Description copied from interface:OntIndividualAdds a same individual reference.- Specified by:
addSameAsStatementin interfaceOntIndividual- Parameters:
other-OntIndividual, notnull- Returns:
OntStatementto allow subsequent annotations adding- See Also:
-
removeSameIndividual
Description copied from interface:OntIndividualRemoves 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:sameAsifnullis specified.- Specified by:
removeSameIndividualin interfaceOntIndividual- Parameters:
other-Resourceornullto remove all same individuals- Returns:
- this instance to allow cascading calls
- See Also:
-
differentIndividuals
Description copied from interface:OntIndividualLists all different individuals. The pattern to search for isthisIndividual owl:differentFrom otherIndividual, whereotherIndividualis one of the returned.- Specified by:
differentIndividualsin interfaceOntIndividual- Returns:
StreamofOntIndividuals- See Also:
-
addDifferentFromStatement
Description copied from interface:OntIndividualAdds aowl:differentFromindividual statement.- Specified by:
addDifferentFromStatementin interfaceOntIndividual- Parameters:
other-OntIndividual, notnull- Returns:
OntStatementto provide the ability to add annotations subsequently- See Also:
-
removeDifferentIndividual
Description copied from interface:OntIndividualRemoves 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:differentFromifnullis specified.- Specified by:
removeDifferentIndividualin interfaceOntIndividual- Parameters:
other-Resourceornullto 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:
ExtendedIteratorover all directclass-types
-
isLocal
public boolean isLocal()- Overrides:
isLocalin classOntObjectImpl- Returns:
trueif the root statement belongs to the base graph
-
listClassAssertions
Lists all class assertion statements.- Returns:
ExtendedIteratorover all class assertions.
-
negativeAssertions
Description copied from interface:OntIndividualLists all negative property assertions for this individual.- Specified by:
negativeAssertionsin interfaceOntIndividual- Returns:
Streamofnegative property assertions
-
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:
getModelin interfaceorg.apache.jena.rdf.model.RDFNode- Returns:
OntModel
-
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)
-