- 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.Named
addComment
(String txt) Creates_:this rdfs:comment "txt"^^xsd:string
statement.default OntDataRange.Named
addComment
(String txt, String lang) Adds the given localized text annotation with builtinrdfs:comment
predicate.default OntDataRange.Named
addEquivalentClass
(OntDataRange other) Creates an equivalent class statement with the givenData Range expression
.default OntStatement
Creates an equivalent class statement with the givenData Range expression
.default OntDataRange.Named
Creates_:this rdfs:label "txt"^^xsd:string
statement.default OntDataRange.Named
Adds the given localized text annotation with builtinrdfs:label
predicate.default OntDataRange.Named
annotate
(OntAnnotationProperty predicate, String txt, String lang) Adds a language-tagged text for this object and the givenpredicate
default OntDataRange.Named
annotate
(OntAnnotationProperty predicate, org.apache.jena.rdf.model.RDFNode value) Annotates the object with the givenpredicate
andvalue
.default OntDataRange.Named
asNamed()
default org.apache.jena.rdf.model.Literal
createLiteral
(Object obj) Builds a typed literal from its value form given as an object.default org.apache.jena.rdf.model.Literal
createLiteral
(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 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.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 predicateowl:equivalenrClass
, including all the statement's related annotations.default org.apache.jena.datatypes.RDFDatatype
Creates a Jena Datatype.Methods inherited from interface org.apache.jena.graph.FrontsNode
asNode
Methods inherited from interface org.apache.jena.ontapi.model.OntDataRange
arity
Methods 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, 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
-
asNamed
- Specified by:
asNamed
in interfaceOntDataRange
-
equivalentClasses
Lists all equivalent data ranges. The pattern to search isDN owl:equivalentClass D
, whereDN
is thisData Type
, andD
is a search object, thedata-range expression
.- Returns:
Stream
ofOntDataRange
s- See Also:
-
addEquivalentClassStatement
Creates an equivalent class statement with the givenData Range expression
.- Parameters:
other
-OntDataRange
, notnull
- Returns:
OntStatement
to 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. Thenull
input means removing allowl:equivalentClass
statements with all their annotations.- Parameters:
other
-Resource
, ornull
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
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:string
statement.- Specified by:
addComment
in interfaceOntObject
- Parameters:
txt
- String, notnull
- Returns:
- this object to allow cascading calls
- See Also:
-
addComment
Adds the given localized text annotation with builtinrdfs:comment
predicate.- Specified by:
addComment
in interfaceOntObject
- Parameters:
txt
- String, the literal lexical form, notnull
lang
- String, the language tag, nullable- Returns:
- this object to allow cascading calls
- See Also:
-
addLabel
Creates_:this rdfs:label "txt"^^xsd:string
statement. -
addLabel
Adds the given localized text annotation with builtinrdfs:label
predicate. -
annotate
Adds a language-tagged text for this object and the givenpredicate
- Specified by:
annotate
in interfaceOntObject
- Parameters:
predicate
-OntAnnotationProperty
- named annotation property, notnull
txt
- String, the literal lexical form, cannot benull
lang
- 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 givenpredicate
andvalue
.- Specified by:
annotate
in interfaceOntObject
- Parameters:
predicate
-OntAnnotationProperty
- named annotation property, notnull
value
-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:
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)
-