org.universAAL.middleware.service.owls.profile
Class ServiceProfile

Package class diagram package ServiceProfile
java.lang.Object
  extended by org.universAAL.middleware.rdf.Resource
      extended by org.universAAL.middleware.rdf.FinalizedResource
          extended by org.universAAL.middleware.service.owls.profile.ServiceProfile
All Implemented Interfaces:
Advertisement, Matchable, UtilityAdvertisement

public class ServiceProfile
extends FinalizedResource
implements UtilityAdvertisement

A "registration parameter" as accepted by the service bus of the uAAL middleware. It implements the concept of profile:Profile (xmlns:profile="http://www.daml.org/services/owl-s/1.1/Profile.owl#"), currently ignoring the following OWL-S properties: hasPrecondition, contactInformation, serviceClassification, serviceProduct, and serviceCategory.

ServiceCallees register to the service bus by providing a set of instances of this class as registration parameters, one for each "exported" operation that can be called by arbitrary ServiceCallers. A such operation has

Author:
mtazari - Saied Tazari

Field Summary
static String MY_URI
           
static String OWLS_PROFILE_NAMESPACE
           
static String PROP_OWLS_PROFILE_HAS_INPUT
          The OWL-S property profile:hasInput
static String PROP_OWLS_PROFILE_HAS_OUTPUT
          The OWL-S property profile:hasOutput
static String PROP_OWLS_PROFILE_HAS_PARAMETER
          The OWL-S property profile:hasParameter
static String PROP_OWLS_PROFILE_HAS_PROCESS
          The OWL-S property profile:has_process
static String PROP_OWLS_PROFILE_HAS_RESULT
          The OWL-S property profile:hasResult
static String PROP_OWLS_PROFILE_SERVICE_NAME
          The OWL-S property profile:serviceName
static String PROP_OWLS_PROFILE_SERVICE_PARAMETER
          The OWL-S property profile:serviceParameter
static String PROP_OWLS_PROFILE_TEXT_DESCRIPTION
          The OWL-S property profile:textDescription
static String PROP_uAAL_AVERAGE_QOS_RATING
          A sub-property of profile:serviceParameter as a non-functional parameter provided by the uAAL middleware for all registered services.
static String PROP_uAAL_AVERAGE_RESPONSE_TIME
          A sub-property of profile:serviceParameter as a non-functional parameter provided by the uAAL middleware for all registered services.
static String PROP_uAAL_HOST_LOCATION
          A sub-property of profile:serviceParameter as a non-functional parameter to be provided by a registered service to indicate where the physical node hosting the service resides.
static String PROP_uAAL_MAX_QOS_RATING
          A sub-property of profile:serviceParameter as a non-functional parameter provided by the uAAL middleware for all registered services.
static String PROP_uAAL_MAX_RESPONSE_TIME
          A sub-property of profile:serviceParameter as a non-functional parameter provided by the uAAL middleware for all registered services.
static String PROP_uAAL_MIN_QOS_RATING
          A sub-property of profile:serviceParameter as a non-functional parameter provided by the uAAL middleware for all registered services.
static String PROP_uAAL_MIN_RESPONSE_TIME
          A sub-property of profile:serviceParameter as a non-functional parameter provided by the uAAL middleware for all registered services.
static String PROP_uAAL_NUMBER_OF_QOS_RATINGS
          A sub-property of profile:serviceParameter as a non-functional parameter provided by the uAAL middleware for all registered services.
static String PROP_uAAL_NUMBER_OF_RESPONSE_TIME_MEASUREMENTS
          A sub-property of profile:serviceParameter as a non-functional parameter provided by the uAAL middleware for all registered services.
static String PROP_uAAL_RESPONSE_TIMEOUT
          A sub-property of profile:serviceParameter as a non-functional parameter to be provided by a registered service to indicate after how many milliseconds of waiting for a response from the service, the middleware must send a timeout failure message to the caller.
static String PROP_uAAL_SPATIAL_COVERAGE
          A sub-property of profile:serviceParameter as a non-functional parameter to be provided by a registered service to indicate in which physical area it makes sense to utilize the service.
 
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
ServiceProfile()
          Only for use by deserializers.
ServiceProfile(Service s, String processURI)
          The constructor to be used by ServiceCallees.
ServiceProfile(String uri)
           
 
Method Summary
 void addAddEffect(String[] ppath, Object value)
          Declares that a call to the service described by this profile adds the given value to the property reachable by the given ppath.
 void addChangeEffect(String[] ppath, Object value)
          Declares that a call to the service described by this profile changes the value of the property reachable by the given ppath to the given value.
 void addClassConversionOutputBinding(ProcessOutput toParam, String[] sourceProp, TypeURI targetClass)
          Declares that the output parameter specified by toParam will be an instance of the given targetClass as a result of converting the actual value of a property reachable by the given property path sourceProp.
 void addInput(ProcessInput in)
          Adds the given input parameter to the set of this service's input parameters.
 void addLangConversionOutputBinding(ProcessOutput toParam, String[] sourceProp, String targetLang)
          Declares that the output parameter specified by toParam will be the translation of the actual value of a property reachable by the given property path sourceProp into the given targetLang.
static void addNonFunctionalParameter(String subPropertyOfServiceParameter, Class subclassOfProfileParameter)
          Sub-properties of profile:serviceParameter can be made known to the uAAL middleware by calling this method.
 void addOutput(ProcessOutput out)
          Adds the given output parameter to the set of this service's output parameters.
 void addRemoveEffect(String[] ppath)
          Declares that a call to the service described by this profile removes the value of the property reachable by the given ppath.
 void addSimpleOutputBinding(ProcessOutput toParam, String[] sourceProp)
          Declares that the output parameter specified by toParam will reflect the value of a property reachable by the given property path sourceProp.
 void addUnitConversionOutputBinding(ProcessOutput toParam, String[] sourceProp, String targetUnit)
          Declares that the output parameter specified by toParam will reflect the value of a property reachable by the given property path sourceProp in terms of the given measurement unit targetUnit.
static ServiceProfile deserializeProfile(String turtleSP)
          Returns the de-serialized profile
 Resource[] getEffects()
          Returns the list of service effects; the main user of this method is the service bus.
 Iterator getInputs()
          Returns the list of service input parameters; the main user of this method is the service bus.
 int getNumberOfInputs()
           
 int getNumberOfMandatoryInputs()
           
 Resource[] getOutputBindings()
          Returns the list of declarations how the service output parameters are bound; the main user of this method is the service bus.
 Iterator getOutputs()
          Returns the list of service output parameters; the main user of this method is the service bus.
 String getProcessURI()
          Returns the URI that serves as the internal ID of the service on the side of the provider; the main user of this method is the service bus.
 String getServiceDescription()
          Returns the textual description of the service; the main user of this method is the service bus.
 String getServiceName()
          Returns the name of the service; the main user of this method is the service bus.
 Service getTheService()
          Returns the individual from the service ontology that represents the provided service; the main user of this method is the service bus.
 boolean isEmpty()
          Checks if input, output and result is empty.
 boolean matches(Matchable other)
           
 String serializeProfile()
          Returns the serialized profile as String
 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.
 
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, isWellFormed, 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_PROFILE_NAMESPACE

public static final String OWLS_PROFILE_NAMESPACE
See Also:
Constant Field Values

MY_URI

public static final String MY_URI
See Also:
Constant Field Values

PROP_OWLS_PROFILE_SERVICE_NAME

public static final String PROP_OWLS_PROFILE_SERVICE_NAME
The OWL-S property profile:serviceName

See Also:
Constant Field Values

PROP_OWLS_PROFILE_TEXT_DESCRIPTION

public static final String PROP_OWLS_PROFILE_TEXT_DESCRIPTION
The OWL-S property profile:textDescription

See Also:
Constant Field Values

PROP_OWLS_PROFILE_HAS_PROCESS

public static final String PROP_OWLS_PROFILE_HAS_PROCESS
The OWL-S property profile:has_process

See Also:
Constant Field Values

PROP_OWLS_PROFILE_HAS_INPUT

public static final String PROP_OWLS_PROFILE_HAS_INPUT
The OWL-S property profile:hasInput

See Also:
Constant Field Values

PROP_OWLS_PROFILE_HAS_OUTPUT

public static final String PROP_OWLS_PROFILE_HAS_OUTPUT
The OWL-S property profile:hasOutput

See Also:
Constant Field Values

PROP_OWLS_PROFILE_HAS_RESULT

public static final String PROP_OWLS_PROFILE_HAS_RESULT
The OWL-S property profile:hasResult

See Also:
Constant Field Values

PROP_OWLS_PROFILE_SERVICE_PARAMETER

public static final String PROP_OWLS_PROFILE_SERVICE_PARAMETER
The OWL-S property profile:serviceParameter

See Also:
Constant Field Values

PROP_OWLS_PROFILE_HAS_PARAMETER

public static final String PROP_OWLS_PROFILE_HAS_PARAMETER
The OWL-S property profile:hasParameter

See Also:
Constant Field Values

PROP_uAAL_AVERAGE_QOS_RATING

public static final String PROP_uAAL_AVERAGE_QOS_RATING
A sub-property of profile:serviceParameter as a non-functional parameter provided by the uAAL middleware for all registered services. The range of this property is QoSRating.

See Also:
Constant Field Values

PROP_uAAL_AVERAGE_RESPONSE_TIME

public static final String PROP_uAAL_AVERAGE_RESPONSE_TIME
A sub-property of profile:serviceParameter as a non-functional parameter provided by the uAAL middleware for all registered services. The range of this property is ResponseTimeInMilliseconds .

See Also:
Constant Field Values

PROP_uAAL_HOST_LOCATION

public static final String PROP_uAAL_HOST_LOCATION
A sub-property of profile:serviceParameter as a non-functional parameter to be provided by a registered service to indicate where the physical node hosting the service resides. The range of this property is SingleLocationParameter .

See Also:
Constant Field Values

PROP_uAAL_MAX_QOS_RATING

public static final String PROP_uAAL_MAX_QOS_RATING
A sub-property of profile:serviceParameter as a non-functional parameter provided by the uAAL middleware for all registered services. The range of this property is QoSRating.

See Also:
Constant Field Values

PROP_uAAL_MAX_RESPONSE_TIME

public static final String PROP_uAAL_MAX_RESPONSE_TIME
A sub-property of profile:serviceParameter as a non-functional parameter provided by the uAAL middleware for all registered services. The range of this property is ResponseTimeInMilliseconds .

See Also:
Constant Field Values

PROP_uAAL_MIN_QOS_RATING

public static final String PROP_uAAL_MIN_QOS_RATING
A sub-property of profile:serviceParameter as a non-functional parameter provided by the uAAL middleware for all registered services. The range of this property is QoSRating.

See Also:
Constant Field Values

PROP_uAAL_MIN_RESPONSE_TIME

public static final String PROP_uAAL_MIN_RESPONSE_TIME
A sub-property of profile:serviceParameter as a non-functional parameter provided by the uAAL middleware for all registered services. The range of this property is ResponseTimeInMilliseconds .

See Also:
Constant Field Values

PROP_uAAL_NUMBER_OF_QOS_RATINGS

public static final String PROP_uAAL_NUMBER_OF_QOS_RATINGS
A sub-property of profile:serviceParameter as a non-functional parameter provided by the uAAL middleware for all registered services. The range of this property is NumberOfSamples.

See Also:
Constant Field Values

PROP_uAAL_NUMBER_OF_RESPONSE_TIME_MEASUREMENTS

public static final String PROP_uAAL_NUMBER_OF_RESPONSE_TIME_MEASUREMENTS
A sub-property of profile:serviceParameter as a non-functional parameter provided by the uAAL middleware for all registered services. The range of this property is NumberOfSamples.

See Also:
Constant Field Values

PROP_uAAL_RESPONSE_TIMEOUT

public static final String PROP_uAAL_RESPONSE_TIMEOUT
A sub-property of profile:serviceParameter as a non-functional parameter to be provided by a registered service to indicate after how many milliseconds of waiting for a response from the service, the middleware must send a timeout failure message to the caller. The range of this property is ResponseTimeInMilliseconds .

See Also:
Constant Field Values

PROP_uAAL_SPATIAL_COVERAGE

public static final String PROP_uAAL_SPATIAL_COVERAGE
A sub-property of profile:serviceParameter as a non-functional parameter to be provided by a registered service to indicate in which physical area it makes sense to utilize the service. The range of this property is MultiLocationParameter ; the union of the given locations will be interpreted as the area covered by the service.

See Also:
Constant Field Values
Constructor Detail

ServiceProfile

public ServiceProfile()
Only for use by deserializers.


ServiceProfile

public ServiceProfile(String uri)

ServiceProfile

public ServiceProfile(Service s,
                      String processURI)
The constructor to be used by ServiceCallees. Effects, inputs, outputs and output bindings must be added to the profile using methods whose names starts with "add*". The rdfs:label and rdfs:comment provided by the class of the given service will be used as profile:serviceName and profile:textDescription respectively.

Parameters:
s - The individual service whose profile is being constructed
processURI - The URI that is used by the ServiceCallee registering this profile as an internal ID for identifying the operation called
Method Detail

addNonFunctionalParameter

public static void addNonFunctionalParameter(String subPropertyOfServiceParameter,
                                             Class subclassOfProfileParameter)
Sub-properties of profile:serviceParameter can be made known to the uAAL middleware by calling this method.

Parameters:
subPropertyOfServiceParameter - The URI of the sub-property
subclassOfProfileParameter - A subclass of ProfileParameter from which the values of the new property stem

addAddEffect

public void addAddEffect(String[] ppath,
                         Object value)
Declares that a call to the service described by this profile adds the given value to the property reachable by the given ppath. The property should normally be a multi-valued property.


addChangeEffect

public void addChangeEffect(String[] ppath,
                            Object value)
Declares that a call to the service described by this profile changes the value of the property reachable by the given ppath to the given value.


addClassConversionOutputBinding

public void addClassConversionOutputBinding(ProcessOutput toParam,
                                            String[] sourceProp,
                                            TypeURI targetClass)
Declares that the output parameter specified by toParam will be an instance of the given targetClass as a result of converting the actual value of a property reachable by the given property path sourceProp.


addInput

public void addInput(ProcessInput in)
Adds the given input parameter to the set of this service's input parameters.


addLangConversionOutputBinding

public void addLangConversionOutputBinding(ProcessOutput toParam,
                                           String[] sourceProp,
                                           String targetLang)
Declares that the output parameter specified by toParam will be the translation of the actual value of a property reachable by the given property path sourceProp into the given targetLang.


addOutput

public void addOutput(ProcessOutput out)
Adds the given output parameter to the set of this service's output parameters.


addRemoveEffect

public void addRemoveEffect(String[] ppath)
Declares that a call to the service described by this profile removes the value of the property reachable by the given ppath.


addSimpleOutputBinding

public void addSimpleOutputBinding(ProcessOutput toParam,
                                   String[] sourceProp)
Declares that the output parameter specified by toParam will reflect the value of a property reachable by the given property path sourceProp.


addUnitConversionOutputBinding

public void addUnitConversionOutputBinding(ProcessOutput toParam,
                                           String[] sourceProp,
                                           String targetUnit)
Declares that the output parameter specified by toParam will reflect the value of a property reachable by the given property path sourceProp in terms of the given measurement unit targetUnit.


getEffects

public Resource[] getEffects()
Returns the list of service effects; the main user of this method is the service bus.


getInputs

public Iterator getInputs()
Returns the list of service input parameters; the main user of this method is the service bus.


getNumberOfInputs

public int getNumberOfInputs()

getNumberOfMandatoryInputs

public int getNumberOfMandatoryInputs()

getOutputs

public Iterator getOutputs()
Returns the list of service output parameters; the main user of this method is the service bus.


getOutputBindings

public Resource[] getOutputBindings()
Returns the list of declarations how the service output parameters are bound; the main user of this method is the service bus.


getProcessURI

public String getProcessURI()
Returns the URI that serves as the internal ID of the service on the side of the provider; the main user of this method is the service bus.


getServiceName

public String getServiceName()
Returns the name of the service; the main user of this method is the service bus.


getServiceDescription

public String getServiceDescription()
Returns the textual description of the service; the main user of this method is the service bus.


getTheService

public Service getTheService()
Returns the individual from the service ontology that represents the provided service; the main user of this method is the service bus.


isEmpty

public boolean isEmpty()
Checks if input, output and result is empty.

Returns:
boolean

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
See Also:
Resource.setProperty(java.lang.String,java.lang.Object)

serializeProfile

public String serializeProfile()
Returns the serialized profile as String


deserializeProfile

public static ServiceProfile deserializeProfile(String turtleSP)
Returns the de-serialized profile


matches

public boolean matches(Matchable other)
Specified by:
matches in interface Matchable
Returns:
true if the other Matchable matches, false if not
See Also:
Matchable.matches(Matchable)


Copyright © 2014 universAAL Consortium. All Rights Reserved.