- 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
Interface encapsulating an Ontology Datatype,
OWL Entity,
a named data range expression.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.jena.ontapi.model.OntDataRange
OntDataRange.Combination<N extends org.apache.jena.rdf.model.RDFNode>, OntDataRange.ComplementOf, OntDataRange.IntersectionOf, OntDataRange.Named, OntDataRange.OneOf, OntDataRange.Restriction, OntDataRange.UnionOf -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptiondefault OntDataRange.NamedaddComment(String txt) Creates_:this rdfs:comment "txt"^^xsd:stringstatement.default OntDataRange.NamedaddComment(String txt, String lang) Adds the given localized text annotation with builtinrdfs:commentpredicate.default OntDataRange.NamedaddEquivalentClass(OntDataRange other) Creates an equivalent class statement with the givenData Range expression.default OntStatementCreates an equivalent class statement with the givenData Range expression.default OntDataRange.NamedCreates_:this rdfs:label "txt"^^xsd:stringstatement.default OntDataRange.NamedAdds the given localized text annotation with builtinrdfs:labelpredicate.default OntDataRange.Namedannotate(OntAnnotationProperty predicate, String txt, String lang) Adds a language-tagged text for this object and the givenpredicatedefault OntDataRange.Namedannotate(OntAnnotationProperty predicate, org.apache.jena.rdf.model.RDFNode value) Annotates the object with the givenpredicateandvalue.default OntDataRange.NamedasNamed()default org.apache.jena.rdf.model.LiteralcreateLiteral(Object obj) Builds a typed literal from its value form given as an object.default org.apache.jena.rdf.model.LiteralcreateLiteral(String lex) Builds a typed literal from its value form.default Stream<OntDataRange>Lists all equivalent data ranges.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.default OntDataRange.NamedremoveEquivalentClass(org.apache.jena.rdf.model.Resource other) Removes the given equivalent data range, that is attached to this data-type on predicateowl:equivalenrClass, including all the statement's related annotations.default org.apache.jena.datatypes.RDFDatatypeCreates a Jena Datatype.Methods inherited from interface org.apache.jena.graph.FrontsNode
asNodeMethods inherited from interface org.apache.jena.ontapi.model.OntDataRange
arityMethods inherited from interface org.apache.jena.ontapi.model.OntObject
addAnnotation, addAnnotation, addAnnotation, addStatement, annotations, annotationValues, annotationValues, clearAnnotations, content, 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
-
asNamed
- Specified by:
asNamedin interfaceOntDataRange
-
equivalentClasses
Lists all equivalent data ranges. The pattern to search isDN owl:equivalentClass D, whereDNis thisData Type, andDis a search object, thedata-range expression.- Returns:
StreamofOntDataRanges- See Also:
-
addEquivalentClassStatement
Creates an equivalent class statement with the givenData Range expression.- Parameters:
other-OntDataRange, notnull- Returns:
OntStatementto allow the subsequent annotations addition- See Also:
-
addEquivalentClass
Creates an equivalent class statement with the givenData Range expression.- Parameters:
other-OntDataRange, notnull- Returns:
- this instance to allow cascading calls
- See Also:
-
removeEquivalentClass
Removes the given equivalent data range, that is attached to this data-type on predicateowl:equivalenrClass, including all the statement's related annotations. No-op in case nothing is found. Thenullinput means removing allowl:equivalentClassstatements with all their annotations.- Parameters:
other-Resource, ornullto 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
Builds a typed literal from its value form given as an object. Note: there is no validation for lexical form.- Parameters:
obj- anything, notnull- Returns:
Literal
-
createLiteral
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, notnull- Returns:
Literal- See Also:
-
Model.createTypedLiteral(String, RDFDatatype)
-
addComment
Creates_:this rdfs:comment "txt"^^xsd:stringstatement.- Specified by:
addCommentin interfaceOntObject- Parameters:
txt- String, notnull- Returns:
- this object to allow cascading calls
- See Also:
-
addComment
Adds the given localized text annotation with builtinrdfs:commentpredicate.- Specified by:
addCommentin interfaceOntObject- Parameters:
txt- String, the literal lexical form, notnulllang- String, the language tag, nullable- Returns:
- this object to allow cascading calls
- See Also:
-
addLabel
Creates_:this rdfs:label "txt"^^xsd:stringstatement. -
addLabel
Adds the given localized text annotation with builtinrdfs:labelpredicate. -
annotate
Adds a language-tagged text for this object and the givenpredicate- Specified by:
annotatein interfaceOntObject- Parameters:
predicate-OntAnnotationProperty- named annotation property, notnulltxt- String, the literal lexical form, cannot benulllang- String, the language tag, can benull- 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 givenpredicateandvalue.- Specified by:
annotatein interfaceOntObject- Parameters:
predicate-OntAnnotationProperty- named annotation property, notnullvalue-RDFNode- the value: uri-resource, literal or anonymous individual, notnull- 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:
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)
-