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

public static interface OntIndividual.Anonymous extends 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, where C is a class expression)
  • it is a subject or an object in a statement with predicate owl:sameAs or owl:differentFrom
  • it is contained in a rdf:List with predicate owl:distinctMembers or owl:members in a blank node with rdf:type = owl:AllDifferent, see OntDisjoint.Individuals
  • it is contained in a rdf:List with predicate owl:oneOf in a blank node with rdf:type = owl:Class, see OntClass.OneOf
  • it is a part of owl:NegativePropertyAssertion section with predicates owl:sourceIndividual or owl:targetIndividual
  • it is an object with predicate owl:hasValue inside _:x rdf:type owl:Restriction (see Object 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 assertion s A t)
  • it is a subject in a triple which corresponds data property assertion _:a R v (where R is a datatype property, v is a literal)
  • it is a subject or an object in a triple which corresponds object property assertion _:a1 PN _:a2 (where PN is a named object property, and _:ai are individuals)
See Also:
  • 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..(..) (see OntObject.remove(Property, RDFNode)), this operation does nothing in case no match found and in case null is specified it removes all class assertion statements including all their annotations. To delete the individual with its content the method OntModel.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 interface OntIndividual
      Parameters:
      clazz - OntClass, not null
      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 interface org.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 the root statement) belongs to the base ontology graph. If the ontology contains subgraphs (which should match owl:imports in OWL) and the resource is defined in one of them, than this method called from top-level interface will return false.
      Returns:
      true if this resource is local to the base model graph.
    • getAs

      default <X extends org.apache.jena.rdf.model.RDFNode> X getAs(Class<X> type)
      Safely converts this RDF resource to the given type interface, if it is possible. Otherwise, returns null. A calling of this method is effectively equivalent to the expression this.canAs(type) ? this.as(type) : null.
      Type Parameters:
      X - any subtype of RDFNode
      Parameters:
      type - a Class-type of the desired RDF view (interface)
      Returns:
      an instance of the type X or null
      See Also:
      • RDFNode.as(Class)
      • RDFNode.canAs(Class)