Interface OntDataRange.Named

All Superinterfaces:
org.apache.jena.graph.FrontsNode, OntDataRange, OntEntity, OntObject, org.apache.jena.rdf.model.RDFNode, org.apache.jena.rdf.model.Resource
All Known Implementing Classes:
OntNamedDataRangeImpl
Enclosing interface:
OntDataRange

public static interface OntDataRange.Named extends OntEntity, OntDataRange
Interface encapsulating an Ontology Datatype, OWL Entity, a named data range expression.
See Also:
  • Method Details

    • asNamed

      default OntDataRange.Named asNamed()
      Specified by:
      asNamed in interface OntDataRange
    • equivalentClasses

      default Stream<OntDataRange> equivalentClasses()
      Lists all equivalent data ranges. The pattern to search is DN owl:equivalentClass D, where DN is this Data Type, and D is a search object, the data-range expression.
      Returns:
      Stream of OntDataRanges
      See Also:
    • addEquivalentClassStatement

      default OntStatement addEquivalentClassStatement(OntDataRange other)
      Creates an equivalent class statement with the given Data Range expression.
      Parameters:
      other - OntDataRange, not null
      Returns:
      OntStatement to allow the subsequent annotations addition
      See Also:
    • addEquivalentClass

      default OntDataRange.Named addEquivalentClass(OntDataRange other)
      Creates an equivalent class statement with the given Data Range expression.
      Parameters:
      other - OntDataRange, not null
      Returns:
      this instance to allow cascading calls
      See Also:
    • removeEquivalentClass

      default OntDataRange.Named removeEquivalentClass(org.apache.jena.rdf.model.Resource other)
      Removes the given equivalent data range, that is attached to this data-type on predicate owl:equivalenrClass, including all the statement's related annotations. No-op in case nothing is found. The null input means removing all owl:equivalentClass statements with all their annotations.
      Parameters:
      other - Resource, or null to remove all equivalent data ranges
      Returns:
      this instance to allow cascading calls
      See Also:
    • toRDFDatatype

      default org.apache.jena.datatypes.RDFDatatype toRDFDatatype()
      Creates a Jena Datatype.
      Returns:
      Jena RDF Datatype
    • createLiteral

      default org.apache.jena.rdf.model.Literal createLiteral(Object obj)
      Builds a typed literal from its value form given as an object. Note: there is no validation for lexical form.
      Parameters:
      obj - anything, not null
      Returns:
      Literal
    • createLiteral

      default org.apache.jena.rdf.model.Literal createLiteral(String lex)
      Builds a typed literal from its value form. Note: there is no validation for lexical form, so it is possible to create an illegal literal, e.g. "wrong"^^xsd:int.
      Parameters:
      lex - String, lexical form of the result literal, not null
      Returns:
      Literal
      See Also:
      • Model.createTypedLiteral(String, RDFDatatype)
    • addComment

      default OntDataRange.Named addComment(String txt)
      Creates _:this rdfs:comment "txt"^^xsd:string statement.
      Specified by:
      addComment in interface OntObject
      Parameters:
      txt - String, not null
      Returns:
      this object to allow cascading calls
      See Also:
    • addComment

      default OntDataRange.Named addComment(String txt, String lang)
      Adds the given localized text annotation with builtin rdfs:comment predicate.
      Specified by:
      addComment in interface OntObject
      Parameters:
      txt - String, the literal lexical form, not null
      lang - String, the language tag, nullable
      Returns:
      this object to allow cascading calls
      See Also:
    • addLabel

      default OntDataRange.Named addLabel(String txt)
      Creates _:this rdfs:label "txt"^^xsd:string statement.
      Specified by:
      addLabel in interface OntObject
      Parameters:
      txt - String, the literal lexical form, not null
      Returns:
      this object to allow cascading calls
      See Also:
    • addLabel

      default OntDataRange.Named addLabel(String txt, String lang)
      Adds the given localized text annotation with builtin rdfs:label predicate.
      Specified by:
      addLabel in interface OntObject
      Parameters:
      txt - String, the literal lexical form, not null
      lang - String, the language tag, nullable
      Returns:
      this object to allow cascading calls
      See Also:
    • annotate

      default OntDataRange.Named annotate(OntAnnotationProperty predicate, String txt, String lang)
      Adds a language-tagged text for this object and the given predicate
      Specified by:
      annotate in interface OntObject
      Parameters:
      predicate - OntAnnotationProperty - named annotation property, not null
      txt - String, the literal lexical form, cannot be null
      lang - String, the language tag, can be null
      Returns:
      this object to allow cascading calls
    • annotate

      default OntDataRange.Named annotate(OntAnnotationProperty predicate, org.apache.jena.rdf.model.RDFNode value)
      Annotates the object with the given predicate and value.
      Specified by:
      annotate in interface OntObject
      Parameters:
      predicate - OntAnnotationProperty - named annotation property, not null
      value - RDFNode - the value: uri-resource, literal or anonymous individual, not null
      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:
      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)