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
, whereC
is aclass expression
) - it is a subject or an object in a statement with predicate
owl:sameAs
orowl:differentFrom
- it is contained in a
rdf:List
with predicateowl:distinctMembers
orowl:members
in a blank node withrdf:type = owl:AllDifferent
, seeOntDisjoint.Individuals
- it is contained in a
rdf:List
with predicateowl:oneOf
in a blank node withrdf:type = owl:Class
, seeOntClass.OneOf
- it is a part of
owl:NegativePropertyAssertion
section with predicatesowl:sourceIndividual
orowl:targetIndividual
- it is an object with predicate
owl:hasValue
inside_: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 property
assertions A t
) - it is a subject in a triple which corresponds data property assertion
_:a R v
(whereR
is adatatype property
,v
is aliteral
) - it is a subject or an object in a triple which corresponds object property assertion
_:a1 PN _:a2
(wherePN
is anamed object property
, and_:ai
are 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 giventype
interface, if it is possible.getModel()
Returns the ontology model associated with this resource.boolean
isLocal()
Determines if this Ontology Resource is locally defined.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, 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, sameIndividuals
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
-
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 casenull
is 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:
detachClass
in 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:
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)
-