W3C home > Mailing lists > Public > public-owl-wg@w3.org > May 2008

Multiple ontologies in a single file: RDF vs. the rest

From: Rinke Hoekstra <hoekstra@uva.nl>
Date: Wed, 7 May 2008 12:44:29 +0200
Message-Id: <BA1AC2E3-60BD-4BEF-B7AD-E689E0F49AC1@uva.nl>
To: OWL Working Group WG <public-owl-wg@w3.org>

Hi,

The imports/versioning proposal of Peter, and Boris' suggested changes  
to the syntax document to resolve ISSUE-21 and ISSUE-24 got me  
thinking about a problem that we might need to fix...

If imports is by location (i.e. an import statement points to some owl  
*file* at some location), we need to specify a way to deal with files  
that contain multiple ontologies. The reason is that both the XML  
schema and the RDF/XML (or N3, or turtle or...) serialisation (of the  
RDF graph) do not provide ways to prevent this from happening. The  
functional style syntax does *not* support multiple ontologies in a  
single file. This hints at a round-tripping problem for the  
translation from these formats to FS and back.

The XML syntax spec. explicitly prescribes an ox:Ontology element as  
root element for OWL/XML files, but the XML schema itself cannot  
enforce this. Nonetheless, an OWL/XML file that contains multiple  
ox:Ontology elements can be deemed invalid (although tools may provide  
custom means to disentangle the ontologies). No real problem here.

For RDF/XML this is not as simple, as we only provide a mapping from  
FS to RDF graphs: bags of triples. These triples may be stored  
anywhere, in some DB or a file. A (partial) RDF serialisation of that  
store may or may not contain multiple ontologies, or may even contain  
no ontology element at all. However, for imports to work (obviously),  
the file does need to contain at least an RDF description of type  
owl:Ontology.

Possible solution: add this as a requirement to the RDF mapping, i.e.  
say something like ''Any RDF serialisation of the RDF graph resulting  
from this mapping should contain the owl:Ontology triple produced by  
the mapping''.

For ontologies stored in a triple store, the custom mechanism as  
described by Peter may be used to resolve the import URI to an  
ontology in the store. However, the RDF representation of ontologies  
provides no means to retrieve the relevant triples (i.e. class axioms  
etc.) given the triple representing the ontology itself. Once the  
ontology is in RDF the 'ontology' and its axioms, entities and  
annotations are disconnected. But an RDF serialisation of an ontology  
needs to have some means to select the proper triples. (and  
consequently the mapping to FS should take this possibility into  
account as well)

(I am tempted to drop the words 'named graph' in this context. Oops,  
just did.)

A solution would be to add a statement along the lines of ''A valid  
RDF serialisation of an RDF graph representing some ontology should  
contain exactly that ontology'' (i.e. exactly those triples resulting  
from the mapping of that ontology from the functional syntax to RDF)

This is relevant because we are about to adopt imports by location,  
that is files stored in a sanctioned syntax (Question: are RDF/ 
XML,N3,Turtle etc. sanctioned syntaxes?) and need to make sure that  
each file contains exactly one ontology, and only those axioms/ 
elements/annotations belonging to that ontology.

-Rinke

-----------------------------------------------
Drs. Rinke Hoekstra

Email: hoekstra@uva.nl    Skype:  rinkehoekstra
Phone: +31-20-5253499     Fax:   +31-20-5253495
Web:   http://www.leibnizcenter.org/users/rinke

Leibniz Center for Law,          Faculty of Law
University of Amsterdam,            PO Box 1030
1000 BA  Amsterdam,             The Netherlands
-----------------------------------------------
Received on Wednesday, 7 May 2008 10:45:08 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 7 May 2008 10:45:09 GMT