rdfowlsemantic-webrdfs

OWL2 Ontology creates a "ghost" RDFS ontology due to missing `#`


Let's query the code of OWL2 Ontology.

$ http --follow get http://www.w3.org/2002/07/owl# | grep -B30 'rdf-schema>'

@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

<http://www.w3.org/2002/07/owl> a owl:Ontology ;
     dc:title "The OWL 2 Schema vocabulary (OWL 2)" ;
     rdfs:comment """
  This ontology partially describes the built-in classes and
  properties that together form the basis of the RDF/XML syntax of OWL 2.
  The content of this ontology is based on Tables 6.1 and 6.2
  in Section 6.4 of the OWL 2 RDF-Based Semantics specification,
  available at http://www.w3.org/TR/owl2-rdf-based-semantics/.
  Please note that those tables do not include the different annotations
  (labels, comments and rdfs:isDefinedBy links) used in this file.
  Also note that the descriptions provided in this ontology do not
  provide a complete and correct formal description of either the syntax
  or the semantics of the introduced terms (please see the OWL 2
  recommendations for the complete and normative specifications).
  Furthermore, the information provided by this ontology may be
  misleading if not used with care. This ontology SHOULD NOT be imported
  into OWL ontologies. Importing this file into an OWL 2 DL ontology
  will cause it to become an OWL 2 Full ontology and may have other,
  unexpected, consequences.
   """ ;
     rdfs:isDefinedBy
          <http://www.w3.org/TR/owl2-mapping-to-rdf/>,
          <http://www.w3.org/TR/owl2-rdf-based-semantics/>,
          <http://www.w3.org/TR/owl2-syntax/> ;
     rdfs:seeAlso   <http://www.w3.org/TR/owl2-rdf-based-semantics/#table-axiomatic-classes>,
                    <http://www.w3.org/TR/owl2-rdf-based-semantics/#table-axiomatic-properties> ;
     owl:imports <http://www.w3.org/2000/01/rdf-schema> ;

Here, you can see that OWL ontology imports RDF Schema ontology. The canonical URL for RDF Schema is this one, as specified in prefix:

@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .

but import works like this:

owl:imports <http://www.w3.org/2000/01/rdf-schema> ;

This little discrepancy should have no effect on the import itself because the # does not make difference when fetching a web resource. However, it has other important consequences.

$ http --follow get http://www.w3.org/2002/07/owl# | grep -A5 'owl:imports a'

owl:imports a owl:OntologyProperty ;
     rdfs:label "imports" ;
     rdfs:comment "The property that is used for importing other ontologies into a given ontology." ;
     rdfs:domain owl:Ontology ;
     rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
     rdfs:range owl:Ontology . 

The rdfs:range is important. It means that every value of owl:imports property will be considered an owl:Ontology. Which means that we have the following triple inferred:

<http://www.w3.org/2000/01/rdf-schema> a owl:Ontology

This has unwanted consequences. In particular,

$ http --follow http://www.w3.org/2000/01/rdf-schema# | grep Ontology

<http://www.w3.org/2000/01/rdf-schema#> a owl:Ontology ;

Thus, when we list all ontologies in the graph which includes both RDFS and OWL, we have duplicates.

In addition, if a user wants to look at http://www.w3.org/2000/01/rdf-schema "kind of ontology" they will see no terms in it.

I think this is a bug in OWL code.


Solution

  • Your assessment is correct. There are a few points to be made more precise: