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

Package class diagram package ProcessResult
java.lang.Object
  extended by org.universAAL.middleware.rdf.Resource
      extended by org.universAAL.middleware.rdf.FinalizedResource
          extended by org.universAAL.middleware.service.owls.process.ProcessResult

public class ProcessResult
extends FinalizedResource

This class represents ProcessResult of OWL-S - http://www.daml.org/services/owl-s/1.1/Process.owl#Result

Author:
mtazari - Saied Tazari

Field Summary
static String MY_URI
           
static String PROP_OWLS_RESULT_HAS_EFFECT
           
static String PROP_OWLS_RESULT_WITH_OUTPUT
           
 
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
ProcessResult()
           
ProcessResult(String uri)
           
 
Method Summary
 void addAddEffect(PropertyPath ppath, Object value)
          Add "add" process effect with property path and value passed as parameters
 void addAggregatingOutputBinding(ProcessOutput toParam, AggregatingFilter filter)
          Add aggregated output binding to a process output parameter
 void addChangeEffect(PropertyPath ppath, Object value)
          Add "change" process effect with property path and value passed as parameters
 void addClassConversionOutputBinding(ProcessOutput toParam, PropertyPath sourceProp, TypeURI targetClass)
          Add class conversion output binding to a process output parameter
 void addLangConversionOutputBinding(ProcessOutput toParam, PropertyPath sourceProp, String targetLang)
          Add language conversion output binding to a process output parameter
 void addRemoveEffect(PropertyPath ppath)
          Add "remove" process effect with property path and value passed as parameters
 void addSimpleOutputBinding(ProcessOutput toParam, PropertyPath sourceProp)
          Add simple output binding to a process output parameter
 void addUnitConversionOutputBinding(ProcessOutput toParam, PropertyPath sourceProp, String targetUnit)
          Add unit conversion output binding to a process output parameter
static boolean checkEffects(Resource[] req, Resource[] offer, HashMap context)
          Verify that the process effects of offers match the ones of requests according to the context
static boolean checkEffects(Resource[] req, Resource[] offer, HashMap context, Long logID)
          Verify that the process effects of offers match the ones of requests according to the context
static boolean checkOutputBindings(Resource[] req, Resource[] offer, HashMap context, Long logID)
          Verify that the output bindings of offers match the ones of requests according to the context
 List getBindings()
          Return the list of output bindings ( a reference) of this process result
 List getEffects()
          Return list of effects (a reference) of this process result
 boolean isWellFormed()
          Return true iff the process result is well formed (contains consistent properties)
 boolean setProperty(String propURI, Object value)
          Adds a statement with this resource as the subject, the given propURI as the predicate and the given value as the object.
static ProcessResult toResult(Resource pr)
          Create an instance of ProcessResult from a resource passed as a parameter
 
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

PROP_OWLS_RESULT_HAS_EFFECT

public static final String PROP_OWLS_RESULT_HAS_EFFECT
See Also:
Constant Field Values

PROP_OWLS_RESULT_WITH_OUTPUT

public static final String PROP_OWLS_RESULT_WITH_OUTPUT
See Also:
Constant Field Values

MY_URI

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

ProcessResult

public ProcessResult()

ProcessResult

public ProcessResult(String uri)
Method Detail

checkEffects

public static boolean checkEffects(Resource[] req,
                                   Resource[] offer,
                                   HashMap context)
Verify that the process effects of offers match the ones of requests according to the context

Parameters:
req - - a list of requests
offer - - a list of offers
context - - the context
Returns:
true iff the process effects match

checkEffects

public static boolean checkEffects(Resource[] req,
                                   Resource[] offer,
                                   HashMap context,
                                   Long logID)
Verify that the process effects of offers match the ones of requests according to the context

Parameters:
req - - a list of requests
offer - - a list of offers
context - - the context
logID - - an id to be used for logging, may be null
Returns:
true iff the process effects match

checkOutputBindings

public static boolean checkOutputBindings(Resource[] req,
                                          Resource[] offer,
                                          HashMap context,
                                          Long logID)
Verify that the output bindings of offers match the ones of requests according to the context

Parameters:
req - - a list of requests
offer - - a list of offers
context - - the context
Returns:
true iff the output bindings match

toResult

public static ProcessResult toResult(Resource pr)
Create an instance of ProcessResult from a resource passed as a parameter

Parameters:
pr - - a resource representing process result
Returns:
- the created instance of ProcessResult

setProperty

public boolean setProperty(String propURI,
                           Object value)
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 Resource
Returns:
true if the property changed as a result of the call

addAddEffect

public void addAddEffect(PropertyPath ppath,
                         Object value)
Add "add" process effect with property path and value passed as parameters

Parameters:
ppath - - the property path
value - - the value

addAggregatingOutputBinding

public void addAggregatingOutputBinding(ProcessOutput toParam,
                                        AggregatingFilter filter)
Add aggregated output binding to a process output parameter

Parameters:
toParam - - the parameter to which the binding is done
filter - - the aggregation filter of the output binding

addChangeEffect

public void addChangeEffect(PropertyPath ppath,
                            Object value)
Add "change" process effect with property path and value passed as parameters

Parameters:
ppath - - the property path
value - - the value

addRemoveEffect

public void addRemoveEffect(PropertyPath ppath)
Add "remove" process effect with property path and value passed as parameters

Parameters:
ppath - - the property path
value - - the value

addClassConversionOutputBinding

public void addClassConversionOutputBinding(ProcessOutput toParam,
                                            PropertyPath sourceProp,
                                            TypeURI targetClass)
Add class conversion output binding to a process output parameter

Parameters:
toParam - - the parameter to which the binding is done
sourceProp - - the property path of the value to convert
targetClass - - the uri of the target class to convert to

addLangConversionOutputBinding

public void addLangConversionOutputBinding(ProcessOutput toParam,
                                           PropertyPath sourceProp,
                                           String targetLang)
Add language conversion output binding to a process output parameter

Parameters:
toParam - - the parameter to which the binding is done
sourceProp - - the property path of the value to convert
targetLang - - the target language to convert to

addUnitConversionOutputBinding

public void addUnitConversionOutputBinding(ProcessOutput toParam,
                                           PropertyPath sourceProp,
                                           String targetUnit)
Add unit conversion output binding to a process output parameter

Parameters:
toParam - - the parameter to which the binding is done
sourceProp - - the property path of the value to convert
targetUnit - - the unit to convert to

addSimpleOutputBinding

public void addSimpleOutputBinding(ProcessOutput toParam,
                                   PropertyPath sourceProp)
Add simple output binding to a process output parameter

Parameters:
toParam - - the parameter to which the binding is done
sourceProp - - the property path of the value to bind

getBindings

public List getBindings()
Return the list of output bindings ( a reference) of this process result

Returns:
list of output bindings

getEffects

public List getEffects()
Return list of effects (a reference) of this process result

Returns:
list of effects

isWellFormed

public boolean isWellFormed()
Return true iff the process result is well formed (contains consistent properties)

Overrides:
isWellFormed in class Resource


Copyright © 2014 universAAL Consortium. All Rights Reserved.