Module org.apache.jena.ontapi
Package org.apache.jena.ontapi.model
Interface OntDataRange.Restriction
- All Superinterfaces:
org.apache.jena.graph.FrontsNode,OntDataRange,OntDataRange.Combination<OntFacetRestriction>,OntObject,org.apache.jena.rdf.model.RDFNode,org.apache.jena.rdf.model.Resource
- All Known Implementing Classes:
OntDataRangeImpl.RestrictionImpl
- Enclosing interface:
- OntDataRange
public static interface OntDataRange.Restriction
extends OntDataRange.Combination<OntFacetRestriction>
- See Also:
-
- 7.5 Datatype Restrictions
OntFacetRestrictionOntModel.createFacetRestriction(Class, Literal)CreateRanges.createDataRestriction(Named, Collection)
-
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 -
Method Summary
Modifier and TypeMethodDescriptiondefault OntDataRange.RestrictionaddFacet(Class<? extends OntFacetRestriction> type, org.apache.jena.rdf.model.Literal literal) Adds a facet restriction to the end of the []-list.default <X extends org.apache.jena.rdf.model.RDFNode>
XSafely converts this RDF resource to the giventypeinterface, if it is possible.getList()Gets a modifiable []-list with items of the typeE.getModel()Returns the ontology model associated with this resource.getValue()Gets an RDF-value (a filler in OWL-API terms) encapsulated by this expression (that can be eitherclassordata rangeexpression).booleanisLocal()Determines if this Ontology Resource is locally defined.default OntDataRange.RestrictionsetComponents(Collection<OntFacetRestriction> components) Replaces the existing []-list content with the specified one, that is given in the form ofCollection.default OntDataRange.RestrictionsetComponents(OntFacetRestriction... values) Replaces the existing []-list content with the specified one, that is given in the form of vararg array.setValue(OntDataRange.Named value) Sets the specified value (a filler in OWL-API terms) into thisclassordata rangeexpression.spec()Lists all characteristic statements of the ontology resource, i.e., all those statements which completely determine this object nature according to the OWL2 specification.Methods inherited from interface org.apache.jena.graph.FrontsNode
asNodeMethods inherited from interface org.apache.jena.ontapi.model.OntDataRange
arity, asNamedMethods inherited from interface org.apache.jena.ontapi.model.OntObject
addAnnotation, addAnnotation, addAnnotation, addComment, addComment, addLabel, addLabel, addStatement, annotate, annotate, annotations, annotationValues, annotationValues, clearAnnotations, content, getComment, getComment, getLabel, getLabel, getMainStatement, getRequiredProperty, hasType, objects, objects, objectType, remove, 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
-
spec
Stream<OntStatement> spec()Lists all characteristic statements of the ontology resource, i.e., all those statements which completely determine this object nature according to the OWL2 specification. For non-composite objects the result might contain only theroot statement. For composite objects (usually anonymous resources: disjoint sections, class expression, etc.) the result would contain all statements in the graph directly related to the object but without statements that relate to the object components. The return stream is ordered and, in most cases, the expressionthis.spec().findFirst().get()returns the same statement asthis.getRoot(). Object annotations are not included in the resultant stream.For OWL Entities the returned stream will contain only a single main statement (i.e.
OntObject.getMainStatement()), or even will be empty for built-in entities and individuals. The result stream forRestriction Data Rangealso includesfacet restrinctiondefinition triples.- Specified by:
specin interfaceOntObject- Returns:
StreamofOntStatements.- See Also:
-
addFacet
default OntDataRange.Restriction addFacet(Class<? extends OntFacetRestriction> type, org.apache.jena.rdf.model.Literal literal) Adds a facet restriction to the end of the []-list.- Parameters:
type- subclass ofOntFacetRestriction, notnullliteral- value, notnull- Returns:
- this instance to allow cascading calls
-
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)
-
setComponents
Replaces the existing []-list content with the specified one, that is given in the form of vararg array.- Parameters:
values- anArrayof the typeV- Returns:
- this instance to allow cascading calls
-
setComponents
Replaces the existing []-list content with the specified one, that is given in the form ofCollection. Nulls and self-references are not allowed.- Parameters:
components- aCollectionof the typeV- Returns:
- this instance to allow cascading calls
- Throws:
OntJenaException- in case of wrong input
-
getList
OntList<OntFacetRestriction> getList()Gets a modifiable []-list with items of the typeE.- Returns:
Ontology []-listwith items of the typeE
-
setValue
Sets the specified value (a filler in OWL-API terms) into thisclassordata rangeexpression.A
valuecan benullif this is a Cardinality Restriction (the null-filler is considered asowl:Thingfor an object restriction and asRDFS.Literalfor a data restriction).- Parameters:
value-V, possiblenullin case of Cardinality Restriction- Returns:
- this instance to allow cascading calls
- See Also:
-
HasValue.getValue()
-
getValue
OntDataRange.Named getValue()Gets an RDF-value (a filler in OWL-API terms) encapsulated by this expression (that can be eitherclassordata rangeexpression).The result is not
nulleven if it is an Unqualified Cardinality Restriction, that has no explicit filler in RDF (the filler is expected to be eitherowl:Thingfor object restriction orRDFS.Literalfor data restriction).- Returns:
V, notnull- See Also:
-
SetValue.setValue(RDFNode)
-