« Return to Thread: JESS,Protege,Applet : Help me please

JESS,Protege,Applet : Help me please

by Daniella Touvet :: Rate this Message:

Reply to Author | View in Thread

hello everybody,

I work with Protege-frame, Jess, JessTab and Eclipse, and my goal is to build an applet using these tools. this is what I can not achieve.

The ontology that I used to represent you my problem consists of a single class called person represented by two slots name and age and having 5 instances.
To try to achieve this applet I used the codes below:

JAVA Code :

import java.awt.Container;

import javax.swing.JApplet;
import javax.swing.JComboBox;
import javax.swing.JPanel;

import jess.JessException;
import jess.QueryResult;
import jess.Rete;
import jess.ValueVector;
import JessTab.JessTabFunctions;

public class app extends JApplet
{
public void init ()
{
                pan = new JPanel ();
                contenu = getContentPane() ;
                contenu.add(pan) ;
                combo = new JComboBox() ;
                pan.add(combo) ;
               
                Rete moteur = new Rete();
                moteur.addUserpackage(new JessTabFunctions());
               
                try {moteur.executeCommand("(load-project onto.pprj)");}
                        catch (JessException e) {e.printStackTrace();}
               
                try {moteur.batch("exp.clp");}
                        catch (JessException e) {e.printStackTrace();}
               
                try {moteur.executeCommand("(run)");}
                        catch (JessException e) {e.printStackTrace();}
               
                try {moteur.eval("(defquery quer (object (is-a person)(name ?n) (age ?a)))");}
                        catch (JessException e) {e.printStackTrace();}
               
                QueryResult champ = null;
               
                try {champ = moteur.runQueryStar("quer",new ValueVector() );}
                        catch (JessException e) {e.printStackTrace();}
               
                while(champ.next())
                        try {combo.addItem(champ.getString("n")+"  "+champ.getInt("a"));}
                                catch (JessException e) {e.printStackTrace();}
         
         
}
        private JComboBox combo;
        private JPanel pan;
        private Container contenu;

}

JESS Code : exp.clp

(reset)

(mapclass person)

While viewing the applet with Eclipse, it works without problem. But when I try to include it in an HTML page using the code below, it does not

HTML Code

<applet
code= "app.class"
name="app"
width="125"
height="125"
archive="jess.jar,JessTab12.jar,protege.jar"
>
</applet>

Knowing that I put in a single file the following elements:

- app.class
- the Jess program
- the ontology (onto.pprj, ontp.pins, onto.pont)
- the jars : protege.jar, JessTab12.jar, jess.jar
- the  HTML page


thank you in advance.

 « Return to Thread: JESS,Protege,Applet : Help me please

LightInTheBox - Buy quality products at wholesale price