public abstract class Service extends ManagedIndividual
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.
Modifier and Type | Field and Description |
---|---|
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
|
OWL_NAMESPACE, TYPE_OWL_INDIVIDUAL, TYPE_OWL_THING
ANON_URI_PREFIX, blockAddingTypes, isXMLLiteral, NAMESPACE_PREFIX, ns_delim_index, PROP_INVOLVED_HUMAN_USER, 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, props, RDF_EMPTY_LIST, RDF_NAMESPACE, RDFS_NAMESPACE, SERVICE_NAMESPACE, TYPE_RDF_LIST, TYPE_RDFS_CLASS, uri, VOCABULARY_NAMESPACE
Modifier | Constructor and Description |
---|---|
protected |
Service() |
protected |
Service(String uri) |
Modifier and Type | Method and Description |
---|---|
void |
addFilteringInput(String inParamURI,
String typeURI,
int minCardinality,
int maxCardinality,
String[] propPath)
Adds a restriction to a given input
|
void |
addFilteringType(String inParamURI,
String[] propPath)
Adds a restriction to a given input
|
void |
addInputWithAddEffect(String inParamURI,
String typeURI,
int minCardinality,
int maxCardinality,
String[] propPath)
Adds an add effect to default profile
|
void |
addInputWithChangeEffect(String inParamURI,
String typeURI,
int minCardinality,
int maxCardinality,
String[] propPath)
Adds a change effect to default profile
|
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.
|
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.
|
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.
|
checkCompatibility, checkMembership, copy, deepCopy, getClassRestrictionsOnProperty, getClassURI, getInstance, getNonAbstractSuperClasses, getNonabstractSuperClasses, getOntClassInfo, getTypeURI, isRegisteredClassURI, isWellFormed, setPropertyPathFromOffset, toManagedIndividual
addType, getLocalName, getNamespace, getProperty, getPropertyURIs, getType, getTypes, getURI, hasQualifiedName, isAnon, numberOfProperties
addMultiLangProp, asList, asList, asRDFList, changeProperty, equals, generateAnonURI, getDefaultLang, getFilename, getMultiLangProp, getOrConstructLabel, getOrConstructLabel, getResource, getResourceComment, getResourceLabel, getResourceLabel, getStaticFieldValue, hashCode, hasProperty, isAnon, isBlockingAddingTypes, isClosedCollection, isQualifiedName, literal, representsQualifiedURI, serializesAsXMLLiteral, setPropertyPath, setPropertyPath, setResourceComment, setResourceLabel, toString, toStringRecursive, toStringRecursive, unliteral
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
protected Service()
protected Service(String uri)
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 restrictionsprotected 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)
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()
public final ProcessInput createInput(String inParamURI, String typeURI, int minCardinality, int maxCardinality)
public final void addFilteringInput(String inParamURI, String typeURI, int minCardinality, int maxCardinality, String[] propPath)
public final void addFilteringType(String inParamURI, String[] propPath)
public final void addInputWithAddEffect(String inParamURI, String typeURI, int minCardinality, int maxCardinality, String[] propPath)
public final void addInputWithChangeEffect(String inParamURI, String typeURI, int minCardinality, int maxCardinality, String[] propPath)
public final void addInputWithRemoveEffect(String inParamURI, String typeURI, int minCardinality, int maxCardinality, String[] propPath)
public final 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
Copyright © 2018 universAAL Consortium. All rights reserved.