Fritz Gerneth
2014-04-14 16:29:58 UTC
Hi,
I have two concepts, one extending the other. Is there any way that the
extending concept can refine the schema-definition of a slot defined in the
super-schema? This is how it currently looks like:
ConceptSchema actionConcept = new ConceptSchema(ACTION);
actionConcept.add(ACTION_ACTOR, new
ConceptSchema(ConceptSchema.BASE_NAME));
actionConcept.add(ACTION_ACTION, new
ConceptSchema(ConceptSchema.BASE_NAME));
AgentActionSchema recommendsConcept = new
AgentActionSchema(RECOMMENDS);
recommendsConcept.addSuperSchema(actionConcept);
recommendsConcept.add(ACTION_ACTION, actionConcept); //
<< further constrain this slot inherited from the super-schema
recommendsConcept.add(REASON, (TermSchema)
TermSchema.getBaseSchema(), ObjectSchema.OPTIONAL);
Here I define the Action "Recommends", add another optional content-slot
"REASON". But I want an the recommends-action further to be refined to only
allow Action-Concepts instead of all Concepts.
Adding another slot to the child-concept adds a second concept-slot, not
overwriting the one of the super-schema. This results in an
OntologyException and later on the ACTION_ACTION slot is present twice in
the message.
I really want this constraint only to be present for Recommends Actions, not
for all Actions. Anyone has an idea on how to solve this?
Fritz
I have two concepts, one extending the other. Is there any way that the
extending concept can refine the schema-definition of a slot defined in the
super-schema? This is how it currently looks like:
ConceptSchema actionConcept = new ConceptSchema(ACTION);
actionConcept.add(ACTION_ACTOR, new
ConceptSchema(ConceptSchema.BASE_NAME));
actionConcept.add(ACTION_ACTION, new
ConceptSchema(ConceptSchema.BASE_NAME));
AgentActionSchema recommendsConcept = new
AgentActionSchema(RECOMMENDS);
recommendsConcept.addSuperSchema(actionConcept);
recommendsConcept.add(ACTION_ACTION, actionConcept); //
<< further constrain this slot inherited from the super-schema
recommendsConcept.add(REASON, (TermSchema)
TermSchema.getBaseSchema(), ObjectSchema.OPTIONAL);
Here I define the Action "Recommends", add another optional content-slot
"REASON". But I want an the recommends-action further to be refined to only
allow Action-Concepts instead of all Concepts.
Adding another slot to the child-concept adds a second concept-slot, not
overwriting the one of the super-schema. This results in an
OntologyException and later on the ACTION_ACTION slot is present twice in
the message.
I really want this constraint only to be present for Recommends Actions, not
for all Actions. Anyone has an idea on how to solve this?
Fritz