org.universAAL.middleware.owl
Class BoundedValueRestriction

Package class diagram package BoundedValueRestriction
java.lang.Object
  extended by org.universAAL.middleware.rdf.Resource
      extended by org.universAAL.middleware.owl.TypeExpression
          extended by org.universAAL.middleware.owl.TypeRestriction
              extended by org.universAAL.middleware.owl.BoundedValueRestriction
Direct Known Subclasses:
DoubleRestriction, FloatRestriction, IndividualRestriction, IntRestriction, LongRestriction

public abstract class BoundedValueRestriction
extends TypeRestriction

Implementation of XSD Value Restrictions: it contains all values (literals or individuals) that meet the specified conditions. These conditions are either:

  1. min inclusive
  2. min exclusive
  3. max inclusive
  4. max exclusive
It is possible to define a condition on the min value and on the max value in the same BoundedValueRestriction.

Author:
Carsten Stockloew

Nested Class Summary
 
Nested classes/interfaces inherited from class org.universAAL.middleware.owl.TypeRestriction
TypeRestriction.Facet
 
Field Summary
protected static String XSD_FACET_MAX_EXCLUSIVE
           
protected static String XSD_FACET_MAX_INCLUSIVE
           
protected static String XSD_FACET_MIN_EXCLUSIVE
           
protected static String XSD_FACET_MIN_INCLUSIVE
           
 
Fields inherited from class org.universAAL.middleware.owl.TypeRestriction
PROP_OWL_ON_DATATYPE, PROP_OWL_WITH_RESTRICTIONS, restrictions
 
Fields inherited from class org.universAAL.middleware.owl.TypeExpression
EXCEPTION_TTL, OWL_CLASS, OWL_NAMESPACE, PROP_RDFS_SUB_CLASS_OF, RDFS_DATATYPE, TYPE_OWL_THING
 
Fields inherited from class org.universAAL.middleware.rdf.Resource
ANON_URI_PREFIX, blockAddingTypes, isXMLLiteral, ns_delim_index, PROP_RDF_FIRST, PROP_RDF_REST, PROP_RDF_TYPE, PROP_RDFS_COMMENT, PROP_RDFS_LABEL, PROP_SERIALIZATION_FULL, PROP_SERIALIZATION_OPTIONAL, PROP_SERIALIZATION_REDUCED, PROP_SERIALIZATION_UNDEFINED, PROP_uAAL_INVOLVED_HUMAN_USER, props, RDF_EMPTY_LIST, RDF_NAMESPACE, RDFS_NAMESPACE, TYPE_RDF_LIST, TYPE_RDFS_CLASS, uAAL_NAMESPACE_PREFIX, uAAL_SERVICE_NAMESPACE, uAAL_VOCABULARY_NAMESPACE, uri
 
Constructor Summary
protected BoundedValueRestriction(String datatypeURI)
           
protected BoundedValueRestriction(String datatypeURI, Comparable min, boolean minInclusive, Comparable max, boolean maxInclusive)
           
 
Method Summary
protected  TypeExpression copyTo(BoundedValueRestriction copy)
          Helper method to copy Restrictions.
 Comparable getLowerbound()
           
protected  Comparable getNext(Comparable c)
           
protected  Comparable getPrevious(Comparable c)
           
 Comparable getUpperbound()
           
 boolean hasMember(Object member, HashMap context, int ttl, List<MatchLogEntry> log)
          Returns true if the given object is a member of the class represented by this type expression, otherwise false.
 boolean isDisjointWith(TypeExpression other, HashMap context, int ttl, List<MatchLogEntry> log)
          Returns true if the given type expression has no member in common with the class represented by this type expression, otherwise false.
 boolean isWellFormed()
          Returns true, if the state of the resource is valid, otherwise false.
 boolean matches(TypeExpression subset, HashMap context, int ttl, List<MatchLogEntry> log)
          Returns true if the given type expression is a subset of the class represented by this type expression, otherwise false.
 boolean setProperty(String propURI, Object o)
          Adds a statement with this resource as the subject, the given propURI as the predicate and the given value as the object.
 
Methods inherited from class org.universAAL.middleware.owl.TypeRestriction
addConstrainingFacet, getNamedSuperclasses, getTypeURI, getUpperEnumeration, iterate
 
Methods inherited from class org.universAAL.middleware.owl.TypeExpression
checkTTL, collectTypesMinimized, copy, getDefaultMatchmakingTTL, hasMember, hasMember, isDisjointWith, isDisjointWith, matches, matches, synchronize
 
Methods inherited from class org.universAAL.middleware.rdf.Resource
addMultiLangProp, addType, asList, asList, asRDFList, changeProperty, copy, deepCopy, equals, generateAnonURI, getDefaultLang, getFilename, getLocalName, getMultiLangProp, getNamespace, getOrConstructLabel, getProperty, getPropertyURIs, getPropSerializationType, getResource, getResourceComment, getResourceLabel, getStaticFieldValue, getType, getTypes, getURI, hashCode, hasProperty, hasQualifiedName, isAnon, isAnon, isBlockingAddingTypes, isClosedCollection, isQualifiedName, literal, numberOfProperties, representsQualifiedURI, serializesAsXMLLiteral, setPropertyPath, setPropertyPath, setPropertyPathFromOffset, setResourceComment, setResourceLabel, toString, toStringRecursive, toStringRecursive, unliteral
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

XSD_FACET_MIN_INCLUSIVE

protected static final String XSD_FACET_MIN_INCLUSIVE

XSD_FACET_MAX_INCLUSIVE

protected static final String XSD_FACET_MAX_INCLUSIVE

XSD_FACET_MIN_EXCLUSIVE

protected static final String XSD_FACET_MIN_EXCLUSIVE

XSD_FACET_MAX_EXCLUSIVE

protected static final String XSD_FACET_MAX_EXCLUSIVE
Constructor Detail

BoundedValueRestriction

protected BoundedValueRestriction(String datatypeURI)

BoundedValueRestriction

protected BoundedValueRestriction(String datatypeURI,
                                  Comparable min,
                                  boolean minInclusive,
                                  Comparable max,
                                  boolean maxInclusive)
Method Detail

copyTo

protected TypeExpression copyTo(BoundedValueRestriction copy)
Helper method to copy Restrictions.

See Also:
TypeExpression.copy()

getLowerbound

public Comparable getLowerbound()

getUpperbound

public Comparable getUpperbound()

getNext

protected Comparable getNext(Comparable c)

getPrevious

protected Comparable getPrevious(Comparable c)

setProperty

public boolean setProperty(String propURI,
                           Object o)
Description copied from class: Resource
Adds a statement with this resource as the subject, the given propURI as the predicate and the given value as the object. Subclasses must override this in order to decide if the statement to be added fits the general class constraints. If not, the call of this method should be ignored. For each property only one single call may be made to this method, unless subsequent calls to this method for setting the value of the same property are treated as an update for an update-able property. Multi-valued properties must be set using an instance of List. The differentiation, if a such list should be treated as an rdf:List, can be made with the help of Resource.isClosedCollection(String). The default implementation here accepts all property-value pairs blindly except for rdf:type which is handled if the value is a type URI, a Resource or a java.util.List of them.

Note: The setting of the property rdf:type is being handled by this class via the final methods Resource.addType(String, boolean), Resource.getType(), and Resource.getTypes(). Although these methods give the view of handling type URIs as strings, but in reality the types are stored as direct instances of this class. So, the subclasses should ignore calls for setting rdf:type; if not, then the subclass must pay attention that the value should be a List of direct instances of this class so that (1) the Resource.toString() method returns just the URI and (2) the serializers get no problems with the value. Also, settings via subclasses may be overwritten by this class if a subsequent call to Resource.addType(String, boolean) is made.

Overrides:
setProperty in class TypeRestriction
Returns:
true if the property changed as a result of the call
See Also:
Resource.setProperty(String, Object)

hasMember

public boolean hasMember(Object member,
                         HashMap context,
                         int ttl,
                         List<MatchLogEntry> log)
Description copied from class: TypeExpression
Returns true if the given object is a member of the class represented by this type expression, otherwise false. The context table maps the URIs of certain variables onto values currently assigned to them. The variables are either standard variables managed by the universAAL middleware or parameters of a specific service in whose context this method is called. Both the object whose membership is going to be checked and this type expression may contain references to such variables. If there is already a value assigned to such a referenced variable, it must be replaced by the associated value, otherwise this method may expand the context table by deriving a value for such unassigned but referenced variables with which the membership can be asserted. In case of returning true, the caller must check the size of the context table to see if new conditions are added in order for the membership to be asserted. If the context table is null, the method does a global and unconditional check.

Specified by:
hasMember in class TypeExpression
Parameters:
member - the object whose membership is going to be checked
context - context of the matchmaking. May be null.
ttl - time-to-live parameter
log - list that can be filled with log entries. May be null.
Returns:
true if the specified member is a member of this type expression
See Also:
Constants.VAR_uAAL_ACCESSING_BUS_MEMBER, Constants.VAR_uAAL_ACCESSING_HUMAN_USER, Constants.VAR_uAAL_CURRENT_DATETIME, Constants.VAR_uAAL_SERVICE_TO_SELECT

isDisjointWith

public boolean isDisjointWith(TypeExpression other,
                              HashMap context,
                              int ttl,
                              List<MatchLogEntry> log)
Description copied from class: TypeExpression
Returns true if the given type expression has no member in common with the class represented by this type expression, otherwise false. The context table maps the URIs of certain variables onto values currently assigned to them. The variables are either standard variables managed by the universAAL middleware or parameters of a specific service in whose context this method is called. Both of the type expressions may contain references to such variables. If there is already a value assigned to such a referenced variable, it must be replaced by the associated value, otherwise this method may expand the context table by deriving a value for such unassigned but referenced variables with which the disjointness of the two classes can be asserted. In case of returning true, the caller must check the size of the context table to see if new conditions are added in order for the disjointness to be asserted. If the context table is null, the method does a global and unconditional check.

Specified by:
isDisjointWith in class TypeExpression
Parameters:
other - the type expression with which the disjointness is going to be checked
context - context of the matchmaking. May be null.
ttl - time-to-live parameter
log - list that can be filled with log entries. May be null.
Returns:
true if the given type expression has no member in common with the class represented by this type expression, otherwise false
See Also:
Constants.VAR_uAAL_ACCESSING_BUS_MEMBER, Constants.VAR_uAAL_ACCESSING_HUMAN_USER, Constants.VAR_uAAL_CURRENT_DATETIME, Constants.VAR_uAAL_SERVICE_TO_SELECT

isWellFormed

public boolean isWellFormed()
Description copied from class: TypeExpression
Returns true, if the state of the resource is valid, otherwise false. Redefined in this class as abstract to force subclasses to override it.

Specified by:
isWellFormed in class TypeExpression
See Also:
Resource.isWellFormed()

matches

public boolean matches(TypeExpression subset,
                       HashMap context,
                       int ttl,
                       List<MatchLogEntry> log)
Description copied from class: TypeExpression
Returns true if the given type expression is a subset of the class represented by this type expression, otherwise false. The context table maps the URIs of certain variables onto values currently assigned to them. The variables are either standard variables managed by the universAAL middleware or parameters of a specific service in whose context this method is called. Both of the type expressions may contain references to such variables. If there is already a value assigned to such a referenced variable, it must be replaced by the associated value, otherwise this method may expand the context table by deriving a value for such unassigned but referenced variables with which the compatibility of the two classes can be asserted. In case of returning true, the caller must check the size of the context table to see if new conditions are added in order for the compatibility to be asserted. If the context table is null, the method does a global and unconditional check.

Specified by:
matches in class TypeExpression
Parameters:
subset - the type expression with which the compatibility is going to be checked
context - context of the matchmaking. May be null.
ttl - time-to-live parameter
log - list that can be filled with log entries. May be null.
Returns:
true if the given type expression is a subset of the class represented by this type expression, otherwise false
See Also:
Constants.VAR_uAAL_ACCESSING_BUS_MEMBER, Constants.VAR_uAAL_ACCESSING_HUMAN_USER, Constants.VAR_uAAL_CURRENT_DATETIME, Constants.VAR_uAAL_SERVICE_TO_SELECT


Copyright © 2014 universAAL Consortium. All Rights Reserved.