|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.universAAL.middleware.rdf.Resource
org.universAAL.middleware.rdf.FinalizedResource
org.universAAL.middleware.owl.ManagedIndividual
org.universAAL.middleware.service.owl.Service
public abstract class Service
The root of the hierarchy of service classes in universAAL.
All subclasses must follow the conventions declared by
ManagedIndividual
.
The main characteristic of services is that they specify their view on their
domain by restricting some of the relevant properties from the domain
ontology that are reachable from the service class using a sequence of
properties. The universAAL middleware calls such sequences a
PropertyPath
. Subclasses must define a
static repository for such restrictions as an empty instance of
Hashtable
and add their class-level restrictions to this
repository a static code segment using the help method
addRestriction(MergedRestriction, String[], Hashtable)
.
In addition to class-level restrictions, concrete instances can add
instance-level restrictions using references to their input parameters (see
ProcessParameter.asVariableReference()
). The help method
addInstanceLevelRestriction(MergedRestriction, String[])
facilitates
the addition of such instance-level restrictions.
Field Summary | |
---|---|
protected Hashtable |
instanceLevelRestrictions
The instance-level repository of defined restrictions on property paths. |
static String |
MY_URI
|
protected ServiceProfile |
myProfile
|
protected int |
numberOfValueRestrictions
|
static String |
OWLS_NAMESPACE_PREFIX
|
static String |
OWLS_SERVICE_NAMESPACE
|
static String |
PROP_INSTANCE_LEVEL_RESTRICTIONS
|
static String |
PROP_NUMBER_OF_VALUE_RESTRICTIONS
|
static String |
PROP_OWLS_PRESENTED_BY
The OWL-S property http://www.daml.org/services/owl-s/1.1/Service.owl#presentedBy |
static String |
PROP_OWLS_PRESENTS
The OWL-S property http://www.daml.org/services/owl-s/1.1/Service.owl#presents |
Fields inherited from class org.universAAL.middleware.owl.ManagedIndividual |
---|
OWL_NAMESPACE, TYPE_OWL_INDIVIDUAL, 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 |
Service()
|
protected |
Service(String uri)
|
Method Summary | |
---|---|
protected void |
addFilteringInput(String inParamURI,
String typeURI,
int minCardinality,
int maxCardinality,
String[] propPath)
Adds a restriction to a given input |
protected void |
addFilteringType(String inParamURI,
String[] propPath)
Adds a restriction to a given input |
protected void |
addInputWithAddEffect(String inParamURI,
String typeURI,
int minCardinality,
int maxCardinality,
String[] propPath)
Adds an add effect to default profile |
protected void |
addInputWithChangeEffect(String inParamURI,
String typeURI,
int minCardinality,
int maxCardinality,
String[] propPath)
Adds a change effect to default profile |
protected void |
addInputWithRemoveEffect(String inParamURI,
String typeURI,
int minCardinality,
int maxCardinality,
String[] propPath)
Adds a remove effect to default profile |
boolean |
addInstanceLevelRestriction(MergedRestriction r,
String[] toPath)
A method for adding instance-level restrictions. |
protected void |
addOutput(String outParamURI,
String typeURI,
int minCardinality,
int maxCardinality,
String[] propPath)
Adds configured output to default profile |
protected static boolean |
addRestriction(MergedRestriction r,
String[] toPath,
Hashtable restrictions)
A help method for subclasses to manage their restrictions on properties (from the domain ontology) that are reachable from the subclass, provided that they have a static Hashtable for gathering them. |
protected ProcessInput |
createInput(String inParamURI,
String typeURI,
int minCardinality,
int maxCardinality)
Creates an input from the given URI and cardinality |
Object |
getInstanceLevelFixedValueOnProp(String propURI)
|
MergedRestriction |
getInstanceLevelRestrictionOnProp(String propURI)
Returns the restriction on the given propPath , if it was
previously added to instanceLevelRestrictions using
addRestriction(MergedRestriction, String[], Hashtable) . |
int |
getNumberOfValueRestrictions()
|
ServiceProfile |
getProfile()
|
int |
getPropSerializationType(String propURI)
Answers if the given property has to be considered when serializing this individual in a minimized way, and if not ignore-able, whether its value should be presented in its full form or can be reduced. |
String[] |
getRestrictedPropsOnInstanceLevel()
Returns the set of properties restricted at instance level. |
protected static MergedRestriction |
getRestrictionOnPropPath(Hashtable restrictions,
String[] propPath)
A restriction previously added by addRestriction(MergedRestriction, String[], Hashtable) to the
given propPath using the same hash-table of
restrictions will be returned by this method. |
boolean |
setProperty(String propURI,
Object value)
The default implementation that will set a property if it was not set before and the given value complies with the restrictions defined by this class of managed individuals for the given propURI. |
Methods inherited from class org.universAAL.middleware.owl.ManagedIndividual |
---|
checkCompatibility, checkMembership, copy, deepCopy, getClassRestrictionsOnProperty, getClassURI, getInstance, getNonAbstractSuperClasses, getNonabstractSuperClasses, getOntClassInfo, getTypeURI, isRegisteredClassURI, isWellFormed, setPropertyPathFromOffset, toManagedIndividual |
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, equals, generateAnonURI, getDefaultLang, getFilename, getMultiLangProp, getOrConstructLabel, getResource, getResourceComment, getResourceLabel, getStaticFieldValue, hashCode, hasProperty, isAnon, isBlockingAddingTypes, isClosedCollection, isQualifiedName, literal, representsQualifiedURI, serializesAsXMLLiteral, setPropertyPath, setPropertyPath, setResourceComment, setResourceLabel, toString, toStringRecursive, toStringRecursive, unliteral |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String OWLS_NAMESPACE_PREFIX
public static final String OWLS_SERVICE_NAMESPACE
public static final String PROP_INSTANCE_LEVEL_RESTRICTIONS
public static final String PROP_NUMBER_OF_VALUE_RESTRICTIONS
public static final String PROP_OWLS_PRESENTS
public static final String PROP_OWLS_PRESENTED_BY
public static final String MY_URI
protected final Hashtable instanceLevelRestrictions
addRestriction(MergedRestriction, String[], java.util.Hashtable)
must be used.
protected int numberOfValueRestrictions
protected ServiceProfile myProfile
Constructor Detail |
---|
protected Service()
protected Service(String uri)
Method Detail |
---|
protected static final boolean addRestriction(MergedRestriction r, String[] toPath, Hashtable restrictions)
r
- the restriction to be added on the last element of the path
given by 'toPath'.toPath
- the path to which the given restriction must be bound. It must
start with a property from the service class and address a
reachable property from the domain ontology; the last element
of the path must be equal to r.getOnProperty()
.restrictions
- a class-level static hash-table for managing restrictions
protected static final MergedRestriction getRestrictionOnPropPath(Hashtable restrictions, String[] propPath)
addRestriction(MergedRestriction, String[], Hashtable)
to the
given propPath
using the same hash-table of
restrictions
will be returned by this method.
public final boolean addInstanceLevelRestriction(MergedRestriction r, String[] toPath)
instanceLevelRestrictions
,
addRestriction(MergedRestriction, String[], Hashtable)
public final Object getInstanceLevelFixedValueOnProp(String propURI)
public final MergedRestriction getInstanceLevelRestrictionOnProp(String propURI)
propPath
, if it was
previously added to instanceLevelRestrictions
using
addRestriction(MergedRestriction, String[], Hashtable)
.
public final int getNumberOfValueRestrictions()
public final ServiceProfile getProfile()
protected ProcessInput createInput(String inParamURI, String typeURI, int minCardinality, int maxCardinality)
protected void addFilteringInput(String inParamURI, String typeURI, int minCardinality, int maxCardinality, String[] propPath)
protected void addFilteringType(String inParamURI, String[] propPath)
protected void addInputWithAddEffect(String inParamURI, String typeURI, int minCardinality, int maxCardinality, String[] propPath)
protected void addInputWithChangeEffect(String inParamURI, String typeURI, int minCardinality, int maxCardinality, String[] propPath)
protected void addInputWithRemoveEffect(String inParamURI, String typeURI, int minCardinality, int maxCardinality, String[] propPath)
protected void addOutput(String outParamURI, String typeURI, int minCardinality, int maxCardinality, String[] propPath)
public int getPropSerializationType(String propURI)
ManagedIndividual
Resource.PROP_SERIALIZATION_OPTIONAL
,
Resource.PROP_SERIALIZATION_REDUCED
, or Resource.PROP_SERIALIZATION_FULL
.
It can be assumed that the given property is one of those returned by
FinalizedResource.getPropertyURIs()
. Decision criterion should be if the value of
this property is absolutely necessary when this resource is being sent to
a remote node. If the subclass rates it as unlikely that the receiver
side would need this info, the answer should be
PROP_SERIALIZATION_OPTIONAL
in favor of lower communication
traffic and higher performance even at risk of a possible additional
query on the receiver side for fetching this info. With the same
rationale, if a property should be included in the process of
serialization, it is preferable to include it in a reduced form; in this
case the return value should be PROP_SERIALIZATION_REDUCED
,
otherwise PROP_SERIALIZATION_FULL
can be returned.
getPropSerializationType
in class ManagedIndividual
ManagedIndividual.getPropSerializationType(java.lang.String)
public final String[] getRestrictedPropsOnInstanceLevel()
public boolean setProperty(String propURI, Object value)
ManagedIndividual
setProperty
in class ManagedIndividual
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |