From: Cho, H. S. <hs...@ni...> - 2008-11-19 00:30:35
|
Hi, I solved the first proble: java error : There was a problem setting up the reasoner (Pellet). Please ensure that you have the appropriate classes (jar files) are in your class path I used Eclipse for development, I assigned "org.semanticweb.owl.owlapi.jar" as owlapi.jar. and assigned all of jar files in "lib" and "xsdlib" directory of Pellet2.0.0. I succeeded to operate Pellet. I think I had some confusion for selection of OWLPAIs and Java development environment setting. Thank you. ----- Original Message ----- From: "조현상" <ha...@ic...> To: <owl...@li...> Sent: Tuesday, November 18, 2008 10:20 PM Subject: Re: [OWLAPI-developer] Basic qeustion about inference ofdataproperties > Hi Matthew, > > I am a novice and please understand my mistake. > In fact, I tried to use the examples (ex#8, 11). > I installed OWL2.2 version and Pellet 2.0.0-rc3 and Pellet 1.5. > > As you know, I could find several owlapi.jar files from Protégé 4.0β > (from \plugins\org.semanticweb.owl.owlapi.jar), owl2.0 (owlapi-bin.jar), > and Pellet 2.0.0 (pellet-2.0.0-rc3\pellet-2.0.0-rc3\lib\owlapi-bin.jar). > I tried to use each of the owlapi.jar file with Pellet2.0.0 jar files > (pellet-core.jar, pellet-owlapi.jar, aterm-java-1.6.jar, > relaxngDatatype.jar, and xsdlib.jar). > > Finally, I added Protégé 4.0β\plugins\org.semanticweb.owl.owlapi.jar and > added Protégé 4.0β\plugins\ com.owldl.pellet.jar. > > But I got same error from the trials. > OWLReasonerFactory reasonerFactory = new PelletReasonerFactory(); > > Error messages are > > Exception in thread "main" > org.semanticweb.reasonerfactory.OWLReasonerSetupException: There was a > problem setting up the reasoner (Pellet). Please ensure that you have the > appropriate classes (jar files) are in your class path > at > org.semanticweb.reasonerfactory.pellet.PelletReasonerFactory.<init>(PelletReasonerFactory.java:61) > at Example8.main(Example8.java:70) > > Caused by: java.lang.ClassNotFoundException: > org.mindswap.pellet.owlapi.Reasoner > 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) > at java.lang.ClassLoader.loadClassInternal(Unknown Source) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Unknown Source) > at > org.semanticweb.reasonerfactory.pellet.PelletReasonerFactory.<init>(PelletReasonerFactory.java:55) > ... 1 more > > I also assigned Protégé 4.0β\plugins\ to CLASSPATH. > > The error was generated from “PelletReasonerFactory()”. > Could you tell me how can I fix the problem? > > I attach ZIP file of eclipse project. > > Best regards, > Cho, Hyun Sang. > > ----- Original Message ----- > From: "Matthew Horridge" <mat...@cs...> > To: "OWLAPI Developer" <owl...@li...> > Sent: Tuesday, November 18, 2008 8:59 PM > Subject: Re: [OWLAPI-developer] Basic qeustion about inference of > dataproperties > > >> Hi, >> >> It looks like you are using Protege 3 code here. >> ProtegeOWL.createJenaOWLModelFromURI() is part of the Protege 3 >> API. The OWL API is used in Protege 4. There are some examples of >> how to use a reasoner in the documentation section of the OWL API >> website (http://owlapi.sourceforge.net). >> >> Cheers, >> >> Matthew >> >> >> >> On 18 Nov 2008, at 00:54, Cho, Hyun Sang wrote: >> >>> Hi, >>> >>> I have a question about data property inference by using Pellet. >>> Firstly, I assigned three classes for indication of level. The three >>> classes have class expression that determine a including individual, >>> for example, “hasEnergyValue some int[<= "8"^^integer]”. >>> Secondly, I also assigned the data property “hasEnergyValue” for >>> the value. And, I assigned a class “CurrentEnergyZone” that has >>> the data property. >>> Thirdly, I generated an individual “EnergZoneState” from the >>> class. The individual has “hasEnergyValue” property with a >>> numeric value. (Please refer an attached owl file). >>> >>> I did inference by using Protégé 4.0β and got inferred type >>> “GreenEnergyZone”. >>> I heard that one of the outstanding features of Pellet is ability of >>> datatype inference. >>> I got sample program from site, and tried to do same inference by >>> using Java. >>> Source code is as bellows. >>> >>> public class PelletTest { >>> >>> /** >>> * @param args >>> * @throws OntologyLoadException >>> */ >>> >>> @SuppressWarnings("unchecked") >>> public static void main(String[] args) throws >>> OntologyLoadException { >>> // TODO Auto-generated method stub >>> String uri = "http://localhost/Ontologies/example.owl"; >>> OWLModel owlModel = >>> ProtegeOWL.createJenaOWLModelFromURI(uri); >>> >>> ProtegeReasoner reasoner = >>> createPelletOWLAPIReasoner(owlModel); >>> System.out.println("\n = Running example with reasoner >>> " + reasoner.getClass().getSimpleName() + " =\n"); >>> >>> try { >>> >>> OWLIndividual indi2 = >>> owlModel.getOWLIndividual("EnergyZoneState"); >>> >>> reasoner.computeInferredIndividualTypes(); >>> Collection colIndi2 = >>> reasoner.getIndividualTypes(indi2); >>> >>> System.out.println("Types"); >>> >>> if(colIndi2 != null ){ >>> for(Iterator it = colIndi2.iterator(); >>> it.hasNext();) { >>> OWLNamedClass curClass = >>> (OWLNamedClass) it.next(); >>> System.out.println("\t" + >>> curClass.getName()); >>> } >>> } >>> } catch (ProtegeReasonerException e) { >>> // TODO Auto-generated catch block >>> e.printStackTrace(); >>> } >>> >>> } >>> >>> public static ProtegeReasoner createPelletOWLAPIReasoner(OWLModel >>> owlModel){ >>> ReasonerManager reasonerManager = ReasonerManager.getInstance(); >>> >>> ProtegeReasoner reasoner = >>> reasonerManager.createProtegeReasoner(owlModel, >>> ProtegePelletOWLAPIReasoner.class); >>> return reasoner; >>> } >>> } >>> >>> >>> I got results as follows. >>> >>> Types >>> >>> http://www.haemosu.com/ontologies/example.owl#CurrentEnergyZone >>> http://www.w3.org/2002/07/owl#Thing >>> >>> >>> Since I could get “GreenEnergyZone” from Protégé 4.0, I >>> expected to get the class from >>> “reasoner.computeInferredIndividualTypes();” but I couldn’t. >>> Please tell me how I can get the same result with the inference in >>> Protégé 4.0 >>> >>> Best regards, >>> Cho, Hyun Sang. >>> <example_simple.owl> >>> ------------------------------------------------------------------------- >>> This SF.Net email is sponsored by the Moblin Your Move Developer's >>> challenge >>> Build the coolest Linux based applications with Moblin SDK & win >>> great prizes >>> Grand prize is a trip for two to an Open Source event anywhere in >>> the world >>> http://moblin-contest.org/redirect.php?banner_id=100&url=/_______________________________________________ >>> Owlapi-developer mailing list >>> Owl...@li... >>> https://lists.sourceforge.net/lists/listinfo/owlapi-developer >> >> >> ------------------------------------------------------------------------- >> This SF.Net email is sponsored by the Moblin Your Move Developer's >> challenge >> Build the coolest Linux based applications with Moblin SDK & win great >> prizes >> Grand prize is a trip for two to an Open Source event anywhere in the >> world >> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >> _______________________________________________ >> Owlapi-developer mailing list >> Owl...@li... >> https://lists.sourceforge.net/lists/listinfo/owlapi-developer >> -------------------------------------------------------------------------------- > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > Build the coolest Linux based applications with Moblin SDK & win great > prizes > Grand prize is a trip for two to an Open Source event anywhere in the > world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ -------------------------------------------------------------------------------- > _______________________________________________ > Owlapi-developer mailing list > Owl...@li... > https://lists.sourceforge.net/lists/listinfo/owlapi-developer > |