|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.universAAL.middleware.rdf.Resource org.universAAL.middleware.owl.TypeExpression
public abstract class TypeExpression
A class for the concept of OWL class expressions and OWL data ranges, which represent sets of individuals by formally specifying conditions on the individuals' properties. Example conditions are intersection of individuals, or restrictions. Each type expression represents a set of individuals (just like a class in an object-oriented programming language represents a set of objects). There are three main methods to compare type expression:
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.
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 goal of the method 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. If the
context
map is null, the method does a global and unconditional
check.IllegalArgumentException
is thrown with the text provided in
EXCEPTION_TTL
. This can be used to avoid cycles in the type
expression.
Field Summary | |
---|---|
static String |
EXCEPTION_TTL
|
static String |
OWL_CLASS
URI for owl:class. |
static String |
OWL_NAMESPACE
URI namespace for OWL. |
static String |
PROP_RDFS_SUB_CLASS_OF
URI for rdfs:subClassOf. |
static String |
RDFS_DATATYPE
URI for rdfs:Datatype. |
static String |
TYPE_OWL_THING
URI for 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 |
TypeExpression()
Constructor for use with serializers. |
protected |
TypeExpression(String uri)
Constructor to create a new instance with the given URI. |
protected |
TypeExpression(String[] additionalTypes)
Constructor. |
Method Summary | |
---|---|
protected int |
checkTTL(int ttl)
Check the time-to-live parameter. |
protected void |
collectTypesMinimized(String typeURI,
List l)
Provided that the given list is already a minimized list of type URIs, i.e. no two members have any hierarchical relationships with each other, adds the given typeURI to the list so that the above condition continues to hold and no information is lost. |
abstract TypeExpression |
copy()
Create a copy of this object, i.e. create a new object of this class and copy the necessary properties. |
static int |
getDefaultMatchmakingTTL()
Returns the default value for time-to-live. |
abstract String[] |
getNamedSuperclasses()
Get the set of class URIs for all super classes of the individuals of this class expression. |
abstract Object[] |
getUpperEnumeration()
Each type expression can contain multiple objects; this method returns this set of objects. |
boolean |
hasMember(Object member)
Returns true if the given object is a member of the class represented by this type expression, otherwise false. |
abstract 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 |
hasMember(Object member,
Hashtable context)
Deprecated. replaced by hasMember(Object, HashMap, int, List) . |
boolean |
isDisjointWith(TypeExpression other)
Returns true if the given type expression has no member in common with the class represented by this type expression, otherwise false. |
abstract 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 |
isDisjointWith(TypeExpression other,
Hashtable context)
Deprecated. replaced by #isDisjointWith(Object, HashMap, int, List) . |
abstract boolean |
isWellFormed()
Returns true, if the state of the resource is valid, otherwise false. |
boolean |
matches(TypeExpression subset)
Returns true if the given type expression is a subset of the class represented by this type expression, otherwise false. |
abstract 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 |
matches(TypeExpression subset,
Hashtable context)
Deprecated. replaced by #matches(Object, HashMap, int, List) . |
protected void |
synchronize(HashMap context,
HashMap cloned)
Synchronize two HashMap to ensure that the first HashMap contains a value for each key of the second HashMap. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String OWL_NAMESPACE
public static final String TYPE_OWL_THING
public static final String RDFS_DATATYPE
public static final String OWL_CLASS
public static final String PROP_RDFS_SUB_CLASS_OF
public static final String EXCEPTION_TTL
Constructor Detail |
---|
protected TypeExpression()
protected TypeExpression(String uri)
protected TypeExpression(String[] additionalTypes)
Method Detail |
---|
protected void collectTypesMinimized(String typeURI, List l)
public abstract TypeExpression copy()
public abstract String[] getNamedSuperclasses()
public abstract Object[] getUpperEnumeration()
public final boolean hasMember(Object member)
member
- the object whose membership is going to be checked
public final boolean hasMember(Object member, Hashtable context)
hasMember(Object, HashMap, int, List)
.
public abstract boolean hasMember(Object member, HashMap context, int ttl, List<MatchLogEntry> log)
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.
member
- the object whose membership is going to be checkedcontext
- context of the matchmaking. May be null.ttl
- time-to-live parameterlog
- list that can be filled with log entries. May be null.
Constants.VAR_uAAL_ACCESSING_BUS_MEMBER
,
Constants.VAR_uAAL_ACCESSING_HUMAN_USER
,
Constants.VAR_uAAL_CURRENT_DATETIME
,
Constants.VAR_uAAL_SERVICE_TO_SELECT
public final boolean isDisjointWith(TypeExpression other)
other
- the type expression with which the disjointness is going to be
checked
public final boolean isDisjointWith(TypeExpression other, Hashtable context)
#isDisjointWith(Object, HashMap, int, List)
.
public abstract boolean isDisjointWith(TypeExpression other, HashMap context, int ttl, List<MatchLogEntry> log)
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.
other
- the type expression with which the disjointness is going to be
checkedcontext
- context of the matchmaking. May be null.ttl
- time-to-live parameterlog
- list that can be filled with log entries. May be null.
Constants.VAR_uAAL_ACCESSING_BUS_MEMBER
,
Constants.VAR_uAAL_ACCESSING_HUMAN_USER
,
Constants.VAR_uAAL_CURRENT_DATETIME
,
Constants.VAR_uAAL_SERVICE_TO_SELECT
public abstract boolean isWellFormed()
isWellFormed
in class Resource
Resource.isWellFormed()
public final boolean matches(TypeExpression subset)
subset
- the type expression with which the compatibility is going to
be checked
public final boolean matches(TypeExpression subset, Hashtable context)
#matches(Object, HashMap, int, List)
.
public abstract boolean matches(TypeExpression subset, HashMap context, int ttl, List<MatchLogEntry> log)
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.
subset
- the type expression with which the compatibility is going to
be checkedcontext
- context of the matchmaking. May be null.ttl
- time-to-live parameterlog
- list that can be filled with log entries. May be null.
Constants.VAR_uAAL_ACCESSING_BUS_MEMBER
,
Constants.VAR_uAAL_ACCESSING_HUMAN_USER
,
Constants.VAR_uAAL_CURRENT_DATETIME
,
Constants.VAR_uAAL_SERVICE_TO_SELECT
protected void synchronize(HashMap context, HashMap cloned)
context
- The HashMap to be extended by (key/value)-pairs from the
second HashMap.cloned
- The second HashMap.protected int checkTTL(int ttl)
IllegalArgumentException
, otherwise the parameter will
be decreased by one and returned.
ttl
- the time-to-live value
IllegalArgumentException
- if the specified value is zero.public static final int getDefaultMatchmakingTTL()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |