Search Mailing List Archives

Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[protege-owl] Namespaces of imports are not stored in importing OWL file using the API

Tania Tudorache tudorache at
Wed Mar 25 18:24:10 PDT 2009

It's a feature :)

There is no recommendation of how to handle namespaces and prefixes in 
OWL; so each tool does what it considers best.

The fact that the prefixes in the importing ontology are not changed at 
save time was a desired feature by several of our users. At load time, 
Protege will look into all the prefixes of imports and it will aggregate 
them  by going from the top most ontology to the imports. The "most" 
importing prefix will win if there is somewhere lower in the import 
hierarchy another prefix defined  for the same namespace. But this is 
just a runtime convenience, and unless the user specifically say that he 
wants this prefix in the importing ontology, Protege will not modify the 
exiting prefixes (We did a lot of work to insure that :) )

So, in your import code, if you would like to preserve an imported 
prefix, you can state it in the importing ontology. Something like: 
"http://www.test.test/ImportedOntology.owl#" ). You can do this either 
before or after the import.


Simon Paradies wrote:
> Dear Protégé Community,
> When importing an ontology using the API, e.g.
> ImportHelper importHelper = new ImportHelper(importingOntology);
> importHelper.addImport(importedOntologyURI);
> try {
>   importHelper.importOntologies(false);
> }
> the NamespaceManager afterwards is aware of the prefix of the imported ontology 
> (i.e. the default prefix set in the imported ontology; let's assume 
> "importedPrefix").
> However, if the importing ontology is saved afterwards this prefix is not 
> persisted in the importing ontology's OWL file.
> I.e. in the importingOntology.owl file, instead of getting
> ...
> xmlns:importedPrefix="http://www.test.test/ImportedOntology.owl#"
> ...
> I get
> ...
> xmlns:j.0="http://www.test.test/ImportedOntology.owl#"
> ...
> Is this a bug or a "feature"?
> Cheers
> Simon
> P.S.: I presume this is also valid using the GUI.
> _______________________________________________
> protege-owl mailing list
> protege-owl at
> Instructions for unsubscribing: 

More information about the protege-owl mailing list