public class PredicateSchema extends ContentElementSchema
Modifier and Type | Field and Description |
---|---|
static String |
BASE_NAME |
private static PredicateSchema |
baseSchema |
RESULT_SLOT_NAME
encodingByOrder, MANDATORY, OPTIONAL, UNLIMITED
Modifier | Constructor and Description |
---|---|
private |
PredicateSchema()
Construct a schema that vinculates an entity to be a generic
predicate
|
|
PredicateSchema(String typeName)
Creates a
PredicateSchema with a given type-name,
e.g. |
Modifier and Type | Method and Description |
---|---|
void |
add(String name,
ObjectSchema slotSchema)
Add a mandatory slot to this schema.
|
void |
add(String name,
ObjectSchema slotSchema,
int optionality)
Add a slot to this schema.
|
void |
add(String name,
TermSchema elementsSchema,
int cardMin,
int cardMax)
Add a slot with cardinality between
cardMin
and cardMax to this schema. |
void |
add(String name,
TermSchema elementsSchema,
int cardMin,
int cardMax,
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 |
addFacet(String slotName,
Facet f)
Add a
Facet on a slot of this schema |
void |
addSuperSchema(PredicateSchema 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.
|
static ObjectSchema |
getBaseSchema()
Retrieve the generic base schema for all predicates.
|
AbsObject |
newInstance()
Creates an Abstract descriptor to hold a predicate of
the proper type.
|
void |
validate(AbsObject abs,
Ontology onto)
Check whether a given abstract descriptor complies with this
schema.
|
add, add, addSuperSchema, containsSlot, equals, getAllFacets, getFacets, getNames, getOwnNames, getSchema, getSuperSchemas, getTypeName, isAssignableFrom, isCompatibleWith, isMandatory, isOwnSlot, toString, validateSlots
getEncodingByOrder, setEncodingByOrder
public static final String BASE_NAME
private static PredicateSchema baseSchema
private PredicateSchema()
public PredicateSchema(String typeName)
PredicateSchema
with a given type-name,
e.g. FATHER_OF, WORKS_FOR...typeName
- The name of this PredicateSchema
.public static ObjectSchema getBaseSchema()
public void add(String name, ObjectSchema slotSchema)
add
in class ObjectSchemaImpl
name
- The name of the slot.slotSchema
- The schema of the slot.public void add(String name, ObjectSchema slotSchema, int optionality)
add
in class ObjectSchemaImpl
name
- The name of the slot.slotSchema
- The schema of the slot.optionality
- The optionality, i.e. OPTIONAL
or MANDATORY
public void add(String name, TermSchema 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
.name
- 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
valuespublic void add(String name, TermSchema elementsSchema, int cardMin, int cardMax, String aggType)
cardMin
and cardMax
to this schema and allow specifying the type
of Aggregate to be used for this slot.name
- 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, TermSchema, int, int)
public void addSuperSchema(PredicateSchema superClassSchema)
PredicateSchema
must be a PredicateSchema
too.superClassSchema
- The super-schema to be added.public void addFacet(String slotName, Facet f) throws OntologyException
Facet
on a slot of this schemaaddFacet
in class ObjectSchemaImpl
slotName
- the name of the slot the Facet
must be added to.f
- the Facet
to be added.OntologyException
- if slotName does not identify
a valid slot in this schemapublic AbsObject newInstance() throws OntologyException
newInstance
in class ContentElementSchema
OntologyException
public void validate(AbsObject abs, Ontology onto) throws OntologyException
validate
in class ObjectSchemaImpl
abs
- The abstract descriptor to be checkedOntologyException
- If the abstract descriptor does not
complies with this schemaprotected boolean descendsFrom(ObjectSchema s)
descendsFrom
in class ContentElementSchema