Hello,Please, can you send me a simple example of ceation (load, import, ....) of an ontology.Thank you in advance
> From: [email protected] > To: [email protected] > Subject: Re: Problem jena > Date: Sat, 16 Jun 2012 21:05:33 +0000 > > As Dave already pointed out your stack trace is not Jena code so we can't > help you with that. > > As he also pointed out you are getting a NullPointerException which means > the variable ontModel likely is never instantiated. Like any object > oriented code things are not instantiated by magic, just because that > class comes from Jena doesn't mean it's Jena's fault if you or the code > you are using fail to instantiate it. > > Do you even try and instantiate your OntModel? > > ontModel = ModelFactory.createOntologyModel(); > > Rob > > > On 6/16/12 12:51 PM, "Fairouz FakhFakh" <[email protected]> wrote: > > > > >Thank you for your fast reply.But, in my code, I have: > >import com.hp.hpl.jena.ontology.OntModel; > > > >public class OWLSProfileParser { > >private OntModel ontModel; > > > > > >......String URI= > >"http://www.daml.org/services/owl-s/1.0/BravoAirProfile.owl";ontModel.addL > >oadedImport(URI); > >....} > >So, I think that the problem in "jena.jar". ("OntModel" comes from > >jena).I use jena-2.4.jar . I put this file in the lib of my project and > >in the jre.So, please, can you help me?Thank you in advance. > > > >-- > > > >Fairouz FAKHFAKH > > > >Ingénieur informatique > > > >Ecole Nationale d'Ingénieurs de Sfax > > > >> Date: Sat, 16 Jun 2012 15:21:57 +0100 > >> From: [email protected] > >> To: [email protected] > >> Subject: Re: Problem jena > >> > >> On 16/06/12 14:32, Fairouz FakhFakh wrote: > >> > > >> > Hello,I use: matchmaker-client > >> > In the class OWLSProfileParser, I have a problem in this > >>line:ontModel.addLoadedImport(URI);I have the following error:Exception > >>in thread "main" java.lang.NullPointerException at > >>EDU.cmu.Atlas.owls1_1.parser.OWLSProfileParser.read(OWLSProfileParser.jav > >>a:118) at > >>EDU.cmu.Atlas.owls1_1.parser.OWLSProfileParser.read(OWLSProfileParser.jav > >>a:97) at > >>EDU.cmu.Atlas.matchmaker.client.OWLSMatchmakerClient.parseOWLSProfile(OWL > >>SMatchmakerClient.java:226) at > >>EDU.cmu.Atlas.matchmaker.client.OWLSMatchmakerClient.register(OWLSMatchma > >>kerClient.java:99) at > >>EDU.cmu.Atlas.matchmaker.client.OWLSMatchmakerClient.main(OWLSMatchmakerC > >>lient.java:247) > >> > I found the method "addLoadedImport" in the class "ontModel.class" of > >>the jar jena. > >> > Can someone help me, please?Thank you in advance. > >> > > >> > >> Your exception trace does not show any use of Jena code, you need to > >>ask > >> the people who wrote OWLSProfileParse. > >> > >> If you are getting NPE at the line > >> > >> ontModel.addLoadedImport(URI); > >> > >> then that means ontModel is null. Jena is not getting called. > >> > >> Dave > >> > >> > >> > > >
