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-discussion] Fwd: problems importing an OWL ontology

Alexandre Vidal vidal at ime.usp.br
Wed Jul 18 04:41:50 PDT 2007


Hi, everybody.

I am  having troubles when loading a OWL ontologies that imports other OWL
ontology.
The problem does not happen whit an ontology that does not use the import
mechanism.
I have no troubles when using Protégé-OWL. I even got inferred class
hierarchies of both the ontologies.

Loading triples
SEVERE: Exception caught -- java.io.FileNotFoundException:
http://www.deinf.ufma.br/~vidal/GO/Ontology1184719492.owl<http://www.deinf.ufma.br/%7Evidal/GO/Ontology1184719492.owl>(the
imported ontology
)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(
HttpURLConnection.java:1172)
    at
edu.stanford.smi.protegex.owl.jena.parser.ProtegeOWLParser.getInputStream(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.jena.parser.ProtegeOWLParser.getRepository(Unknown
Source)
    at edu.stanford.smi.protegex.owl.jena.parser.ProtegeOWLParser.runImport(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.parser.ProtegeOWLParser.run(Unknown
Source)
    at edu.stanford.smi.protegex.owl.jena.parser.ProtegeOWLParser.run(Unknown
Source)
    at edu.stanford.smi.protegex.owl.jena.JenaOWLModel.load (Unknown Source)
    at edu.stanford.smi.protegex.owl.ProtegeOWL.createJenaOWLModelFromURI(Unknown
Source)
    at com.demo.application.OWLAPIDemoApplication.main(
OWLAPIDemoApplication.java:30)

I am only testing and both the ontologies have only one class. I use this
code copied and adapted from
The Protégé-OWL API Programmer's Guide.

public class OWLAPIDemoApplication {
    public static void main(String[] args) {
        final String ONTOLOGY_URL =
"http://www.deinf.ufma.br/~vidal/GO/client.owl<http://www.deinf.ufma.br/%7Evidal/GO/client.owl>
";
         final String REASONER_URL = "http://localhost:8081 ";
        try {
            JenaOWLModel gridOwlModel =
ProtegeOWL.createJenaOWLModelFromURI(ONTOLOGY_URL);
// LINE ERROR
            ReasonerManager reasonerManager = ReasonerManager.getInstance();

            ProtegeOWLReasoner reasoner =
reasonerManager.getReasoner(gridOwlModel);
            //    Set the reasoner URL and test the connection.
            reasoner.setURL(REASONER_URL);

            if (reasoner.isConnected()) {
                DIGReasonerIdentity reasonerIdentity = reasoner.getIdentity();

                System.out.println("Connected to " +
reasonerIdentity.getName() + " " +
                        reasonerIdentity.getVersion());

                //    We can classify the whole ontology, which will put the

                //    inferred class hierarchy information directly into the
Protégé-OWL model.
                System.out.println("Classifying taxonomy...");
                reasoner.classifyTaxonomy (null);
                System.out.println("...Classified taxonomy!");
            }
            else {
                System.out.println("Reasoner not connected!");
            }
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

Could someone please help me?
Thanks.

Alexandre
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.stanford.edu/pipermail/protege-discussion/attachments/20070718/f06c97bd/attachment.html>


More information about the protege-discussion mailing list