vangelisv / thea

OWL2 library for Prolog
http://vangelisv.github.com/thea
108 stars 19 forks source link

Loading OWL 2 XML formatted ontologies #21

Closed Kaljurand closed 14 years ago

Kaljurand commented 14 years ago

I'm trying to load this ontology:

<?xml version="1.0" encoding="UTF-8"?>

<Ontology
    xml:base="http://www.w3.org/2002/07/owl#"
    xmlns="http://www.w3.org/2002/07/owl#"
    ontologyIRI="http://attempto.ifi.uzh.ch/ontologies/owlswrl/test">
    <SubClassOf>
        <Class    
            IRI="http://attempto.ifi.uzh.ch/ontologies/owlswrl/test#man"/>
        <Class                
            IRI="http://attempto.ifi.uzh.ch/ontologies/owlswrl/test#human"/>
    </SubClassOf>
</Ontology>                             

using the following commands (after unpacking thea2-2010-06-25.tar.gz as thea2/):

$ swipl
?- assert(user:file_search_path(library, '.')).
?- [library(thea2/owl2_io)].
?- load_axioms('test.owl', owlx).

But it fails:

ERROR: Unhandled exception: Unknown message: no_parse(test.owl)
cmungall commented 14 years ago

V, do you want to take this one? I haven't looked at owl2_xml in a while. I started looking into this and there appears to be a few problems. You've worked with owlxml a lot for owllink - have you thoroughly tested parsing as well as generation?

Also there's a few things in owl2_xml that predated owlxml becoming a standard, and were intended to work with older versions of protege. I think we can ditch these now and assume all owlx conforms to the spec.

Kaljurand - for now I'm afraid you'll have to work with rdf/xml - you can use Protege4 to load your owlx and then save as rdf/xml.

vangelisv commented 14 years ago

Indeed I worked quite a lot with owl2_xml at the time. I will take it. Kaljurand can you please send me the test.owl file?

Kaljurand commented 14 years ago

vangelisv, the content of the test ontology is present in my first mail in this thread. You can also get it by:

curl "http://attempto.ifi.uzh.ch/ws/ape/apews.perl?text=Every+man+is+a+human.&solo=owlxml"

Some of the reasons why this is not loaded are:

  1. XML element names are expected to be terms of form :(A, B)
  2. Attribute "URI" is expected instead of "IRI" (i.e. OWL ~1.1 is expected instead of OWL 2)
vangelisv commented 14 years ago

Indeed it works with IRI. I'm currently implementing a solution to neatly handle both IRI and URI. Expect to have it committed by tomorrow.

vangelisv commented 14 years ago

Fixed - Committed in owlxml branch, not yet in master