JADE_SL.schema
Class ConceptSchema

java.lang.Object
  extended byJADE_SL.schema.ObjectSchema
      extended byJADE_SL.schema.TermSchema
          extended byJADE_SL.schema.ConceptSchema
Direct Known Subclasses:
AgentActionSchema

public class ConceptSchema
extends TermSchema

Author:
Federico Bergenti - Universita` di Parma

Nested Class Summary
 
Nested classes inherited from class JADE_SL.schema.ObjectSchema
 
Field Summary
static java.lang.String BASE_NAME
           
private static ConceptSchema baseSchema
           
 
Fields inherited from class JADE_SL.schema.ObjectSchema
MANDATORY, OPTIONAL, UNLIMITED
 
Constructor Summary
private ConceptSchema()
          Construct a schema that vinculates an entity to be a generic concept
  ConceptSchema(java.lang.String typeName)
          Creates a ConceptSchema with a given type-name, e.g.
 
Method Summary
 void add(java.lang.String name, TermSchema slotSchema)
          Add a mandatory slot to the schema.
 void add(java.lang.String name, TermSchema slotSchema, int optionality)
          Add a slot to the schema.
 void add(java.lang.String name, TermSchema elementsSchema, int cardMin, int cardMax)
          Add a slot with cardinality between cardMin and cardMax to this schema.
 void addFacet(java.lang.String slotName, Facet f)
          Add a Facet on a slot of this schema
 void addSuperSchema(ConceptSchema superClassSchema)
          Adds a super-schema to 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)
static ObjectSchema getBaseSchema()
          Retrieve the generic base schema for all concepts.
 AbsObject newInstance()
          Creates an Abstract descriptor to hold a concept 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_SL.schema.ObjectSchema
add, add, add, addSuperSchema, containsSlot, equals, getNames, getSchema, getTypeName, isCompatibleWith, toString, validateSlots
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BASE_NAME

public static final java.lang.String BASE_NAME
See Also:
Constant Field Values

baseSchema

private static ConceptSchema baseSchema
Constructor Detail

ConceptSchema

private ConceptSchema()
Construct a schema that vinculates an entity to be a generic concept


ConceptSchema

public ConceptSchema(java.lang.String typeName)
Creates a ConceptSchema with a given type-name, e.g. PERSON, ADDRESS...

Parameters:
typeName - The name of this ConceptSchema.
Method Detail

getBaseSchema

public static ObjectSchema getBaseSchema()
Retrieve the generic base schema for all concepts.

Returns:
the generic base schema for all concepts.

add

public void add(java.lang.String name,
                TermSchema slotSchema)
Add a mandatory slot to the schema. The schema for this slot must be a TermSchema.

Parameters:
name - The name of the slot.
slotSchema - The schema of the slot.

add

public void add(java.lang.String name,
                TermSchema slotSchema,
                int optionality)
Add a slot to the schema. The schema for this slot must be a TermSchema.

Parameters:
name - The name of the slot.
slotSchema - The schema of the slot.
optionality - The optionality, i.e., OPTIONAL or MANDATORY

add

public void add(java.lang.String name,
                TermSchema elementsSchema,
                int cardMin,
                int cardMax)
Add a slot with cardinality between cardMin and cardMax to this schema. Adding such a slot is equivalent 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.

Parameters:
name - The name of the slot.
elementsSchema - The schema for the elements of this slot.
cardMin - This slot must get at least cardMin values
cardMax - This slot can get at most cardMax values

addSuperSchema

public void addSuperSchema(ConceptSchema superClassSchema)
Adds a super-schema to this schema. This allows defining inheritance relationships between ontological concepts. It must be noted that a concept always inherits from another concept --> A super-schema of a ConceptSchema must be a ConceptSchema too.

Parameters:
superClassSchema - The super-schema to be added.

addFacet

public void addFacet(java.lang.String slotName,
                     Facet f)
              throws OntologyException
Add a Facet on a slot of this schema

Overrides:
addFacet in class ObjectSchema
Parameters:
slotName - the name of the slot the Facet must be added to.
f - the Facet to be added.
Throws:
OntologyException - if slotName does not identify a valid slot in this schema

newInstance

public AbsObject newInstance()
                      throws OntologyException
Creates an Abstract descriptor to hold a concept of the proper type.

Overrides:
newInstance in class TermSchema
Throws:
OntologyException

validate

public void validate(AbsObject abs,
                     Ontology onto)
              throws OntologyException
Check whether a given abstract descriptor complies with this schema.

Overrides:
validate in class ObjectSchema
Parameters:
abs - The abstract descriptor to be checked
Throws:
OntologyException - If the abstract descriptor does not complies with this schema

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)

Overrides:
descendsFrom in class TermSchema


Copyright © 2000-2003 BT Exact Technologies. All Rights Reserved.