jade.content.schema
Class IRESchema
java.lang.Object
|
+--jade.content.schema.ObjectSchema
|
+--jade.content.schema.ObjectSchemaImpl
|
+--jade.content.schema.TermSchema
|
+--jade.content.schema.IRESchema
- public class IRESchema
- extends TermSchema
Note that an IRESchema should also be a TermSchema, 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 IRE even if in theory
this should be possible as a ConceptSchema can have slots
of type term and an IRE is a term.
- Author:
- Federico Bergenti - Universita` di Parma
- See Also:
- Serialized Form
Constructor Summary |
IRESchema(java.lang.String typeName)
Creates a IRESchema with a given type-name.
|
Method Summary |
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.
|
static ObjectSchema |
getBaseSchema()
Retrieve the generic base schema for all ire-s. |
boolean |
isCompatibleWith(ObjectSchema s)
An IRE can be put whereever a term of whatever type is
required --> An IRESchema is
compatible with s if s descends from TermSchema.getBaseSchema() |
AbsObject |
newInstance()
Creates an Abstract descriptor to hold a ire of
the proper type. |
void |
validate(AbsObject abs,
Ontology onto)
Check whether a given abstract descriptor complies with this
schema. |
Methods inherited from class jade.content.schema.ObjectSchemaImpl |
add,
add,
add,
add,
addFacet,
addSuperSchema,
containsSlot,
equals,
getFacets,
getNames,
getSchema,
getTypeName,
toString,
validateSlots |
Methods inherited from class java.lang.Object |
clone,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
BASE_NAME
public static final java.lang.String BASE_NAME
VARIABLE
public static final java.lang.String VARIABLE
PROPOSITION
public static final java.lang.String PROPOSITION
IRESchema
public IRESchema(java.lang.String typeName)
- Creates a
IRESchema
with a given type-name.
All ire-s have a variable and a proposition.
- Parameters:
typeName
- The name of this IRESchema
(e.g. IOTA, ANY, ALL).
getBaseSchema
public static ObjectSchema getBaseSchema()
- Retrieve the generic base schema for all ire-s.
- Returns:
- the generic base schema for all ire-s.
newInstance
public AbsObject newInstance()
throws OntologyException
- Creates an Abstract descriptor to hold a ire of
the proper type.
- Overrides:
- newInstance in class TermSchema
validate
public void validate(AbsObject abs,
Ontology onto)
throws OntologyException
- Check whether a given abstract descriptor complies with this
schema.
- Overrides:
- validate in class jade.content.schema.ObjectSchemaImpl
- Parameters:
abs
- The abstract descriptor to be checked- Throws:
- OntologyException - If the abstract descriptor does not
complies with this schema
isCompatibleWith
public boolean isCompatibleWith(ObjectSchema s)
- An IRE can be put whereever a term of whatever type is
required --> An IRESchema is
compatible with s if s descends from TermSchema.getBaseSchema()
- Overrides:
- isCompatibleWith in class jade.content.schema.ObjectSchemaImpl
descendsFrom
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.
Moreover, as IRESchema extends ContentElementSchema, but should
also extend TermSchema (this is not possible in practice as
Java does not support multiple inheritance), this method
returns true also in the case that s is equals to, or is an
ancestor of, TermSchema.getBaseSchema() (i.e. TermSchema.getBaseSchema()
descends from s)
- Overrides:
- descendsFrom in class TermSchema