Package jade.content.onto
Class BasicOntology
- java.lang.Object
-
- jade.content.onto.Ontology
-
- jade.content.onto.BasicOntology
-
- All Implemented Interfaces:
SL0Vocabulary,Serializable,Serializable
public class BasicOntology extends Ontology implements SL0Vocabulary
This class implements an ontology containing schemas for Primitive types and SL0 operators i.e. basic ontological elements required for minimal agent interaction. Users should always extend this ontology when defining their ontologies.- Author:
- Federico Bergenti - Universita` di Parma, Giovanni Caire - TILAB
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringBOOLEANstatic StringBYTE_SEQUENCEstatic StringCONTENT_ELEMENT_LISTstatic StringDATEstatic StringFLOATstatic StringINTEGERstatic StringSTRING-
Fields inherited from interface jade.content.lang.sl.SL0Vocabulary
ACLMSG, ACLMSG_BYTE_SEQUENCE_CONTENT, ACLMSG_CONTENT, ACLMSG_CONVERSATION_ID, ACLMSG_ENCODING, ACLMSG_IN_REPLY_TO, ACLMSG_LANGUAGE, ACLMSG_ONTOLOGY, ACLMSG_PERFORMATIVE, ACLMSG_PROTOCOL, ACLMSG_RECEIVERS, ACLMSG_REPLY_BY, ACLMSG_REPLY_TO, ACLMSG_REPLY_WITH, ACLMSG_SENDER, ACTION, ACTION_ACTION, ACTION_ACTOR, AID, AID_ADDRESSES, AID_NAME, AID_PROPERTY_PREFIX, AID_RESOLVERS, DONE, DONE_ACTION, DONE_CONDITION, EQUALS, EQUALS_LEFT, EQUALS_RIGHT, FALSE_PROPOSITION, PROPERTY, PROPERTY_NAME, PROPERTY_VALUE, RESULT, RESULT_ACTION, RESULT_ITEMS, RESULT_VALUE, SEQUENCE, SET, TRUE_PROPOSITION
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static ObjectadjustPrimitiveValue(Object srcValue, Class destClass)Convert, if possible, the numeric value srcValue into an instance of destClassprotected AbsObjectfromObject(Object obj, Ontology referenceOnto)This method is redefined as BasicOntology does not use an Introspector for performance reasonstatic OntologygetInstance()Returns the singleton instance of theBasicOntology.ObjectSchemagetSchema(Class clazz)Redefine thegetSchema()method to take into account java primitives.ObjectSchemagetSchema(String name)Redefine thegetSchema()method to take into account ACL performatives.static ObjectresolveNumericValue(Object srcValue, Class destClass)Deprecated.Use adjustPrimitiveValue() insteadprotected ObjecttoObject(AbsObject abs, String lcType, Ontology referenceOnto)This method is redefined as BasicOntology does not use an Introspector for performance reason-
Methods inherited from class jade.content.onto.Ontology
add, add, checkIsTerm, createConceptSlotFunction, dump, dump, externalize, externalizeSlotValue, fromObject, getActionNames, getClassForElement, getConceptNames, getIntrospector, getName, getOwnActionNames, getOwnConceptNames, getOwnPredicateNames, getPredicateNames, getReferencedSchemas, getSlotValue, internalize, internalizeSlotValue, isBaseOntology, setSlotValue, toObject, toString, useConceptSlotsAsFunctions
-
-
-
-
Field Detail
-
STRING
public static final String STRING
- See Also:
- Constant Field Values
-
FLOAT
public static final String FLOAT
- See Also:
- Constant Field Values
-
INTEGER
public static final String INTEGER
- See Also:
- Constant Field Values
-
BOOLEAN
public static final String BOOLEAN
- See Also:
- Constant Field Values
-
DATE
public static final String DATE
- See Also:
- Constant Field Values
-
BYTE_SEQUENCE
public static final String BYTE_SEQUENCE
- See Also:
- Constant Field Values
-
CONTENT_ELEMENT_LIST
public static final String CONTENT_ELEMENT_LIST
- See Also:
- Constant Field Values
-
-
Method Detail
-
getInstance
public static Ontology getInstance()
Returns the singleton instance of theBasicOntology.- Returns:
- the singleton instance of the
BasicOntology
-
toObject
protected Object toObject(AbsObject abs, String lcType, Ontology referenceOnto) throws UngroundedException, OntologyException
This method is redefined as BasicOntology does not use an Introspector for performance reason- Overrides:
toObjectin classOntology- Parameters:
abs- the abstract descriptor.lcType- the type of the abstract descriptor to be translated aconverted into lower case. This is passed as parameters to avoid making the conversion to lower case for each base ontology.referenceOnto- The ontology this ontology is part of (i.e. the ontology that extends this ontology).- Returns:
- the object
- Throws:
UngroundedException- if the abstract descriptor contains a variableUnknownSchemaException- If no schema for the abs descriptor to be translated is defined in this ontology.OntologyException- if some mismatch with the schema is found * ontology. In this case UnknownSchema- See Also:
Ontology.toObject(AbsObject)
-
fromObject
protected AbsObject fromObject(Object obj, Ontology referenceOnto) throws OntologyException
This method is redefined as BasicOntology does not use an Introspector for performance reason- Overrides:
fromObjectin classOntology- Parameters:
obj- the objectreferenceOnto- The ontology this ontology is part of (i.e. the ontology that extends this ontology).- Returns:
- the abstract descriptor.
- Throws:
UnknownSchemaException- If no schema for the object to be translated is defined in this ontology.OntologyException- if some mismatch with the schema is found- See Also:
Ontology.toObject(AbsObject)
-
getSchema
public ObjectSchema getSchema(String name) throws OntologyException
Redefine thegetSchema()method to take into account ACL performatives.- Overrides:
getSchemain classOntology- Parameters:
name- the name of the schema in the vocabulary.- Returns:
- the schema or
nullif the schema is not found. - Throws:
OntologyException
-
getSchema
public ObjectSchema getSchema(Class clazz) throws OntologyException
Redefine thegetSchema()method to take into account java primitives.- Overrides:
getSchemain classOntology- Parameters:
clazz- the class whose associated schema must be retrieved.- Returns:
- the schema associated to the given class or
nullif the schema is not found. - Throws:
OntologyException
-
adjustPrimitiveValue
public static Object adjustPrimitiveValue(Object srcValue, Class destClass)
Convert, if possible, the numeric value srcValue into an instance of destClass
-
-