OWL Ontology Splitter

sswap.info
Simple Semantic Web Architecture and Protocol

OWL Ontology Splitter

This tool splits an OWL ontology, written using Protege, into multiple files. The tool requires that the OWL file that comprises the ontology conform to the guidelines outlined below. The file is split into the following files that conform to the SSWAP protocol, and packaged into a single zip archive:
  • A file for each OWL Class, ObjectProperty, DatatypeProperty, or AnnotationProperty that is in the namespace associated with a user-supplied namespace prefix. For example, the prefix map represents the namespace http://sswapmeet.sswap.info/map/ in the map.owl file, so splitting that file would yield files for the classes map:MapSet, map:MapPosition, etc. Note that files for individuals (as opposed to classes) are currently not written.
  • A file named owlOntology, which contains annotation information from the Ontology object in the Protege file.
  • A file named owlImports, which contains an Ontology object that imports all the files that were split.
  • A directory named owldoc/, which contains OWL documentation for the terms split from the owl file.
  • A copy of the file being split.
File:  
Prefix:  
 

Ontology Authoring Guidelines

A SSWAP ontology is normally written by using the free Protege ontology editor and splitting the resulting OWL file using the tool on this page. After splitting the file, the unmodified file itself is hosted along with the files generated by the splitter (a copy of the file is included in the zip file). This enables others to reference your ontology from within Protege by importing your OWL file at its URL. To get Protege to build a file suitable for use by the ontology splitter tool, the following guidelines should be observed in using Protege - the examples below all use the ontology referred to in map.owl:
  • The default namespace (i.e. the value of the "Ontology URI" field on Protege's Metadata tab) of the ontology should be the URL at which the unsplit OWL file is to reside. Note that even though the RDF/XML will appear in the OWL file as <owl:Ontology rdf:about=""/>, this default namespace will be displayed in Protege as the absolute URL of the OWL file, and this absolute URL is what you should enter in this field. In the example of the map.owl ontology file, this URL is http://sswapmeet.sswap.info/map/map.owl.
  • Ironically, the default namespace discussed above should not be used in defining ontology terms. Instead, you should define a named namespace that refers to the parent path of the OWL file (make sure to include the trailing slash character) and create ontology terms in that namespace. In the example of the map.owl ontology file, this namespace is referenced using the map prefix, which refers to the URL http://sswapmeet.sswap.info/map/. It is good practice to give your namespace prefixes names that you expect to be unique - for example, a Gramene-specific map ontology could be given the prefix grameneMap. Keeping namespaces unique enables Protege to honor your prefix names when it imports files; when prefix names clash, it arbitrarily creates new, less intuitive prefixes.
  • In summary, the Protege OWL file will have lines similar to the following:

      <!-- note trailing / on directory for prefix -->
      xmlns:map="http://sswapmeet.sswap.info/map/"

      <!-- note trailing # on .owl file for default namespace -->
      xmlns="http://sswapmeet.sswap.info/map/map.owl#"

      <!-- note .owl file as base; no trailing # -->
      xml:base="http://sswapmeet.sswap.info/map/map.owl"
As a hands-on example, you can save map.owl to your desktop and open it in Protege (in the "Welcome to Protege" dialog that appears when you first open Protege, click the "Open Other..." button to select map.owl; or, if Protege is already started, select the File -> Open menu item and click the "File" button to select map.owl from the resulting dialog). Note that this file has a namespace prefix map that refers to the namespace http://sswapmeet.sswap.info/map/. In Protege, you can view the contents of this file by selecting "View RDF/XML source code..." from the Code menu.

After viewing map.owl in Protege, split it by choosing the path to the file in the File: field above, entering map in the prefix field, and pressing the "Split File" button. Save the resulting map.zip file to your desktop and unzip it to view its contents.


Home     Protocol     Ontologies     About VPIN
Forum     Publish Resources     Developers' Page     Contact Us

NCGR
CSHL
JCVI
NSF


SSWAP 8.09  •  26 Sep 2008