|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjade.content.schema.ObjectSchema
jade.content.schema.TermSchema
jade.content.schema.ConceptSchema
jade.content.schema.AgentActionSchema
public class AgentActionSchema
The class to be used to define schemas of agent actions in an ontology. Note that an AgentActionSchema should also be a ConceptSchema, but this inheritance relation is cut as Java does not support multiple inheritance. As a consequence in practice it will not be possible to define e.g. a ConceptSchema with a slot whose value must be instances of a certain type of agent-action even if in theory this should be possible as a ConceptSchema can have slots of type term and an agent-action is a concept and therefore a term.
| Field Summary | |
|---|---|
static java.lang.String |
BASE_NAME
|
| Fields inherited from class jade.content.schema.ObjectSchema |
|---|
encodingByOrder, MANDATORY, OPTIONAL, UNLIMITED |
| Constructor Summary | |
|---|---|
AgentActionSchema(java.lang.String typeName)
Creates an AgentActionSchema with a given type-name. |
|
| Method Summary | |
|---|---|
protected void |
add(java.lang.String name,
ObjectSchema slotSchema)
Add a mandatory slot to the schema. |
protected void |
add(java.lang.String name,
ObjectSchema slotSchema,
int optionality)
Add a slot to the schema. |
protected void |
add(java.lang.String name,
ObjectSchema elementsSchema,
int cardMin,
int cardMax)
Add a slot with cardinality between cardMin
and cardMax to this schema. |
protected void |
add(java.lang.String name,
ObjectSchema elementsSchema,
int cardMin,
int cardMax,
java.lang.String aggType)
Add a slot with cardinality between cardMin
and cardMax to this schema and allow specifying the type
of Aggregate to be used for this slot. |
void |
add(java.lang.String name,
PredicateSchema slotSchema)
Add a mandatory slot of type PredicateSchema to this schema. |
void |
add(java.lang.String name,
PredicateSchema slotSchema,
int optionality)
Add a slot of type PredicateSchema to this schema. |
protected void |
addSuperSchema(ObjectSchema superSchema)
Add a super schema to this schema, i.e. this schema will inherit all characteristics from the super schema |
boolean |
containsSlot(java.lang.String name)
Indicate whether a given String is the name of a
slot defined in this Schema |
protected boolean |
descendsFrom(ObjectSchema s)
Return true if - s is the base schema for the XXXSchema class this schema is an instance of (e.g. s is ConceptSchema.getBaseSchema() and this schema is an instance of ConceptSchema) - s is the base schema for a super-class of the XXXSchema class this schema is an instance of (e.g. s is TermSchema.getBaseSchema() and this schema is an instance of ConceptSchema. |
boolean |
equals(java.lang.Object o)
|
static ObjectSchema |
getBaseSchema()
Retrieve the generic base schema for all agent actions. |
Facet[] |
getFacets(java.lang.String slotName)
Retrieves the facets defined upon a slot. |
java.lang.String[] |
getNames()
Returns the names of all the slots in this Schema
(including slots defined in super schemas). |
java.lang.String[] |
getOwnNames()
Returns the names of the slots defined in this Schema
(excluding slots defined in super schemas). |
Facet[] |
getResultFacets()
|
TermSchema |
getResultSchema()
|
ObjectSchema |
getSchema(java.lang.String name)
Retrieves the schema of a slot of this Schema. |
ObjectSchema[] |
getSuperSchemas()
Retrieves an array containing the direct super-schemas of this schema. |
java.lang.String |
getTypeName()
Retrieves the name of the type of this schema. |
boolean |
isAssignableFrom(ObjectSchema s)
This method checks whether or not an abstract object that is an instance of schema s can be used in place of an abstract object that is an instance of this schema. |
boolean |
isCompatibleWith(ObjectSchema s)
Check if this schema is compatible with a given schema s. |
boolean |
isMandatory(java.lang.String name)
Indicate whether a slot of this schema is mandatory |
boolean |
isOwnSlot(java.lang.String name)
Indicate whether a given String is the name of a
slot actually defined in this Schema (excluding super-schemas) |
AbsObject |
newInstance()
Creates an Abstract descriptor to hold an agent action of the proper type. |
void |
setResult(TermSchema resultSchema)
Define that the result produced by the execution of an action described by this schema has a structure conforming to a given term schema. |
void |
setResult(TermSchema elementsSchema,
int cardMin,
int cardMax)
Define that the result produced by the execution of an action described by this schema is an aggregate of n (with n between cardMin and cardMax) elements each one having a structure conforming to a given term schema. |
java.lang.String |
toString()
|
void |
validate(AbsObject abs,
Ontology onto)
Check whether a given abstract descriptor complies with this schema. |
protected void |
validateSlots(AbsObject abs,
Ontology onto)
For each slot - get the corresponding attribute value from the abstract descriptor abs - Check that it is not null if the slot is mandatory - Check that its schema is compatible with the schema of the slot - Check that it is a correct abstract descriptor by validating it against its schema. |
| Methods inherited from class jade.content.schema.ConceptSchema |
|---|
add, add, add, add, addFacet, addSuperSchema |
| Methods inherited from class jade.content.schema.ObjectSchema |
|---|
getEncodingByOrder, setEncodingByOrder |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String BASE_NAME
| Constructor Detail |
|---|
public AgentActionSchema(java.lang.String typeName)
AgentActionSchema with a given type-name.
typeName - The name of this AgentActionSchema.| Method Detail |
|---|
public static ObjectSchema getBaseSchema()
public void add(java.lang.String name,
PredicateSchema slotSchema)
name - The name of the slot.slotSchema - The schema of the slot.
public void add(java.lang.String name,
PredicateSchema slotSchema,
int optionality)
name - The name of the slot.slotSchema - The schema of the slot.optionality - The optionality, i.e. OPTIONAL
or MANDATORY
public AbsObject newInstance()
throws OntologyException
newInstance in class ConceptSchemaOntologyException
public void validate(AbsObject abs,
Ontology onto)
throws OntologyException
validate in class ConceptSchemaabs - The abstract descriptor to be checked
OntologyException - If the abstract descriptor does not
complies with this schemaprotected boolean descendsFrom(ObjectSchema s)
descendsFrom in class ConceptSchemapublic void setResult(TermSchema resultSchema)
resultSchema - the schema of the result
public void setResult(TermSchema elementsSchema,
int cardMin,
int cardMax)
elementsSchema - the schema of the elements in the result aggregatecardMin - the result must include at least cardMin elementscardMax - the result must include at most cardMax elementspublic TermSchema getResultSchema()
public Facet[] getResultFacets()
protected void add(java.lang.String name,
ObjectSchema slotSchema,
int optionality)
add in class ObjectSchemaname - The name of the slot.slotSchema - The schema defining the type of the slot.optionality - The optionality, i.e., OPTIONAL
or MANDATORY
protected void add(java.lang.String name,
ObjectSchema slotSchema)
add in class ObjectSchemaname - name of the slot.slotSchema - schema of the slot.
protected void add(java.lang.String name,
ObjectSchema elementsSchema,
int cardMin,
int cardMax)
cardMin
and cardMax to this schema.
Adding such a slot corresponds to add a slot
of type Aggregate and then to add proper facets (constraints)
to check that the type of the elements in the aggregate are
compatible with elementsSchema and that the
aggregate contains at least cardMin elements and
at most cardMax elements. By default the Aggregate
is of type BasicOntology.SEQUENCE.
add in class ObjectSchemaname - The name of the slot.elementsSchema - The schema for the elements of this slot.cardMin - This slot must get at least cardMin
valuescardMax - This slot can get at most cardMax
values
protected void add(java.lang.String name,
ObjectSchema elementsSchema,
int cardMin,
int cardMax,
java.lang.String aggType)
cardMin
and cardMax to this schema and allow specifying the type
of Aggregate to be used for this slot.
add in class ObjectSchemaname - The name of the slot.elementsSchema - The schema for the elements of this slot.cardMin - This slot must get at least cardMin
valuescardMax - This slot can get at most cardMax
valuesaggType - The type of Aggregate to be usedadd(String, ObjectSchema, int, int)protected void addSuperSchema(ObjectSchema superSchema)
addSuperSchema in class ObjectSchemasuperSchema - the super schema.public java.lang.String getTypeName()
getTypeName in class ObjectSchemapublic java.lang.String[] getNames()
Schema
(including slots defined in super schemas).
getNames in class ObjectSchemapublic java.lang.String[] getOwnNames()
Schema
(excluding slots defined in super schemas).
getOwnNames in class ObjectSchemaSchema.
public ObjectSchema getSchema(java.lang.String name)
throws OntologyException
Schema.
getSchema in class ObjectSchemaname - The name of the slot.
Schema of slot name
OntologyException - If no slot with this name is present
in this schema.public boolean containsSlot(java.lang.String name)
String is the name of a
slot defined in this Schema
containsSlot in class ObjectSchemaname - The String to test.
true if name is the name of a
slot defined in this Schema.public boolean isOwnSlot(java.lang.String name)
String is the name of a
slot actually defined in this Schema (excluding super-schemas)
isOwnSlot in class ObjectSchemaname - The String to test.
true if name is the name of a
slot actually defined in this Schema (excluding super-schemas).
public boolean isMandatory(java.lang.String name)
throws OntologyException
isMandatory in class ObjectSchemaname - The name of the slot.
true if the slot is mandatory.
OntologyException - If no slot with this name is present
in this schema.
protected void validateSlots(AbsObject abs,
Ontology onto)
throws OntologyException
OntologyExceptionpublic boolean isCompatibleWith(ObjectSchema s)
isCompatibleWith in class ObjectSchemapublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic ObjectSchema[] getSuperSchemas()
ObjectSchema
getSuperSchemas in class ObjectSchemapublic Facet[] getFacets(java.lang.String slotName)
ObjectSchema
getFacets in class ObjectSchemaslotName - the name of the slot
public boolean isAssignableFrom(ObjectSchema s)
ObjectSchema
isAssignableFrom in class ObjectSchema
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||