org.semanticweb.HermiT.model.dataranges
Interface CanonicalDataRange

All Known Implementing Classes:
DatatypeRestriction, DatatypeRestrictionAnyURI, DatatypeRestrictionBoolean, DatatypeRestrictionDateTime, DatatypeRestrictionDateTimeFin, DatatypeRestrictionDouble, DatatypeRestrictionInteger, DatatypeRestrictionIntegerFin, DatatypeRestrictionLiteral, DatatypeRestrictionOWLRealPlus, DatatypeRestrictionString, EnumeratedDataRange

public interface CanonicalDataRange


Method Summary
 boolean accepts(DataConstant constant)
          Checks whether constant is the String representation of a value in the data range, where the string has to be interpreted according to the datatype URI.
 boolean canHandleAll(java.util.Set<DatatypeRestriction.DT> datatypes)
          Can be used to check whether the implementation supports the given set of datatypes, e.g., the implementation for integers supports long, unsignedByte, etc.
 void conjoinFacetsFrom(DataRange range)
          Conjoins the facet restrictions from the given data range, provided it is of the same concrete implementation, i.e., we can conjoins the facets of an instance of DatatypeRestrictionString to another instance of DatatypeRestrictionString.
 boolean datatypeAccepts(DataConstant constant)
          Can be used to check whether a given constant is in principle in the range of this implementation.
 boolean facetsAccept(DataConstant constant)
          Checks if the constant conforms to the facets
 DatatypeRestriction.DT getDatatype()
          The datatype implements this DataRange instance
 java.net.URI getDatatypeURI()
          The URI of the datatype that implements this DataRange instance
 java.math.BigInteger getEnumerationSize()
          Compute the set of String representations of the allowed values for this data range, provided it is finite.
 java.util.Set<DataConstant> getOneOf()
          Constants that are representing the allowed assignments for this datatype restriction.
 DataConstant getSmallestAssignment()
          Computes the lexicographically smallest assignment given the restrictions.
 boolean hasMinCardinality(java.math.BigInteger n)
          Checks whether the interpretation of this data range consists of at least n values.
 boolean isBottom()
          Checks whether this data range cannot contain values
 boolean isFinite()
          Checks whether the interpretation of this data range is necessarily finite.
 boolean isNegated()
          Checks whether this data range is negated.
 void negate()
          Negate this data range, i.e., if the range was negated it is no longer negated afterwards and if it was not negated it will be negated afterwards.
 boolean notOneOf(DataConstant constant)
          Adds constant to the values that are not allowed in this data range.
 void setNotOneOf(java.util.Set<DataConstant> notOneOf)
          A set of values that are not in the interpretation of this datatype restriction.
 void setOneOf(java.util.Set<DataConstant> oneOf)
          Defines the datatype restriction in terms of a set of constants.
 

Method Detail

getDatatypeURI

java.net.URI getDatatypeURI()
The URI of the datatype that implements this DataRange instance

Returns:
The URI for the type of the concrete implementation for this DataRange.

getDatatype

DatatypeRestriction.DT getDatatype()
The datatype implements this DataRange instance

Returns:
The datatype for the type of the concrete implementation for this DataRange.

isNegated

boolean isNegated()
Checks whether this data range is negated.

Returns:
true if negated and false otherwise.

negate

void negate()
Negate this data range, i.e., if the range was negated it is no longer negated afterwards and if it was not negated it will be negated afterwards.


isBottom

boolean isBottom()
Checks whether this data range cannot contain values

Returns:
true if the restrictions on this data range cause the interpretation of it to be empty and false otherwise.

isFinite

boolean isFinite()
Checks whether the interpretation of this data range is necessarily finite.

Returns:
true if this data range has only finite representations and false otherwise.

getOneOf

java.util.Set<DataConstant> getOneOf()
Constants that are representing the allowed assignments for this datatype restriction. The strings are String representations of the datatype that concretely implements the DataRange, e.g., if the concrete implementation has URI for integers, the returned strings have to be interpreted as integers.

Returns:
A set of constants that represent the current datatype restrictions and are to be interpreted according to the datatype URI of the concrete implementation of the DataRange.

setOneOf

void setOneOf(java.util.Set<DataConstant> oneOf)
Defines the datatype restriction in terms of a set of constants.

Parameters:
oneOf - A set of constants that are String representations of values that are to be interpreted according to the datatype URI of the concrete implementation of the DataRange

setNotOneOf

void setNotOneOf(java.util.Set<DataConstant> notOneOf)
A set of values that are not in the interpretation of this datatype restriction.

Parameters:
notOneOf - A set of constants that are String representations of values that are to be interpreted according to the datatype URI of the concrete implementation of the DataRange

notOneOf

boolean notOneOf(DataConstant constant)
Adds constant to the values that are not allowed in this data range.

Parameters:
constant - A constants that is a String representation of a value that is to be interpreted according to the datatype URI of the concrete implementation of the DataRange
Returns:
true if the notOneOf values did not already contain the given constant and false otherwise

conjoinFacetsFrom

void conjoinFacetsFrom(DataRange range)
                       throws java.lang.IllegalArgumentException
Conjoins the facet restrictions from the given data range, provided it is of the same concrete implementation, i.e., we can conjoins the facets of an instance of DatatypeRestrictionString to another instance of DatatypeRestrictionString.

Parameters:
range - a data range that is of the same concrete implementation as this.
Throws:
java.lang.IllegalArgumentException - if the concrete realisation of the given data range is different from the one for this data range.

facetsAccept

boolean facetsAccept(DataConstant constant)
Checks if the constant conforms to the facets

Parameters:
constant -
Returns:
true if no facets are present or if facets accept constant and false otherwise

accepts

boolean accepts(DataConstant constant)
Checks whether constant is the String representation of a value in the data range, where the string has to be interpreted according to the datatype URI.

Parameters:
constant - A String representation of a constant for this data range.
Returns:
true if constant represents a value in the interpretation of this data range and false otherwise.

canHandleAll

boolean canHandleAll(java.util.Set<DatatypeRestriction.DT> datatypes)
Can be used to check whether the implementation supports the given set of datatypes, e.g., the implementation for integers supports long, unsignedByte, etc.

Parameters:
datatypes - a set of datatypes
Returns:
true if the implementation can handle all the given datatypes and false otherwise

datatypeAccepts

boolean datatypeAccepts(DataConstant constant)
Can be used to check whether a given constant is in principle in the range of this implementation. Whether it conforms to the facets is not checked.

Parameters:
constant - a constant
Returns:
true if the constant has a datatype that in principle is ok for this datatype restriction and false otherwise

hasMinCardinality

boolean hasMinCardinality(java.math.BigInteger n)
Checks whether the interpretation of this data range consists of at least n values.

Parameters:
n -
Returns:
true if the interpretation of this data range allows for at least n values and false otherwise.

getEnumerationSize

java.math.BigInteger getEnumerationSize()
Compute the set of String representations of the allowed values for this data range, provided it is finite.

Returns:
The set of all Strings that are a representation of a value in the interpretation according to the datatype URI of this DataRange and null if the interpretation of this data range is infinite.

getSmallestAssignment

DataConstant getSmallestAssignment()
Computes the lexicographically smallest assignment given the restrictions.

Returns:
The lexicographically smallest assignment given the restrictions or null if none exists.