Search Mailing List Archives


Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[protege-owl] [protege-discussion] Reasoner and Loading error

Timothy Redmond tredmond at stanford.edu
Fri Jul 30 11:30:01 PDT 2010


I am redirecting this to the protege owl mailing list as this is where 
this question belongs.

On 07/25/2010 11:11 PM, Soha Said wrote:
> I have two problems.
> _First,_ I have an error on model creating line. I don't know why? 
> although i write the right file path, and it reads after that correct 
> ontology (load classes, create instances, set properties.. everything).

It is having trouble with the sqwrl import.  When Protege is started up 
from a distribution it uses a repository that finds this import in a 
particular directory (plugins/edu.stanford.smi.protegex.owl).  This is 
actually a misfeature (it should use the class loader) and I might fix 
this sometime.  In your case this directory can't be found and so it is 
going to the network and gets into trouble.

There are two options.  If you have a handy Protege distribution around 
somewhere you can set a system property (a -D jvm option) as follows:

    -Dprotege.dir="C:\\Program Files\\Protege_3.4.4


(though I am not sure of how you deal with the spaces in the path in 
windows.

Second, you can set up your own repository.  I think that there are 
examples on the protege wiki but I will look later today.
> _Second,_ I use the reasoner to check restrictions applied or not, but 
> I still have problem  that when i set wrong value to class, reasoner 
> doesn't catch, why?

I am not sure exactly what the reasoner is not catching.  Could you send

   1. an ontology
   2. a description of the inference that you expect the reasoner should
      find.


?

-Timothy


> 1- if "Person" is class and "graduate" is string and "Person" has 
> datatype property "adj"
> and I want "Person" has only on adj "graduate".
> So, I say that Person has exactly one adjective and hasvalue "graduate"
> 2- if "Person" is class and "Be" is class and "Person" has object 
> property "cop"
> and I want "Person" has only on cop "Be".
> So, I say that "Person" only "Be"
> _the code:_
> String OWLFile="C:\\Program 
> Files\\Protege_3.4.4\\plugins\\edu.stanford.smi.protegex.owl\\Ontology_work.owl";
> File OwlFile=new File(OWLFile);
> URI OwlUri=OwlFile.toURI();
> OWLModel CollegeModel;
> ProtegeReasoner reasoner;
> CollegeModel=ProtegeOWL.createJenaOWLModelFromURI(OwlUri.toString());
> ReasonerManager reasonmanager = ReasonerManager.getInstance();
> reasoner = 
> reasonmanager.createProtegeReasoner(CollegeModel,ProtegePelletOWLAPIReasoner.class);
> _The error when creating model:_
> WARNING: [Local Folder Repository] The specified file must be a 
> directory. (C:\Program 
> Files\Protege_3.4.4\plugins\edu.stanford.smi.protegex.owl\Prototype\plugins\edu.stanford.smi.protegex.owl) 
> -- LocalFolderRepository.update()
> Loading triples for: 
> file:/C:/Program%20Files/Protege_3.4.4/plugins/edu.stanford.smi.protegex.owl/Ontology_work.owl
>     Completed triple loading after 640 ms
> WARNING: Exception caught trying to parse 
> http://sqwrl.stanford.edu/ontologies/built-ins/3.4/sqwrl.owl for an 
> ontology declaration -- java.io.IOException: 
> java.net.UnknownHostException: sqwrl.stanford.edu
>         at 
> edu.stanford.smi.protegex.owl.repository.util.URLInputSource.getInputStream(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.repository.util.OntologyNameExtractor.searchForOntologyDeclaration(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.repository.util.OntologyNameExtractor.init(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.repository.util.OntologyNameExtractor.<init>(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.repository.impl.HTTPRepository.update(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.repository.impl.HTTPRepository.<init>(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.repository.RepositoryManager.getRepository(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.model.impl.AbstractOWLModel.getRepository(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.model.impl.AbstractOWLModel.loadImportedAssertions(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.jena.parser.ProtegeOWLParser.processImports(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.jena.parser.ProtegeOWLParser.loadTriples(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.jena.parser.ProtegeOWLParser.run(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.jena.JenaKnowledgeBaseFactory.loadKnowledgeBase(Unknown 
> Source)
>         at edu.stanford.smi.protege.model.Project.loadDomainKB(Unknown 
> Source)
>         at 
> edu.stanford.smi.protege.model.Project.createDomainKnowledgeBase(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.jena.creator.OwlProjectFromUriCreator.create(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.ProtegeOWL.createJenaOWLModelFromURI(Unknown 
> Source)
>         at prototype.Main.InstantiateConcepts(Main.java:113)
>         at prototype.Main.main(Main.java:83)
> Caused by: Could not get input stream for 
> http://sqwrl.stanford.edu/ontologies/built-ins/3.4/sqwrl.owl
>         at 
> edu.stanford.smi.protegex.owl.jena.parser.ProtegeOWLParser.getInputStream(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.repository.util.URLInputSource.getInputStream(Unknown 
> Source)
>         ... 18 more
> Caused by: java.net.UnknownHostException: sqwrl.stanford.edu
>         at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
>         at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
>         at java.net.Socket.connect(Socket.java:525)
>         at sun.net.NetworkClient.doConnect(NetworkClient.java:158)
>         at sun.net.www.http.HttpClient.openServer(HttpClient.java:394)
>         at sun.net.www.http.HttpClient.openServer(HttpClient.java:529)
>         at sun.net.www.http.HttpClient.<init>(HttpClient.java:233)
>         at sun.net.www.http.HttpClient.New(HttpClient.java:306)
>         at sun.net.www.http.HttpClient.New(HttpClient.java:323)
>         at 
> sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:860)
>         at 
> sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:801)
>         at 
> sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:726)
>         at 
> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1049)
>         at 
> edu.stanford.smi.protegex.owl.jena.parser.ProtegeOWLParser.getInputStream(Unknown 
> Source)
>         ... 19 more
> WARNING: Exception caught trying to parse 
> http://sqwrl.stanford.edu/ontologies/built-ins/3.4/sqwrl.owl for an 
> ontology declaration -- java.io.IOException: 
> java.net.UnknownHostException: sqwrl.stanford.edu
>         at 
> edu.stanford.smi.protegex.owl.repository.util.URLInputSource.getInputStream(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.repository.util.OntologyNameExtractor.searchForOntologyDeclaration(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.repository.util.OntologyNameExtractor.init(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.repository.util.OntologyNameExtractor.<init>(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.repository.impl.ForcedURLRetrievalRepository.refresh(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.repository.impl.ForcedURLRetrievalRepository.<init>(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.repository.RepositoryManager.getRepository(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.model.impl.AbstractOWLModel.getRepository(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.model.impl.AbstractOWLModel.loadImportedAssertions(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.jena.parser.ProtegeOWLParser.processImports(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.jena.parser.ProtegeOWLParser.loadTriples(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.jena.parser.ProtegeOWLParser.run(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.jena.JenaKnowledgeBaseFactory.loadKnowledgeBase(Unknown 
> Source)
>         at edu.stanford.smi.protege.model.Project.loadDomainKB(Unknown 
> Source)
>         at 
> edu.stanford.smi.protege.model.Project.createDomainKnowledgeBase(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.jena.creator.OwlProjectFromUriCreator.create(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.ProtegeOWL.createJenaOWLModelFromURI(Unknown 
> Source)
>         at prototype.Main.InstantiateConcepts(Main.java:113)
>         at prototype.Main.main(Main.java:83)
> Caused by: Could not get input stream for 
> http://sqwrl.stanford.edu/ontologies/built-ins/3.4/sqwrl.owl
>         at 
> edu.stanford.smi.protegex.owl.jena.parser.ProtegeOWLParser.getInputStream(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.repository.util.URLInputSource.getInputStream(Unknown 
> Source)
>         ... 18 more
> Caused by: java.net.UnknownHostException: sqwrl.stanford.edu
>         at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
>         at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
>         at java.net.Socket.connect(Socket.java:525)
>         at sun.net.NetworkClient.doConnect(NetworkClient.java:158)
>         at sun.net.www.http.HttpClient.openServer(HttpClient.java:394)
>         at sun.net.www.http.HttpClient.openServer(HttpClient.java:529)
>         at sun.net.www.http.HttpClient.<init>(HttpClient.java:233)
>         at sun.net.www.http.HttpClient.New(HttpClient.java:306)
>         at sun.net.www.http.HttpClient.New(HttpClient.java:323)
>         at 
> sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:860)
>         at 
> sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:801)
>         at 
> sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:726)
>         at 
> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1049)
>         at 
> edu.stanford.smi.protegex.owl.jena.parser.ProtegeOWLParser.getInputStream(Unknown 
> Source)
>         ... 19 more
> WARNING: The system cannot find the ontology 
> http://sqwrl.stanford.edu/ontologies/built-ins/3.4/sqwrl.owl in any of 
> the repositories. This import will be ignored. -- 
> UnresolvedImportUIHandler.handleUnresolvableImport()
> WARNING: Exception caught trying to parse 
> http://swrl.stanford.edu/ontologies/3.3/swrla.owl for an ontology 
> declaration -- java.io.IOException: java.net.UnknownHostException: 
> swrl.stanford.edu
>         at 
> edu.stanford.smi.protegex.owl.repository.util.URLInputSource.getInputStream(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.repository.util.OntologyNameExtractor.searchForOntologyDeclaration(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.repository.util.OntologyNameExtractor.init(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.repository.util.OntologyNameExtractor.<init>(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.repository.impl.HTTPRepository.update(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.repository.impl.HTTPRepository.<init>(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.repository.RepositoryManager.getRepository(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.model.impl.AbstractOWLModel.getRepository(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.model.impl.AbstractOWLModel.loadImportedAssertions(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.jena.parser.ProtegeOWLParser.processImports(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.jena.parser.ProtegeOWLParser.loadTriples(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.jena.parser.ProtegeOWLParser.run(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.jena.JenaKnowledgeBaseFactory.loadKnowledgeBase(Unknown 
> Source)
>         at edu.stanford.smi.protege.model.Project.loadDomainKB(Unknown 
> Source)
>         at 
> edu.stanford.smi.protege.model.Project.createDomainKnowledgeBase(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.jena.creator.OwlProjectFromUriCreator.create(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.ProtegeOWL.createJenaOWLModelFromURI(Unknown 
> Source)
>         at prototype.Main.InstantiateConcepts(Main.java:113)
>         at prototype.Main.main(Main.java:83)
> Caused by: Could not get input stream for 
> http://swrl.stanford.edu/ontologies/3.3/swrla.owl
>         at 
> edu.stanford.smi.protegex.owl.jena.parser.ProtegeOWLParser.getInputStream(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.repository.util.URLInputSource.getInputStream(Unknown 
> Source)
>         ... 18 more
> Caused by: java.net.UnknownHostException: swrl.stanford.edu
>         at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
>         at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
>         at java.net.Socket.connect(Socket.java:525)
>         at sun.net.NetworkClient.doConnect(NetworkClient.java:158)
>         at sun.net.www.http.HttpClient.openServer(HttpClient.java:394)
>         at sun.net.www.http.HttpClient.openServer(HttpClient.java:529)
>         at sun.net.www.http.HttpClient.<init>(HttpClient.java:233)
>         at sun.net.www.http.HttpClient.New(HttpClient.java:306)
>         at sun.net.www.http.HttpClient.New(HttpClient.java:323)
>         at 
> sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:860)
>         at 
> sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:801)
>         at 
> sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:726)
>         at 
> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1049)
>         at 
> edu.stanford.smi.protegex.owl.jena.parser.ProtegeOWLParser.getInputStream(Unknown 
> Source)
>         ... 19 more
> WARNING: Exception caught trying to parse 
> http://swrl.stanford.edu/ontologies/3.3/swrla.owl for an ontology 
> declaration -- java.io.IOException: java.net.UnknownHostException: 
> swrl.stanford.edu
>         at 
> edu.stanford.smi.protegex.owl.repository.util.URLInputSource.getInputStream(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.repository.util.OntologyNameExtractor.searchForOntologyDeclaration(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.repository.util.OntologyNameExtractor.init(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.repository.util.OntologyNameExtractor.<init>(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.repository.impl.ForcedURLRetrievalRepository.refresh(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.repository.impl.ForcedURLRetrievalRepository.<init>(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.repository.RepositoryManager.getRepository(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.model.impl.AbstractOWLModel.getRepository(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.model.impl.AbstractOWLModel.loadImportedAssertions(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.jena.parser.ProtegeOWLParser.processImports(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.jena.parser.ProtegeOWLParser.loadTriples(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.jena.parser.ProtegeOWLParser.run(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.jena.JenaKnowledgeBaseFactory.loadKnowledgeBase(Unknown 
> Source)
>         at edu.stanford.smi.protege.model.Project.loadDomainKB(Unknown 
> Source)
>         at 
> edu.stanford.smi.protege.model.Project.createDomainKnowledgeBase(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.jena.creator.OwlProjectFromUriCreator.create(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.ProtegeOWL.createJenaOWLModelFromURI(Unknown 
> Source)
>         at prototype.Main.InstantiateConcepts(Main.java:113)
>         at prototype.Main.main(Main.java:83)
> Caused by: Could not get input stream for 
> http://swrl.stanford.edu/ontologies/3.3/swrla.owl
>         at 
> edu.stanford.smi.protegex.owl.jena.parser.ProtegeOWLParser.getInputStream(Unknown 
> Source)
>         at 
> edu.stanford.smi.protegex.owl.repository.util.URLInputSource.getInputStream(Unknown 
> Source)
>         ... 18 more
> Caused by: java.net.UnknownHostException: swrl.stanford.edu
>         at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
>         at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
>         at java.net.Socket.connect(Socket.java:525)
>         at sun.net.NetworkClient.doConnect(NetworkClient.java:158)
>         at sun.net.www.http.HttpClient.openServer(HttpClient.java:394)
>         at sun.net.www.http.HttpClient.openServer(HttpClient.java:529)
>         at sun.net.www.http.HttpClient.<init>(HttpClient.java:233)
>         at sun.net.www.http.HttpClient.New(HttpClient.java:306)
>         at sun.net.www.http.HttpClient.New(HttpClient.java:323)
>         at 
> sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:860)
>         at 
> sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:801)
>         at 
> sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:726)
>         at 
> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1049)
>         at 
> edu.stanford.smi.protegex.owl.jena.parser.ProtegeOWLParser.getInputStream(Unknown 
> Source)
>         ... 19 more
>
>
> _______________________________________________
> protege-discussion mailing list
> protege-discussion at lists.stanford.edu
> https://mailman.stanford.edu/mailman/listinfo/protege-discussion
>
> Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03
>    

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.stanford.edu/pipermail/protege-owl/attachments/20100730/77d86f19/attachment.html>


More information about the protege-owl mailing list