Namespace Name

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

Namespace Name

apachzelt
Dear all,

currently my namespace output looks like this:
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
         xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
         xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
         xmlns:owl="http://www.w3.org/2002/07/owl#"
         xml:base="https://www.biofid.de/bio-ontologies"
         xmlns="https://www.biofid.de/bio-ontologies#"
         xmlns:bio-="https://www.bio.org/bio-ontologies/"
         xmlns:term="http://rs.tdwg.org/dc/terms/"
         xmlns:term2="http://rs.tdwg.org/dwc/terms/">

Please note the "bio-" and "term2". I would like to programmatically change these. I know there is the possibility with get_namespace(base_iri).name to set a name. However, this change does not apply to the saved ontology. Could someone please give me an example of how to approach this issue?

Cheers,

Adrian
Reply | Threaded
Open this post in threaded view
|

Re: Namespace Name

Jiba
Administrator
Hello,

XMLNS prefix are currently automatically generated by Owlready, and there is currently no means to modify them...

While I agree that "bio-" is not very beautiful, it seems to be valid from an XML point of view.

Jiba
Reply | Threaded
Open this post in threaded view
|

Re: Namespace Name

apachzelt
Dear Jiba,

I feared so. And yes, it was mostly the aesthetical part that bothered me.

But still, thanks for your help! :)

Cheers,

Adrian
Reply | Threaded
Open this post in threaded view
|

Re: Namespace Name

civilprogrammer
In reply to this post by Jiba
Hello, I am running into the same issue with Owlready2 (0.48).

Has there been any new means added to the library that enables programmatic control over Namespace prefixes used while saving an Ontology out to a file?

In my case, the prefix that is generated looks like:

www.

... which makes our ontology files rather confusing to inspect... with terms like www.:ont00001.

I'm using RDFLib as a workaround, but I personally prefer the more native Owl-XML encoding that Owlready2 produces, over the RDF-XML that RDFLib outputs... with the exception of this detail with namespace prefixes.

Thanks!