Prefix replaced when exporting ontology

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

Prefix replaced when exporting ontology

Frederike Neuber

Dear list,

while working with Protégé, I faced a problem concerning prefixes of namespaces that change when I export my ontology with inferred axioms. The prefixes that change are my project specific prefix (let’s call it „pref-v2“ for ‚version 2‘) and the frbr-prefix. I hope I can make the issue clearer with the example that follows.

Before exporting the ontology, the namespace declarations in the xml/rdf file look like this:

<rdf:RDF xmlns="http://myontology.de/example#"

     xml:base="http://myontology.de/example"

     xmlns:pref-v2="http://myontology.de/example#"

     xmlns:frbr="http://purl.org/vocab/frbr/core#"

     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

     xmlns:owl="http://www.w3.org/2002/07/owl#"

     xmlns:xml="http://www.w3.org/XML/1998/namespace"

     xmlns:xsd="http://www.w3.org/2001/XMLSchema#"

     xmlns:skos="http://www.w3.org/2004/02/skos/core#"

     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"

     xmlns:dc="http://purl.org/dc/terms/">

In the Protégé GUI, the prefixes are like above also displayed in the Active Ontology > Ontology Prefixes tab.

Now, here are the prefixes after the export with inferred axioms:

<rdf:RDF

     xmlns:pref-v1="http://glossa.uni-graz.at/o:stgd.ontology#"

     xmlns:core="http://purl.org/vocab/frbr/core#"

     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

     xmlns:terms="http://purl.org/dc/terms/"

     xmlns:owl="http://www.w3.org/2002/07/owl#"

     xmlns:xml="http://www.w3.org/XML/1998/namespace"

     xmlns:xsd="http://www.w3.org/2001/XMLSchema#"

     xmlns:skos="http://www.w3.org/2004/02/skos/core#"

     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">

[Quick note: I deleted the base-uri and the default namespace because the ontology has now to be integrated in a triple store and all vocabularies should appear with namespace-prefixes.]

As you can see, my project prefix and the frbr prefix changed. The latter changes automatically to „core”. The former, the prefix I chose form my ontology, changed to a prefix I set in the very beginning, when setting up the ontology. Now I found a shorter and more expressive prefix and I would like to replace the prefix pref-v1 with pref-v2. This also works in the non-exported version of the ontology. However, as soon as I export the ontology, the new prefix is replaced by the old one.

Can anyone help? Am I missing something?

Cheers,

Frederike

 


_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: Prefix replaced when exporting ontology

Ghislain ATEMEZING
Hi Frederike,
Since you have the ontology file, you can change the prefixes directly and then import the onto again into Protégé.
So, open it with any text editor, makes the changes in the ontology and save it.
Then reload it in Protégé.

HTH
Best,
Ghislain

Le dim. 18 nov. 2018 à 14:25, Frederike Neuber <[hidden email]> a écrit :

Dear list,

while working with Protégé, I faced a problem concerning prefixes of namespaces that change when I export my ontology with inferred axioms. The prefixes that change are my project specific prefix (let’s call it „pref-v2“ for ‚version 2‘) and the frbr-prefix. I hope I can make the issue clearer with the example that follows.

Before exporting the ontology, the namespace declarations in the xml/rdf file look like this:

<rdf:RDF xmlns="http://myontology.de/example#"

     xml:base="http://myontology.de/example"

     xmlns:pref-v2="http://myontology.de/example#"

     xmlns:frbr="http://purl.org/vocab/frbr/core#"

     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

     xmlns:owl="http://www.w3.org/2002/07/owl#"

     xmlns:xml="http://www.w3.org/XML/1998/namespace"

     xmlns:xsd="http://www.w3.org/2001/XMLSchema#"

     xmlns:skos="http://www.w3.org/2004/02/skos/core#"

     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"

     xmlns:dc="http://purl.org/dc/terms/">

In the Protégé GUI, the prefixes are like above also displayed in the Active Ontology > Ontology Prefixes tab.

Now, here are the prefixes after the export with inferred axioms:

<rdf:RDF

     xmlns:pref-v1="http://glossa.uni-graz.at/o:stgd.ontology#"

     xmlns:core="http://purl.org/vocab/frbr/core#"

     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

     xmlns:terms="http://purl.org/dc/terms/"

     xmlns:owl="http://www.w3.org/2002/07/owl#"

     xmlns:xml="http://www.w3.org/XML/1998/namespace"

     xmlns:xsd="http://www.w3.org/2001/XMLSchema#"

     xmlns:skos="http://www.w3.org/2004/02/skos/core#"

     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">

[Quick note: I deleted the base-uri and the default namespace because the ontology has now to be integrated in a triple store and all vocabularies should appear with namespace-prefixes.]

As you can see, my project prefix and the frbr prefix changed. The latter changes automatically to „core”. The former, the prefix I chose form my ontology, changed to a prefix I set in the very beginning, when setting up the ontology. Now I found a shorter and more expressive prefix and I would like to replace the prefix pref-v1 with pref-v2. This also works in the non-exported version of the ontology. However, as soon as I export the ontology, the new prefix is replaced by the old one.

Can anyone help? Am I missing something?

Cheers,

Frederike

 

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user


--

"Love all, trust a few, do wrong to none" (W. Shakespeare)

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user