Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing namespaces from OWX round trip #46

Closed
phillord-ncl opened this issue Oct 11, 2022 · 5 comments
Closed

Missing namespaces from OWX round trip #46

phillord-ncl opened this issue Oct 11, 2022 · 5 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@phillord-ncl
Copy link
Contributor

ontology-tools/py-horned-owl#6

@phillord-ncl
Copy link
Contributor Author

The OWL API produces this:

<Ontology xmlns="http://www.w3.org/2002/07/owl#"
     xml:base="http://www.example.com/iri"
     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://www.example.com/iri"
     versionIRI="http://www.example.com/viri">
    <Prefix name="o" IRI="http://www.example.com/iri#"/>
    <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#"/>
...

Where the prefixes are both specified as namespaces and prefixes. Horned just produces the prefixes.

I may be slightly biased, but horned's approach seems more sensible. I have no ideal at all who is closer to the spec.

@ignazio1977 @jamesaoverton Anyone got any ideas who is right? (Or rather, ignazio1977 will be right, of course, but why is he right?)

@ignazio1977
Copy link

I'm hardly ever right (just ask my kid), however here the difference is that the namespaces are XML functionality and the prefixes are syntax specific. So with the XML namespaces you can shorten XML elements, without you might have illegal XML, depending on the renderer.

@phillord
Copy link
Owner

Thanks to @Eugenio2192, I have added an attempt at fixing this now.

I'd welcome feedback on whether this work for its intended purpose.

@filippodebortoli filippodebortoli added bug Something isn't working enhancement New feature or request labels Feb 22, 2023
@areleu
Copy link

areleu commented Apr 4, 2024

I think this can be closed, the namespaces are rendering properly.

Regarding the pretty printing, I was working on a PR in tafia/quick-xml#731 but it may take some time until they decide if they merge it so we might need to wait for that.

@phillord
Copy link
Owner

As we think this is all sorted, I will close now. Pretty printing can come later!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants