Module org.apache.jena.ontapi
Package org.apache.jena.ontapi.model
Interface OntIndividual.Anonymous
- All Superinterfaces:
org.apache.jena.graph.FrontsNode,OntIndividual,OntObject,org.apache.jena.rdf.model.RDFNode,org.apache.jena.rdf.model.Resource
- All Known Implementing Classes:
OntIndividualImpl.AnonymousImpl
- Enclosing interface:
- OntIndividual
An interface for Anonymous Individuals.
The anonymous individual is a blank node (
_:a) which satisfies one of the following conditions:
- it has a class declaration (i.e. there is a triple
_:a rdf:type C, whereCis aclass expression) - it is a subject or an object in a statement with predicate
owl:sameAsorowl:differentFrom - it is contained in a
rdf:Listwith predicateowl:distinctMembersorowl:membersin a blank node withrdf:type = owl:AllDifferent, seeOntDisjoint.Individuals - it is contained in a
rdf:Listwith predicateowl:oneOfin a blank node withrdf:type = owl:Class, seeOntClass.OneOf - it is a part of
owl:NegativePropertyAssertionsection with predicatesowl:sourceIndividualorowl:targetIndividual - it is an object with predicate
owl:hasValueinside_:x rdf:type owl:Restriction(seeObject Property HasValue Restriction) - it is a subject or an object in a statement where predicate is
an uri-resource with
rdf:type = owl:AnnotationProperty(i.e.annotation propertyassertions A t) - it is a subject in a triple which corresponds data property assertion
_:a R v(whereRis adatatype property,vis aliteral) - it is a subject or an object in a triple which corresponds object property assertion
_:a1 PN _:a2(wherePNis anamed object property, and_:aiare individuals)
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.jena.ontapi.model.OntIndividual
OntIndividual.Anonymous, OntIndividual.Named -
Method Summary
Modifier and TypeMethodDescriptiondetachClass(org.apache.jena.rdf.model.Resource clazz) Removes a class assertion statement for the given class.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.Methods inherited from interface org.apache.jena.graph.FrontsNode
asNodeMethods inherited from interface org.apache.jena.ontapi.model.OntIndividual
addAssertion, addAssertion, addAssertion, addClassAssertion, addComment, addComment, addDifferentFromStatement, addDifferentIndividual, addLabel, addLabel, addNegativeAssertion, addNegativeAssertion, addProperty, addSameAsStatement, addSameIndividual, annotate, annotate, asNamed, attachClass, classes, classes, content, differentIndividuals, disjoints, hasOntClass, negativeAssertions, negativeAssertions, ontClass, positiveAssertions, positiveAssertions, removeAssertion, removeDifferentIndividual, removeNegativeAssertion, removeSameIndividual, sameIndividualsMethods 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
OntIndividual.Anonymous detachClass(org.apache.jena.rdf.model.Resource clazz) throws OntJenaException 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. For an anonymous individual, a primary class assertion is also a definition, so its deletion is prohibited.- Specified by:
detachClassin interfaceOntIndividual- Parameters:
clazz-OntClass, notnull- Returns:
- this instance to allow cascading calls
- Throws:
OntJenaException- in case the individual has only one class assertion, and it is for the given class- 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)
-