Discussion:
[protege-user] Prefix replaced when exporting ontology
Frederike Neuber
2018-11-18 13:25:07 UTC
Permalink
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
Ghislain ATEMEZING
2018-11-20 11:27:58 UTC
Permalink
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
Post by 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
<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.
<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
https://mailman.stanford.edu/mailman/listinfo/protege-user
--
"*Love all, trust a few, do wrong to none*" (W. Shakespeare)
Web: http://atemezing.org
Loading...