org.universAAL.middleware.service.owls.process
Class ProcessParameter

Package class diagram package ProcessParameter
java.lang.Object
  extended by org.universAAL.middleware.rdf.Resource
      extended by org.universAAL.middleware.rdf.FinalizedResource
          extended by org.universAAL.middleware.rdf.Variable
              extended by org.universAAL.middleware.service.owls.process.ProcessParameter
Direct Known Subclasses:
ProcessInput, ProcessOutput

public class ProcessParameter
extends Variable

Implementation of process:Parameter (xmlns:process="http://www.daml.org/services/owl-s/1.1/Process.owl#"). A parameter has an overall type and a value that can be set differently in different utilization contexts, unless it is a constant.

This implementation of process:Parameter, however, differs from the OWL-S process ontology in the following way:

  1. Three uAAL-specific properties are added in order to be able to define cardinality restrictions on process:parameterValue. All three are optional properties and accept only positive integers. Negative values and zero will simply be ignored. The corresponding properties are cardinality for specifying a precise cardinality, maxCardinality for specifying the maximum number of values assignable to the parameter, and minCardinality for specifying the minimum number of values to be assigned to the parameter. The cardinality property is not visible at the programming level and is only used in serializations, when both maxCardinality and minCardinality have the same value in order to produce shorter serializations. If no value is specified for maxCardinality, Integer.MAX_VALUE is assumed; in case of minCardinality, zero is assumed, which means that the parameter is an optional parameter. Hence, the original process:parameterType specifies the type of a single value and the above cardinality specifications determine how many of such values can be assigned to process:parameterValue.
  2. If a parameter is optional (no minCardinality restriction specified) but references to it are used in the definition of service effects or restrictions, then its default value must be specified using a uAAL-specific property, namely defaultValue.

Author:
mtazari

Field Summary
static String MY_URI
           
static String OWLS_PROCESS_NAMESPACE
           
static String PROP_OWLS_PROCESS_PARAMETER_TYPE
           
static String PROP_OWLS_PROCESS_PARAMETER_VALUE
           
static String PROP_OWLS_VALUE_FROM_PROCESS
           
static String PROP_OWLS_VALUE_OF_THE_VAR
           
static String PROP_PARAMETER_CARDINALITY
           
static String PROP_PARAMETER_DEFAULT_VALUE
           
static String PROP_PARAMETER_MAX_CARDINALITY
           
static String PROP_PARAMETER_MIN_CARDINALITY
           
static String TYPE_OWLS_VALUE_OF
           
 
Fields inherited from class org.universAAL.middleware.rdf.Variable
VAR_uAAL_ACCESSING_BUS_MEMBER, VAR_uAAL_ACCESSING_HUMAN_USER, VAR_uAAL_CURRENT_DATETIME, VAR_uAAL_SERVICE_TO_SELECT
 
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
ProcessParameter(String uri, String subType)
           
 
Method Summary
 Resource asVariableReference()
          Create a variable reference (a resource of OWL-S http://www.daml.org/services/owl-s/1.1/Process.owl#ValueOf class) from this ProcessParameter
static boolean checkDeserialization(Object o)
           
 Object getDefaultValue()
          Returns the default value of this parameter
 int getMaxCardinality()
          Returns the maximal cardinality of this parameter
 int getMinCardinality()
          Returns the minimal cardinality of this parameter
 String getParameterType()
          Returns the parameter type of this parameter
 Object getParameterValue()
          Returns the value of this parameter
static boolean isVarRef(Object o)
          Return true iff the object is Variable Reference (a resource of OWL-S http://www.daml.org/services/owl-s/1.1/Process.owl#ValueOf class)
 boolean isWellFormed()
          return true iff this process parameter is well formed (the properties have consistent values)
static Object resolveVarRef(Object o, HashMap context)
          Return the variable from the variable reference, either by the property PROP_OWLS_VALUE_OF_THE_VAR (http://www.daml.org/services/owl-s/1.1/Process.owl#theVar) or from the context.
 boolean setCardinality(int max, int min)
          Set cardinality of the process parameter
 boolean setDefaultValue(Object value)
          Set the default value of this parameter
 boolean setParameterType(String typeURI)
          Set the parameter type of this parameter
 boolean setParameterValue(Object value)
          Set the value of this parameter
 boolean setProperty(String prop, Object val)
          Set a value of a property for this process parameter
 
Methods inherited from class org.universAAL.middleware.rdf.Variable
register
 
Methods inherited from class org.universAAL.middleware.rdf.FinalizedResource
addType, getLocalName, getNamespace, getProperty, getPropertyURIs, getType, getTypes, getURI, hasQualifiedName, isAnon, numberOfProperties
 
Methods inherited from class org.universAAL.middleware.rdf.Resource
addMultiLangProp, asList, asList, asRDFList, changeProperty, copy, deepCopy, equals, generateAnonURI, getDefaultLang, getFilename, getMultiLangProp, getOrConstructLabel, getPropSerializationType, getResource, getResourceComment, getResourceLabel, getStaticFieldValue, hashCode, hasProperty, isAnon, isBlockingAddingTypes, isClosedCollection, isQualifiedName, literal, 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

OWLS_PROCESS_NAMESPACE

public static final String OWLS_PROCESS_NAMESPACE
See Also:
Constant Field Values

MY_URI

public static final String MY_URI
See Also:
Constant Field Values

PROP_OWLS_PROCESS_PARAMETER_TYPE

public static final String PROP_OWLS_PROCESS_PARAMETER_TYPE
See Also:
Constant Field Values

PROP_OWLS_PROCESS_PARAMETER_VALUE

public static final String PROP_OWLS_PROCESS_PARAMETER_VALUE
See Also:
Constant Field Values

PROP_PARAMETER_DEFAULT_VALUE

public static final String PROP_PARAMETER_DEFAULT_VALUE
See Also:
Constant Field Values

PROP_PARAMETER_CARDINALITY

public static final String PROP_PARAMETER_CARDINALITY
See Also:
Constant Field Values

PROP_PARAMETER_MAX_CARDINALITY

public static final String PROP_PARAMETER_MAX_CARDINALITY
See Also:
Constant Field Values

PROP_PARAMETER_MIN_CARDINALITY

public static final String PROP_PARAMETER_MIN_CARDINALITY
See Also:
Constant Field Values

PROP_OWLS_VALUE_OF_THE_VAR

public static final String PROP_OWLS_VALUE_OF_THE_VAR
See Also:
Constant Field Values

PROP_OWLS_VALUE_FROM_PROCESS

public static final String PROP_OWLS_VALUE_FROM_PROCESS
See Also:
Constant Field Values

TYPE_OWLS_VALUE_OF

public static final String TYPE_OWLS_VALUE_OF
See Also:
Constant Field Values
Constructor Detail

ProcessParameter

public ProcessParameter(String uri,
                        String subType)
Method Detail

checkDeserialization

public static final boolean checkDeserialization(Object o)

isVarRef

public static final boolean isVarRef(Object o)
Return true iff the object is Variable Reference (a resource of OWL-S http://www.daml.org/services/owl-s/1.1/Process.owl#ValueOf class)

Parameters:
o - - the object to test
Returns:
- true iff the object is a resource of OWL-S ValueOf class

resolveVarRef

public static final Object resolveVarRef(Object o,
                                         HashMap context)
Return the variable from the variable reference, either by the property PROP_OWLS_VALUE_OF_THE_VAR (http://www.daml.org/services/owl-s/1.1/Process.owl#theVar) or from the context.

Parameters:
o - - the variable reference
context - - the context
Returns:
- the variable

asVariableReference

public Resource asVariableReference()
Create a variable reference (a resource of OWL-S http://www.daml.org/services/owl-s/1.1/Process.owl#ValueOf class) from this ProcessParameter

Returns:
the Variable Reference resource

getMaxCardinality

public int getMaxCardinality()
Returns the maximal cardinality of this parameter

Returns:
- the maximal cardinality

getMinCardinality

public int getMinCardinality()
Returns the minimal cardinality of this parameter

Specified by:
getMinCardinality in class Variable
Returns:
- the minimal cardinality

getDefaultValue

public Object getDefaultValue()
Returns the default value of this parameter

Specified by:
getDefaultValue in class Variable
Returns:
- the object representing the default value

getParameterType

public String getParameterType()
Returns the parameter type of this parameter

Specified by:
getParameterType in class Variable
Returns:
String - the parameter type

getParameterValue

public Object getParameterValue()
Returns the value of this parameter

Returns:
- the object representing the value

isWellFormed

public boolean isWellFormed()
return true iff this process parameter is well formed (the properties have consistent values)

Overrides:
isWellFormed in class Resource

setCardinality

public final boolean setCardinality(int max,
                                    int min)
Set cardinality of the process parameter

Parameters:
max - - maximal cardinality
min - - minimal cardinality

setDefaultValue

public final boolean setDefaultValue(Object value)
Set the default value of this parameter

Parameters:
value - - the object representing the default value

setParameterType

public final boolean setParameterType(String typeURI)
Set the parameter type of this parameter

Parameters:
typeURI - - the URI of the parameter type

setParameterValue

public final boolean setParameterValue(Object value)
Set the value of this parameter

Parameters:
value - - the object representing the value

setProperty

public boolean setProperty(String prop,
                           Object val)
Set a value of a property for this process parameter

Overrides:
setProperty in class Resource
Parameters:
prop - - the property to set
val - - the value to set for the property
Returns:
true if the property changed as a result of the call


Copyright © 2014 universAAL Consortium. All Rights Reserved.