Interface OntNamedProperty<P extends OntNamedProperty<P>>

Type Parameters:
P - subtype of OntNamedProperty
All Superinterfaces:
org.apache.jena.graph.FrontsNode, OntEntity, OntObject, org.apache.jena.rdf.model.Property, org.apache.jena.rdf.model.RDFNode, org.apache.jena.rdf.model.Resource
All Known Subinterfaces:
OntAnnotationProperty, OntDataProperty, OntObjectProperty.Named
All Known Implementing Classes:
OntAnnotationPropertyImpl, OntDataPropertyImpl, OntObjectPropertyImpl.NamedImpl

public interface OntNamedProperty<P extends OntNamedProperty<P>> extends OntEntity, org.apache.jena.rdf.model.Property
  • Field Summary

    Fields inherited from interface org.apache.jena.ontapi.model.OntEntity

    TYPES
  • Method Summary

    Modifier and Type
    Method
    Description
    default P
    Creates _:this rdfs:comment "txt"^^xsd:string statement.
    default P
    addComment(String txt, String lang)
    Adds the given localized text annotation with builtin rdfs:comment predicate.
    default P
    Creates _:this rdfs:label "txt"^^xsd:string statement.
    default P
    addLabel(String txt, String lang)
    Adds the given localized text annotation with builtin rdfs:label predicate.
    default P
    annotate(OntAnnotationProperty predicate, String txt, String lang)
    Adds a language-tagged text for this object and the given predicate
    default P
    annotate(OntAnnotationProperty predicate, org.apache.jena.rdf.model.RDFNode value)
    Annotates the object with the given predicate and value.
    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.
    Returns the ontology model associated with this resource.
    boolean
    Determines if this Ontology Resource is locally defined.
    default boolean
     

    Methods inherited from interface org.apache.jena.graph.FrontsNode

    asNode

    Methods inherited from interface org.apache.jena.ontapi.model.OntEntity

    isBuiltIn

    Methods inherited from interface org.apache.jena.rdf.model.Property

    getLocalName, getNameSpace, getOrdinal, inModel

    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, getProperty, getProperty, getPropertyResourceValue, getRequiredProperty, getStmtTerm, getURI, hasLiteral, hasLiteral, hasLiteral, hasLiteral, hasLiteral, hasLiteral, hasProperty, hasProperty, hasProperty, hasProperty, hasURI, listProperties, listProperties, listProperties, removeAll, removeProperties, toString
  • Method Details

    • isProperty

      default boolean isProperty()
      Specified by:
      isProperty in interface org.apache.jena.rdf.model.Property
      See Also:
      • Property.isProperty()
    • addComment

      default P 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 P 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 P 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 P 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 P 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 P 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)