Parser from OWL/XML TO RDF/XML problem

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Parser from OWL/XML TO RDF/XML problem

Jesus
I've used

 from owlready import *
 onto = get_ontology("file://C:\\Users\\ ... myPathTo.owl ...").load()
 onto.save(file=" ... name ...", format = "rdfxml")

but it gets errors when is executed such as

 "Ontology IRI does not ends with '.owl' as expected."
Reply | Threaded
Open this post in threaded view
|

Re: Parser from OWL/XML TO RDF/XML problem

Jiba
Administrator
Hi,

Which version of Owlready are you using? This error was present in Owlready 1, but no longer exists in Owlready 2. I highly encourage you to switch to version 2, because it is much faster, has more functionalities and also better parsers.

Jiba
Reply | Threaded
Open this post in threaded view
|

Re: Parser from OWL/XML TO RDF/XML problem

Jesus

Thanks for such a quick reply. But it still does not work, this crashes in some lines. For example with Protégé it works without problems, I don't know what differences there will be
Reply | Threaded
Open this post in threaded view
|

Re: Parser from OWL/XML TO RDF/XML problem

Jiba
Administrator
Hi,

I need more information to investigate the problem. Can you give me the entire error message (including the traceback)? An example of code and/or ontology could help too.

Jiba
Reply | Threaded
Open this post in threaded view
|

Re: Parser from OWL/XML TO RDF/XML problem

Jesus
Hi,

It's confidential and I can not share it.

---- the code is

from owlready2 import *

drm = get_ontology("file://C:\\Users\\...Path to ...\\file.owl").load()

and it fails.

---- the traceback is

Previously I get an error in line
...
...
...
KeyError: 'ontologyIRI'  

The above exception was the direct cause of the following exception:
...
...
...

File "..... \PYTHON\lib\site-packages\owlready2\owlxml_2_ntriples.py", line 492, in parse
    raise OwlReadyOntologyParsingError("OWL/XML parsing error in file %s, line %s, column %s." % (getattr(f, "name", getattr(f, "url", "???")), parser.CurrentLineNumber, parser.CurrentColumnNumber)) from e
owlready2.base.OwlReadyOntologyParsingError: OWL/XML parsing error in file .....\file.owl, line 7, column 56.



I do not know what happens ...

best wishes

Reply | Threaded
Open this post in threaded view
|

Re: Parser from OWL/XML TO RDF/XML problem

Jiba
Administrator
Hi,

It seems that your ontology is in OWL/XML format, and that the <Ontology> tag has no "ontologyIRI=" attribute. This attribute normally indicate the IRI of the ontology. Is it missing?

Jiba