ontology-tools / py-horned-owl

A library for Web Ontology Language in Python created using a bridge from horned-owl to python using PyO3.

Home Page:https://ontology-tools.github.io/py-horned-owl/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

owx rendering differences with OWL API

Eugenio2192 opened this issue · comments

This probably belongs to the horned-owl itself but I discovered it here so I write it here first in case you find a root cause in this library.

So I have been using this in parallel with ROBOT to try out some automatic checks and I noticed that if I read a owx file written by ROBOT(OWLAPI) and then read it in into py-horned-owl and then save it without altering it I get an inconsistency that makes the file not undestandable by OWLAPI. The xml Namespaces are not appearing. See this example:

This is the header of the output of OWLAPI:

<?xml version="1.0"?>
<Ontology xmlns="http://www.w3.org/2002/07/owl#"
     xml:base="http://openenergy-platform.org/ontology/oeo/oeo-physical/"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
     xmlns:xml="http://www.w3.org/XML/1998/namespace"
     xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
     ontologyIRI="http://openenergy-platform.org/ontology/oeo/oeo-physical/"
     versionIRI="http://openenergy-platform.org/ontology/oeo/dev/oeo-physical.omn">
    <Prefix name="owl" IRI="http://www.w3.org/2002/07/owl#"/>
    <Prefix name="rdf" IRI="http://www.w3.org/1999/02/22-rdf-syntax-ns#"/>
    <Prefix name="xml" IRI="http://www.w3.org/XML/1998/namespace"/>
    <Prefix name="xsd" IRI="http://www.w3.org/2001/XMLSchema#"/>
    <Prefix name="rdfs" IRI="http://www.w3.org/2000/01/rdf-schema#"/>

This is the output of horned-owl:

<?xml version="1.0"?>
<Ontology xmlns="http://www.w3.org/2002/07/owl#">
    <Prefix name="owl" IRI="http://www.w3.org/2002/07/owl#"/>
    <Prefix name="rdf" IRI="http://www.w3.org/1999/02/22-rdf-syntax-ns#"/>
    <Prefix name="xml" IRI="http://www.w3.org/XML/1998/namespace"/>
    <Prefix name="xsd" IRI="http://www.w3.org/2001/XMLSchema#"/>
    <Prefix name="rdfs" IRI="http://www.w3.org/2000/01/rdf-schema#"/>

When I try to convert this last version to something else using OWLAPI I get an empty file.

I don't see the generation of these Namespaces happening anywhere here:

https://github.com/phillord/horned-owl/blob/e33ea9e98df83773ddead0bbe438955690b6b73c/src/io/owx/writer.rs#L228

So the root cause may be there. If you think the same I can just bring this issue to @phillord

@phillord what do you think?

It's simple to reproduce on horned with:

cargo run --bin horned-round src/ont/owl-xml/some.owx

So, it's my fault. I'll open a bug report on horned.

@Eugenio2192 Out of curiosity, when you say the file is "not understandable" by the OWL API, how are you detecting this?

I'm trying to write a test and the OWL API parses the output fine (but doesn't find any classes!).

@Eugenio2192 Out of curiosity, when you say the file is "not understandable" by the OWL API, how are you detecting this?

I'm trying to write a test and the OWL API parses the output fine (but doesn't find any classes!).

As far as I remember that's more or less what I meant.

@phillord What is the status here, is the issue in Horned-OWL resolved?

Hello just wanted to point out that there are still rendering differences. Prefixes are not rendering.

I recently figured out that EquivalentClass axioms are not being parsed. I don't know if this is also coming from the rust library or from this one. Nevermind, this is not an issue, the axioms were only scrambled around the file :)

Here is a small example pair, ao_infrastructure.owx is the output from OWLAPI and the file ao_infrastructure_pho.owx

example_rendering.zip

Nevertheless, I wanted to say thanks for the great job, the tool is still very bare-bones but can already do pretty cool things. Thanks thanks thanks!

Hello just wanted to point out that there are still rendering differences. Prefixes are not rendering.

I recently figured out that EquivalentClass axioms are not being parsed. I don't know if this is also coming from the rust library or from this one. Nevermind, this is not an issue, the axioms were only scrambled around the file :)

Here is a small example pair, ao_infrastructure.owx is the output from OWLAPI and the file ao_infrastructure_pho.owx

example_rendering.zip

Nevertheless, I wanted to say thanks for the great job, the tool is still very bare-bones but can already do pretty cool things. Thanks thanks thanks!

It is actually fixed, the problem there was arising because the environment I was using had an older installation. I tried again at home and the owx files are rendering properly (almost, still no new lines per ontology prefixes, but functionality is there) I will close this issue.

Awesome! Thanks @Eugenio2192 , @areleu and @phillord !