[protege-owl] Some .jar missing in compiling ? (hello world example)

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

[protege-owl] Some .jar missing in compiling ? (hello world example)

Cleiton Reis
Hi!

I Trying to compiling the follow example :

=-=-=[ START of  OWLAPIDemoApplication.java ]=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

package com.demo.application;


import edu.stanford.smi.protegex.owl.model.OWLModel;
import edu.stanford.smi.protegex.owl.model.OWLNamedClass;
import edu.stanford.smi.protegex.owl.ProtegeOWL;


public class OWLAPIDemoApplication {


    public static void main(String[] args) {

            OWLModel owlModel = ProtegeOWL.createJenaOWLModel();

            owlModel.getNamespaceManager().setDefaultNamespace("http://hello.com#");

            OWLNamedClass worldClass = owlModel.createOWLNamedClass("World");

            System.out.println("Class URI: " + worldClass.getURI());

       }
}

=-=-=[ END of  OWLAPIDemoApplication.java ]=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


Resulting errors:


=-=-=[ START ERRORS ]=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

user@myhost:~/home/user/onto$ ./jcomp.sh OWLAPIDemoApplication.java

OWLAPIDemoApplication.java:14: cannot access
edu.stanford.smi.protege.model.DefaultKnowledgeBase
file edu/stanford/smi/protege/model/DefaultKnowledgeBase.class not found
            OWLModel owlModel = ProtegeOWL.createJenaOWLModel();

                            ^
OWLAPIDemoApplication.java:16: cannot access
edu.stanford.smi.protege.model.KnowledgeBase
file edu/stanford/smi/protege/model/KnowledgeBase.class not found
            owlModel.getNamespaceManager().setDefaultNamespace("http://hello.com#");
                         ^
OWLAPIDemoApplication.java:20: cannot access
edu.stanford.smi.protege.model.Instance
file edu/stanford/smi/protege/model/Instance.class not found
            System.out.println("Class URI: " + worldClass.getURI());
                                                                              ^
3 errors

=-=-=-[END of ERRORS ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=



Here is my CLASSPATH:



CLASSPATH="./:/usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/antlr.jar:
/usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/arq.jar:
/usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/commons-lang-2.0.jar:
/usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/commons-logging.jar:
/usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/concurrent.jar:
/usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/edtftpj-1.5.2.jar:
/usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/ekitspell.jar:
/usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/icu4j.jar:
/usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/jakarta-oro-2.0.5.jar:
/usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/jcalendar.jar:
/usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/jena.jar:
/usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/junit.jar:
/usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/kazuki.jar:
/usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/log4j.jar:
/usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/owlsyntax.jar:
/usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/protege-owl.jar:
/usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/rdf-api-2001-01-19.jar:
/usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/swrl-jess-bridge.jar:
/usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/xercesImpl.jar:
/usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/xml-apis.jar:
/usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/xmlParserAPIs.jar"


My jdk version is 1.5 running on a Debian box

Reading the FAQ I see that JENA is not needed to Protege-OWL-API works.

Would be a instalation issue of protegé ?

What I miss ? anyone can help me ?

Thanks !
_______________________________________________
protege-owl mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-owl
Reply | Threaded
Open this post in threaded view
|

Re: [protege-owl] Some .jar missing in compiling ? (hello world example)

Tania Tudorache
You need to include also the protege.jar in the classpath. The
protege-owl.jar depends on it.

Tania

Cleiton Reis wrote:

>Hi!
>
>I Trying to compiling the follow example :
>
>=-=-=[ START of  OWLAPIDemoApplication.java ]=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>
>package com.demo.application;
>
>
>import edu.stanford.smi.protegex.owl.model.OWLModel;
>import edu.stanford.smi.protegex.owl.model.OWLNamedClass;
>import edu.stanford.smi.protegex.owl.ProtegeOWL;
>
>
>public class OWLAPIDemoApplication {
>
>
>    public static void main(String[] args) {
>
>            OWLModel owlModel = ProtegeOWL.createJenaOWLModel();
>
>            owlModel.getNamespaceManager().setDefaultNamespace("http://hello.com#");
>
>            OWLNamedClass worldClass = owlModel.createOWLNamedClass("World");
>
>            System.out.println("Class URI: " + worldClass.getURI());
>
>       }
>}
>
>=-=-=[ END of  OWLAPIDemoApplication.java ]=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>
>
>Resulting errors:
>
>
>=-=-=[ START ERRORS ]=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>
>user@myhost:~/home/user/onto$ ./jcomp.sh OWLAPIDemoApplication.java
>
>OWLAPIDemoApplication.java:14: cannot access
>edu.stanford.smi.protege.model.DefaultKnowledgeBase
>file edu/stanford/smi/protege/model/DefaultKnowledgeBase.class not found
>            OWLModel owlModel = ProtegeOWL.createJenaOWLModel();
>
>                            ^
>OWLAPIDemoApplication.java:16: cannot access
>edu.stanford.smi.protege.model.KnowledgeBase
>file edu/stanford/smi/protege/model/KnowledgeBase.class not found
>            owlModel.getNamespaceManager().setDefaultNamespace("http://hello.com#");
>                         ^
>OWLAPIDemoApplication.java:20: cannot access
>edu.stanford.smi.protege.model.Instance
>file edu/stanford/smi/protege/model/Instance.class not found
>            System.out.println("Class URI: " + worldClass.getURI());
>                                                                              ^
>3 errors
>
>=-=-=-[END of ERRORS ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>
>
>
>Here is my CLASSPATH:
>
>
>
>CLASSPATH="./:/usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/antlr.jar:
>/usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/arq.jar:
>/usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/commons-lang-2.0.jar:
>/usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/commons-logging.jar:
>/usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/concurrent.jar:
>/usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/edtftpj-1.5.2.jar:
>/usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/ekitspell.jar:
>/usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/icu4j.jar:
>/usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/jakarta-oro-2.0.5.jar:
>/usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/jcalendar.jar:
>/usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/jena.jar:
>/usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/junit.jar:
>/usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/kazuki.jar:
>/usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/log4j.jar:
>/usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/owlsyntax.jar:
>/usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/protege-owl.jar:
>/usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/rdf-api-2001-01-19.jar:
>/usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/swrl-jess-bridge.jar:
>/usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/xercesImpl.jar:
>/usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/xml-apis.jar:
>/usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/xmlParserAPIs.jar"
>
>
>My jdk version is 1.5 running on a Debian box
>
>Reading the FAQ I see that JENA is not needed to Protege-OWL-API works.
>
>Would be a instalation issue of protegé ?
>
>What I miss ? anyone can help me ?
>
>Thanks !
>_______________________________________________
>protege-owl mailing list
>[hidden email]
>https://mailman.stanford.edu/mailman/listinfo/protege-owl
>
>  
>

_______________________________________________
protege-owl mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-owl
Reply | Threaded
Open this post in threaded view
|

Re: [protege-owl] Some .jar missing in compiling ? (hello world example)

Cleiton Reis
In reply to this post by Cleiton Reis
All Right That's it  Thanks a lot !    protege.jar  missing !

However after compile whitout errors, when run the application I got
the follow :

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Exception in thread "main" java.lang.NoClassDefFoundError:
OWLAPIDemoApplication (wrong name:
com/demo/application/OWLAPIDemoApplication)
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

The creation of a package is necessary ?

commenting the line :

package com.demo.application;

compiling and running again give this :

Exception in thread "main" java.lang.NoClassDefFoundError:
edu/stanford/smi/protegex/owl/model/OWLModel



And thanks again !




2006/9/25, Olivier Dameron <[hidden email]>:

> Quoting Cleiton Reis <[hidden email]>:
> ...
> > OWLAPIDemoApplication.java:14: cannot access
> > edu.stanford.smi.protege.model.DefaultKnowledgeBase
> > file edu/stanford/smi/protege/model/DefaultKnowledgeBase.class not found
> >             OWLModel owlModel = ProtegeOWL.createJenaOWLModel();
>
> > CLASSPATH="./:/usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/antlr.jar:
> > /usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/arq.jar:
> > /usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/commons-lang-2.0.jar:
> > /usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/commons-logging.jar:
> > /usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/concurrent.jar:
> > /usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/edtftpj-1.5.2.jar:
> > /usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/ekitspell.jar:
> > /usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/icu4j.jar:
> > /usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/jakarta-oro-2.0.5.jar:
> > /usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/jcalendar.jar:
> > /usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/jena.jar:
> > /usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/junit.jar:
> > /usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/kazuki.jar:
> > /usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/log4j.jar:
> > /usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/owlsyntax.jar:
> > /usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/protege-owl.jar:
> > /usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/rdf-api-2001-01-19.jar:
> > /usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/swrl-jess-bridge.jar:
> > /usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/xercesImpl.jar:
> > /usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/xml-apis.jar:
> > /usr/local/Protege-3.2/plugins/edu.stanford.smi.protegex.owl/xmlParserAPIs.jar"
>
> It looks like your classpath is missing:
> /usr/local/Protege-3.2/Protege.jar
> This jar file contains all the "default" protege classes... from which
> inherit most of the classes from the owl plugin.
>
> Hope this helps
> Olivier
>
>
_______________________________________________
protege-owl mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-owl
Reply | Threaded
Open this post in threaded view
|

Re: [protege-owl] Some .jar missing in compiling ? (hello world example)

Olivier Dameron
On Tue, 26 Sep 2006 10:44:37 -0300, "Cleiton Reis"
<[hidden email]> wrote:

> However after compile whitout errors, when run the application I got
> the follow :
>
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> Exception in thread "main" java.lang.NoClassDefFoundError:
> OWLAPIDemoApplication (wrong name:
> com/demo/application/OWLAPIDemoApplication)

...

> The creation of a package is necessary ?

no, just copy the com directory (with its demo/application
subdirectories) below ${PROTEGE_HOME}/plugins

and then run protege (do not launch your app directly)
Olivier
_______________________________________________
protege-owl mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-owl
Reply | Threaded
Open this post in threaded view
|

[protege-owl] Relating single instance to all instances of given class

Hugo Ferreira
Hi,

I have the following modelling problem: I have two concepts "Catalogue"
and "Clothes". I also have a property "describes" that allows me to
relate a catalogue to a product. So I can describe the situation where
"Catalogue-x-ware" describes the product "x-men suits". Unfortunately we
also have documents that describe all products of any given class. In
other words I may have a "Catalogue-super-hero-garments" that not only
describes "x-men wear" but also "super-man cape", "bat-man shorts" and
"'The Flash' tights".

Now my question is this: how should I model the above so that "Peter
Parker" [1] can add not only his very specific "Catalogue of spider
costumes" that show off his "spider garments" selection but also add a
new "Catalogue-super-slick-hero-garments" that also points to "x-men
wear", "super-man cape", "bat-man shorts", "'The Flash' tights" and
"spider garments"?

I would like Parker to be able declare the fact that
"Catalogue-super-slick-hero-garments" describes all available super hero
clothing simply by asserting this facts because no user will be able to
manipulate the schema (no matter how much of a hero he or she is). Note
also that I assume that "Catalogue-super-hero-garments" must also
"describe" the newly added "spider garments". What is the best way to do
this?


TIA,
Hugo Ferreira.

[1] http://en.wikipedia.org/wiki/Spider-Man


_______________________________________________
protege-owl mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-owl
Reply | Threaded
Open this post in threaded view
|

Re: [protege-owl] Some .jar missing in compiling ? (hello world example)

Cleiton Reis
In reply to this post by Olivier Dameron
2006/9/26, Olivier Dameron <[hidden email]>:

> On Tue, 26 Sep 2006 10:44:37 -0300, "Cleiton Reis"
> <[hidden email]> wrote:
>
> > However after compile whitout errors, when run the application I got
> > the follow :
> >
> > =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> > Exception in thread "main" java.lang.NoClassDefFoundError:
> > OWLAPIDemoApplication (wrong name:
> > com/demo/application/OWLAPIDemoApplication)
>
> ...
>
> > The creation of a package is necessary ?
>
> no, just copy the com directory (with its demo/application
> subdirectories) below ${PROTEGE_HOME}/plugins
>
> and then run protege (do not launch your app directly)
> Olivier


But I would like to run my app as a stand alone application, not as a
protege plugin ...

The http://protege.stanford.edu/plugins/owl/api/guide.html is not so
clear at this point
he just say:

"Execute this program stand-alone. The output should be "Class URI:
http://hello.com#World"."
_______________________________________________
protege-owl mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-owl
Reply | Threaded
Open this post in threaded view
|

Re: [protege-owl] Some .jar missing in compiling ? (hello world example)

Olivier Dameron
On Tue, 26 Sep 2006 11:56:34 -0300, "Cleiton Reis"
<[hidden email]> wrote:

> But I would like to run my app as a stand alone application, not as a
> protege plugin ...

Then you should include the jar files in your classpath.
Either setup the classpath as an environment variable, or use the '-cp'
option when you invoke java (see 'java -help'). If you choose the
second option, writing a little script might be helpful.

Olivier

_______________________________________________
protege-owl mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-owl