Thursday, June 28, 2007

Ontologies do NOT import namespace prefix mappings

For quite a while I was lead to believe that namespace prefix mappings were imported into an ontology and were "known" and reusable by the importing ontology. While this is true for seemingly everything else: classes, properties, individuals, statements, it is not so for namespace prefix mappings.

Why? Well, namespace prefixes are an XML concept while the rest are ontology (RDF/OWL) concepts. TopBraid Composer also misdirected me a bit by reusing the same "shading means imported" paradigm used for classes and the like as it did for namespaces. For namespaces, shading does mean that they have come from an imported source, you just can't make use of them -they are presented for informative purposes only. If you do want to use a namespace from the import list, "Clone" it with the "Clone" button, this makes a local copy.

If you don't, TBC is smart enough to make some guesses to resolve unknown prefixes, but when it can't it uses a "j.#" (i.e. j.0, j.1, j.2 ...) as a place holder (really its Jena doing this).

Live and learn...