- All Superinterfaces:
org.apache.jena.graph.FrontsNode,OntObject,org.apache.jena.rdf.model.RDFNode,org.apache.jena.rdf.model.Resource
- All Known Subinterfaces:
OntIndividual.Anonymous,OntIndividual.Named
- All Known Implementing Classes:
OntIndividualImpl,OntIndividualImpl.AnonymousImpl,OntIndividualImpl.NamedImpl
Interface for named and anonymous individuals.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceAn interface for Anonymous Individuals.static interfaceAn interface for Named Individual which is anEntity OntEntity. -
Method Summary
Modifier and TypeMethodDescriptiondefault OntIndividualaddAssertion(OntAnnotationProperty property, org.apache.jena.rdf.model.RDFNode value) Adds annotation assertionAnnotationAssertion(A s t).default OntIndividualaddAssertion(OntDataProperty property, org.apache.jena.rdf.model.Literal value) Adds a positive data property assertiona R v.default OntIndividualaddAssertion(OntObjectProperty.Named property, OntIndividual value) Adds a positive object property assertiona1 PN a2.default OntStatementaddClassAssertion(OntClass clazz) Creates and returns a class-assertion statementa rdf:type C, whereais this individual.default OntIndividualaddComment(String txt) Creates_:this rdfs:comment "txt"^^xsd:stringstatement.default OntIndividualaddComment(String txt, String lang) Adds the given localized text annotation with builtinrdfs:commentpredicate.default OntStatementAdds aowl:differentFromindividual statement.default OntIndividualAdds aowl:differentFromindividual statement and returns this object itself to allow cascading calls.default OntIndividualCreates_:this rdfs:label "txt"^^xsd:stringstatement.default OntIndividualAdds the given localized text annotation with builtinrdfs:labelpredicate.default OntIndividualaddNegativeAssertion(OntDataProperty property, org.apache.jena.rdf.model.Literal value) Adds a negative data property assertion.default OntIndividualaddNegativeAssertion(OntObjectProperty property, OntIndividual value) Adds a negative object property assertion.default OntIndividualaddProperty(OntNamedProperty property, org.apache.jena.rdf.model.RDFNode value) Adds a property assertion statement.default OntStatementaddSameAsStatement(OntIndividual other) Adds a same individual reference.default OntIndividualaddSameIndividual(OntIndividual other) Adds aowl:sameAsindividual statement and returns this object itself to allow cascading calls.default OntIndividualannotate(OntAnnotationProperty predicate, String txt, String lang) Adds a language-tagged text for this object and the givenpredicatedefault OntIndividualannotate(OntAnnotationProperty predicate, org.apache.jena.rdf.model.RDFNode value) Annotates the object with the givenpredicateandvalue.default OntIndividual.NamedasNamed()default OntIndividualattachClass(OntClass clazz) Adds a type (class expression) to this individual.classes()Returns all class types (direct and indirect).classes(boolean direct) Answers aStreamover the class expressions to which this individual belongs, including super-classes if the flagdirectisfalse.content()Lists the content of the object, i.e., all characteristic statements (seeOntObject.spec()), plus all additional statements in which this object is the subject, minus those of them whose predicate is an annotation property (annotations are not included).detachClass(org.apache.jena.rdf.model.Resource clazz) Removes a class assertion statement for the given class.default Stream<OntIndividual>Lists all different individuals.default Stream<OntDisjoint.Individuals>Lists allOntDisjointsections where this individual is a member.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.default booleanhasOntClass(OntClass clazz, boolean direct) Answerstrueif the given class is in the class-type closure.booleanisLocal()Determines if this Ontology Resource is locally defined.default Stream<OntNegativeAssertion>Lists all negative property assertions for this individual.default Stream<OntNegativeAssertion>negativeAssertions(OntRelationalProperty property) Lists all negative property assertions for this individual and the given property.ontClass()Answers a class to which this individual belongs, If there is more than one such class, an arbitrary selection is made.default Stream<OntStatement>Lists all positive assertions for this individual.default Stream<OntStatement>positiveAssertions(OntNamedProperty predicate) Lists all positive property assertions for this individual and the given predicate.default OntIndividualremoveAssertion(OntNamedProperty property, org.apache.jena.rdf.model.RDFNode value) Removes a positive property assertion including its annotation.default OntIndividualremoveDifferentIndividual(org.apache.jena.rdf.model.Resource other) Removes a different individual statement for this and specified individuals, including the statement's annotation.default OntIndividualremoveNegativeAssertion(OntRelationalProperty property, org.apache.jena.rdf.model.RDFNode value) Removes a negative property assertion including its annotation.default OntIndividualremoveSameIndividual(org.apache.jena.rdf.model.Resource other) Removes a same individual statement for this and specified individuals, including the statement's annotation.default Stream<OntIndividual>Lists all same individuals.Methods inherited from interface org.apache.jena.graph.FrontsNode
asNodeMethods 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
-
Method Details
-
detachClass
Removes a class assertion statement for the given class. Like others methods#remove..(..)(seeOntObject.remove(Property, RDFNode)), this operation does nothing in case no match found and in casenullis specified it removes all class assertion statements including all their annotations. To delete the individual with its content the methodOntModel.removeOntObject(OntObject)can be used.- Parameters:
clazz-OntClassornullto remove all class assertions- Returns:
- this instance to allow cascading calls
- See Also:
-
classes
Answers aStreamover the class expressions to which this individual belongs, including super-classes if the flagdirectisfalse. If the flagdirectistrue, then only direct types are returned, and the method is effectively equivalent to the methodclasses(). See alsoOntClass.superClasses(boolean).- Parameters:
direct- iftrue, only answers thoseOntClasss that are direct types of this individual, not the superclasses of the class etc- Returns:
- distinct
Streamofclass expressions - See Also:
-
content
Stream<OntStatement> content()Lists the content of the object, i.e., all characteristic statements (seeOntObject.spec()), plus all additional statements in which this object is the subject, minus those of them whose predicate is an annotation property (annotations are not included). For individuals, content also includes negative property assertion statements.- Specified by:
contentin interfaceOntObject- Returns:
Streamof contentOntStatements- See Also:
-
asNamed
-
classes
Returns all class types (direct and indirect).- Returns:
StreamofOntClasss
-
hasOntClass
Answerstrueif the given class is in the class-type closure.- Parameters:
clazz-OntClassto testdirect- seeclasses(boolean)- Returns:
- true if the specified class found
-
ontClass
Answers a class to which this individual belongs, If there is more than one such class, an arbitrary selection is made.- Returns:
OptionalwrappingOntClass
-
sameIndividuals
Lists all same individuals. The pattern to search for isai owl:sameAs aj, whereaiis this individual.- Returns:
StreamofOntIndividuals
-
disjoints
Lists allOntDisjointsections where this individual is a member.- Returns:
- a
StreamofOntDisjoint.Individuals
-
differentIndividuals
Lists all different individuals. The pattern to search for isthisIndividual owl:differentFrom otherIndividual, whereotherIndividualis one of the returned.- Returns:
StreamofOntIndividuals- See Also:
-
positiveAssertions
Lists all positive assertions for this individual.- Returns:
StreamofOntStatements
-
positiveAssertions
Lists all positive property assertions for this individual and the given predicate.- Parameters:
predicate-OntNamedPropertyornull- Returns:
StreamofOntStatements
-
negativeAssertions
Lists all negative property assertions for this individual.- Returns:
Streamofnegative property assertions
-
negativeAssertions
Lists all negative property assertions for this individual and the given property.- Parameters:
property-OntRelationalPropertyornull- Returns:
Streamofnegative property assertions
-
addClassAssertion
Creates and returns a class-assertion statementa rdf:type C, whereais this individual.- Parameters:
clazz-OntClass, notnull- Returns:
OntStatementto allow subsequent annotations adding- See Also:
-
addDifferentFromStatement
Adds aowl:differentFromindividual statement.- Parameters:
other-OntIndividual, notnull- Returns:
OntStatementto provide the ability to add annotations subsequently- See Also:
-
addSameAsStatement
Adds a same individual reference.- Parameters:
other-OntIndividual, notnull- Returns:
OntStatementto allow subsequent annotations adding- See Also:
-
attachClass
Adds a type (class expression) to this individual.- Parameters:
clazz-OntClass- Returns:
- this instance to allow cascading calls
- See Also:
-
addDifferentIndividual
Adds aowl:differentFromindividual statement and returns this object itself to allow cascading calls.- Parameters:
other-OntIndividual, notnull- Returns:
- this instance to allow cascading calls
- See Also:
-
addSameIndividual
Adds aowl:sameAsindividual statement and returns this object itself to allow cascading calls.- Parameters:
other- otherOntIndividual, notnull- Returns:
- this instance to allow cascading calls
- See Also:
-
addAssertion
default OntIndividual addAssertion(OntAnnotationProperty property, org.apache.jena.rdf.model.RDFNode value) Adds annotation assertionAnnotationAssertion(A s t). In general case it iss A t, wheresis IRI or anonymous individual,A- annotation property, andt- IRI, anonymous individual, or literal.- Parameters:
property-OntAnnotationPropertyvalue-RDFNode(IRI, anonymous individual, or literal)- Returns:
- this individual to allow cascading calls
- See Also:
-
addAssertion
default OntIndividual addAssertion(OntDataProperty property, org.apache.jena.rdf.model.Literal value) Adds a positive data property assertiona R v.- Parameters:
property-OntDataPropertyvalue-Literal- Returns:
- this individual to allow cascading calls
- See Also:
-
addAssertion
Adds a positive object property assertiona1 PN a2.- Parameters:
property-OntObjectProperty.Namednamed object propertyvalue-OntIndividualother individual- Returns:
- this individual to allow cascading calls
- See Also:
-
addProperty
default OntIndividual addProperty(OntNamedProperty property, org.apache.jena.rdf.model.RDFNode value) Adds a property assertion statement. Caution: this method offers a way to add a statement that is contrary to the OWL2 specification. For example, it is possible to addobject property-literalpair, that is not object property assertion.- Parameters:
property-OntNamedProperty, notnullvalue-RDFNode, notnull- Returns:
- this instance to allow cascading calls
- See Also:
-
Resource.addProperty(Property, RDFNode)removeAssertion(OntNamedProperty, RDFNode)
-
addNegativeAssertion
Adds a negative object property assertion.Functional syntax:
NegativeObjectPropertyAssertion(P a1 a2)RDF Syntax:_:x rdf:type owl:NegativePropertyAssertion . _:x owl:sourceIndividual a1 . _:x owl:assertionProperty P . _:x owl:targetIndividual a2 .- Parameters:
property-OntObjectPropertyvalue-OntIndividualother individual- Returns:
- this individual to allow cascading calls
-
addNegativeAssertion
default OntIndividual addNegativeAssertion(OntDataProperty property, org.apache.jena.rdf.model.Literal value) Adds a negative data property assertion.Functional syntax:
NegativeDataPropertyAssertion(R a v)RDF Syntax:_:x rdf:type owl:NegativePropertyAssertion. _:x owl:sourceIndividual a . _:x owl:assertionProperty R . _:x owl:targetValue v .- Parameters:
property-OntDataPropertyvalue-Literal- Returns:
- this individual to allow cascading calls
-
removeAssertion
default OntIndividual removeAssertion(OntNamedProperty property, org.apache.jena.rdf.model.RDFNode value) Removes a positive property assertion including its annotation.- Parameters:
property-OntNamedProperty, can benullto remove all positive property assertionsvalue-RDFNode(eitherOntIndividualorLiteral), can benullto remove all assertions for the predicateproperty- Returns:
- this instance to allow cascading calls
- See Also:
-
removeNegativeAssertion
default OntIndividual removeNegativeAssertion(OntRelationalProperty property, org.apache.jena.rdf.model.RDFNode value) Removes a negative property assertion including its annotation.- Parameters:
property-OntNamedProperty, can benullto remove all negative property assertionsvalue-RDFNode(eitherOntIndividualorLiteral), can benullto remove all assertions for the predicateproperty- Returns:
- this instance to allow cascading calls
-
removeDifferentIndividual
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:differentFromifnullis specified.- Parameters:
other-Resourceornullto remove all different individuals- Returns:
- this instance to allow cascading calls
- See Also:
-
removeSameIndividual
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:sameAsifnullis specified.- Parameters:
other-Resourceornullto remove all same individuals- Returns:
- this instance to allow cascading calls
- 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 OntIndividual 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)
-