How Owl Imports Work

From Protege Wiki
Revision as of 17:04, April 27, 2008 by Tredmond (talk | contribs) (Names of Ontologies)

Jump to: navigation, search

OWL Imports

First it must be understood that the semantics of imports in OWL is a subject of some controversy. In the OWL 1.1 specification there is effort in progress to clear up some of this confusion. Until this is settled we will use the definition of the semantics of imports given in the semantics document of the w3.org specs:

Aside from this local meaning, an owl:imports annotation also imports the contents of another OWL ontology into the current ontology. The imported ontology is the one, if any, that has as name the argument of the imports construct. (This treatment of imports is divorced from Web issues. The intended use of names for OWL ontologies is to make the name be the location of the ontology on the Web, but this is outside of this formal treatment.)

In this note we will describe what this innocent little paragraph is saying and what it means to Protege.

Names of Ontologies

All owl ontologies have a name. The w3.org document describing this naming process can be found at this link. Unfortunately the way that this name is calculated (at least for the RDF/XML OWL syntax) is not well specified. Even so - in most cases it can be calculated in an unambiguous way. In most RDF/XML ontologies there is a single RDF resource that is declared to be of type owl:Ontology. So for instance in the pizza owl ontology, the declaration in question is the following:

 <owl:Ontology rdf:about="">
   <protege:defaultLanguage rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
   >en</protege:defaultLanguage>
   <owl:versionInfo rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
   >version 1.3</owl:versionInfo>
   <rdfs:comment xml:lang="en">An example ontology that contains all constructs required for the various versions of the Pizza Tutorial run by Manchester University (see http://www.co-ode.org/resources/tutorials/)</rdfs:comment>
   <owl:imports rdf:resource="http://protege.stanford.edu/plugins/owl/protege"/>
 </owl:Ontology>

The first line of this declaration defines an RDF resource of type owl:Ontology. The name of this resource is given by the rdf:about statement. In this case the rdf:about string is empty which means that the xml base is used. The xml:base declaration can be found near the top of the pizza ontology in the namespace declarations:

<rdf:RDF
   xmlns:protege="http://protege.stanford.edu/plugins/owl/protege#"
   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#"
   xmlns="http://www.co-ode.org/ontologies/pizza/2005/10/18/pizza.owl#"
   xmlns:daml="http://www.daml.org/2001/03/daml+oil#"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
 xml:base="http://www.co-ode.org/ontologies/pizza/2005/10/18/pizza.owl">

No other declarations of an owl:Ontology resource occur in the pizza ontology so the name of this resource (e.g. http://www.co-ode.org/ontologies/pizza/2005/10/18/pizza.owl) is the name of the pizza ontology. It is relevant to this discussion that the name of the pizza ontology is working URL and clicking on the link pulls up the pizza ontology. In summary:

  • the pizza ontology contains exactly one owl:Ontology declaration,
  • this declaration is named by rdf:about="",
  • the xm:base is declared and
  • the xml:base is a working URL that points to the pizza ontology.

This situation is the simplest case and in this case things tend to work very smoothly.

However none of the assumptions above are guaranteed to hold. Sometimes there are no owl:Ontology declarations in the owl ontology. In this case the xml:base is used as the ontology name if it is present. Otherwise the name of the ontology is given by the url that was used to fetch the ontology. If this is still ambiguous, I am not sure what happens. In addition sometimes the rdf:about statement does not use the empty string. This allows one to give the ontology a name other than the xml:base. Finally the name of the ontology may only be a URI and may not resolve to the right ontology as a URL. Each of these cases adds some difficulty to ontology developers and to some degree motivate the writing of this document.

Import By Name

What Can Go Wrong

Ontology Not Found

Ontology Found Has The Wrong Name