Discussion:
[jade-develop] Refining concept-slots in child-concepts
Fritz Gerneth
2014-04-14 16:29:58 UTC
Permalink
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
Surachit Sarkar
2014-04-15 07:41:23 UTC
Permalink
I unzipped JADE 4.3.1 there were only jade.jar and
jadeexamples.jar.in the commons-codec folder i got
commons-codec-1.3.jar.there were no http.jar,iiop.jar and
jadeTools.jar. I set the CLASSPATH variable in environmentvariables.
when I am trying the code echo %CLASSPATH% ,I am getting the following
code -->

C:\Program Files\Java\jade\lib\jade.jar;C:\Program Files\Java\jade\lib\commons-c
odec\commons-codec-1.3.jar;C:\Documents and Settings\surachit\workspace\HelloWor
ldAgent\bin;C:\Program Files\Java\jade\classes;

my jade folder is in C:\Program Files\Java\jade directory.

when I am trying --> java jade.boot -gui I am getting this message back-->

C:\Program Files\Java\jade\lib>java jade.boot -gui
Exception in thread "main" java.lang.NoClassDefFoundError: jade/boot
Caused by: java.lang.ClassNotFoundException: jade.boot
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: jade.boot. Program will exit.


I am posting the same problem again and again and everybody is
reffering to see some webpages that I already have read.

please help me in this regard .I have an assignment.And for the last
month I still didnt make any single agent.

you told me to use eclipse.there I did everything that was
mentioned.but while running an agent I am getting the same
error....Exception in thread "main" java.lang.NoClassDefFoundError:
jade/boot
Caused by: java.lang.ClassNotFoundException: jade.boot bla bla....


please I need help,otherwise my life will become hell.I have already
extended my submitting date by one month.My mobile no is--> +91
9143414621........please help me.if you know the easy steps tell
me.please provide me your mobile no so that I can clear my doubt.I am
getting late by internet posting...please help.
Post by Fritz Gerneth
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
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
_______________________________________________
jade-develop mailing list
jade-develop at avalon.tilab.com
https://avalon.cselt.it/mailman/listinfo/jade-develop
UNSUBSCRIBE INSTRUCTIONS AT
http://jade.tilab.com/community-mailinglist.htm
Nahashon Kibet
2014-04-15 08:01:36 UTC
Permalink
Surachit,

The command should be:

*java jade.Boot -gui*

--
Regards,

Nahashon Kibet.


On Tue, Apr 15, 2014 at 10:41 AM, Surachit Sarkar
Post by Surachit Sarkar
I unzipped JADE 4.3.1 there were only jade.jar and
jadeexamples.jar.in the commons-codec folder i got
commons-codec-1.3.jar.there were no http.jar,iiop.jar and
jadeTools.jar. I set the CLASSPATH variable in environmentvariables.
when I am trying the code echo %CLASSPATH% ,I am getting the following
code -->
C:\Program Files\Java\jade\lib\jade.jar;C:\Program
Files\Java\jade\lib\commons-c
odec\commons-codec-1.3.jar;C:\Documents and
Settings\surachit\workspace\HelloWor
ldAgent\bin;C:\Program Files\Java\jade\classes;
my jade folder is in C:\Program Files\Java\jade directory.
when I am trying --> java jade.boot -gui I am getting this message back-->
C:\Program Files\Java\jade\lib>java jade.boot -gui
Exception in thread "main" java.lang.NoClassDefFoundError: jade/boot
Caused by: java.lang.ClassNotFoundException: jade.boot
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: jade.boot. Program will exit.
I am posting the same problem again and again and everybody is
reffering to see some webpages that I already have read.
please help me in this regard .I have an assignment.And for the last
month I still didnt make any single agent.
you told me to use eclipse.there I did everything that was
mentioned.but while running an agent I am getting the same
jade/boot
Caused by: java.lang.ClassNotFoundException: jade.boot bla bla....
please I need help,otherwise my life will become hell.I have already
extended my submitting date by one month.My mobile no is--> +91
9143414621........please help me.if you know the easy steps tell
me.please provide me your mobile no so that I can clear my doubt.I am
getting late by internet posting...please help.
Post by Fritz Gerneth
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
Post by Fritz Gerneth
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
Post by Fritz Gerneth
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
_______________________________________________
jade-develop mailing list
jade-develop at avalon.tilab.com
https://avalon.cselt.it/mailman/listinfo/jade-develop
UNSUBSCRIBE INSTRUCTIONS AT
http://jade.tilab.com/community-mailinglist.htm
_______________________________________________
jade-develop mailing list
jade-develop at avalon.tilab.com
https://avalon.cselt.it/mailman/listinfo/jade-develop
UNSUBSCRIBE INSTRUCTIONS AT
http://jade.tilab.com/community-mailinglist.htm
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://avalon.cselt.it/pipermail/jade-develop/attachments/20140415/d5c63847/attachment.html>
Caire Giovanni
2014-04-16 21:54:25 UTC
Permalink
Hi,

You should be able to do what you need by adding a Facet to the ACTION_ACTION slot of the recommendsConcept concept.
A Facet is an instance of a class that implements the jade.content.schema.Facet interface and can be used to perform additional checks on slot values.

AgentActionSchema recommendsConcept = new AgentActionSchema(RECOMMENDS);
recommendsConcept.addSuperSchema(actionConcept);
recommendsConcept.addFacet(ACTION_ACTION, new Facet() {
public void validate(AbsObject value, Ontology onto) throws OntologyException {
ObjectSchema valueSchema = onto.getSchema(value.getTypeName());
ObjectSchema actionConceptSchema = onto.getSchema((ACTION);
if (!valueSchema.isCompatibleWith(actionConceptSchema)) {
throw new OntologyException("Value "+value+" is not a "+ACTION);
}
}
});
recommendsConcept.add(REASON, (TermSchema) TermSchema.getBaseSchema(), ObjectSchema.OPTIONAL);


Bye,

Giovanni


-----Messaggio originale-----
Da: jade-develop-bounces at avalon.tilab.com [mailto:jade-develop-bounces at avalon.tilab.com] Per conto di Fritz Gerneth
Inviato: luned? 14 aprile 2014 18:30
A: jade-develop at avalon.tilab.com
Oggetto: [jade-develop] Refining concept-slots in child-concepts

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

_______________________________________________
jade-develop mailing list
jade-develop at avalon.tilab.com
https://avalon.cselt.it/mailman/listinfo/jade-develop
UNSUBSCRIBE INSTRUCTIONS AT
http://jade.tilab.com/community-mailinglist.htm

Loading...