-
Notifications
You must be signed in to change notification settings - Fork 34
Import Chain Mirroring
OWL import chains are a useful way of modularizing and connecting ontologies in a distributed fashion. Some import chains can be quite complex - see for example [http://wiki.geneontology.org/index.php/Ontology_extensions]. Sometimes these chains can be cumbersome if you have to frequently load an import chain from remote URLs, or if you are offline.
You can work on a local repository using two mechanisms
- XML catalogs
- Import Chain Slurping
owltools has support for XML catalogs. These are generated automatically by Protege (look for the file catalog-v001.xml), and can easily be generated or edited.
To use an XML catalog, specify the location of the catalog prior to loading any ontologies
cd go/ontology/extensions
owltools --catalog-xml catalog-v001.xml x-chemical-importer.owl
This presumes the catalog has been made in advance (which it has, for the GO extensions directory)
You can also use "--use-catalog" with o argument, which assumes the standard XML catalog fileame.
The --catalog-xml argument can also be used on the Oort command line (in the GUI you can specify the catalog)
First create a directory that you will use as your local repository. You can make as many of these as you like, but it can be advantageous to have a single one:
mkdir ~/mirror/
Now let's say I want to make a mirror of PKB, which imports much of the NIFSTD import chain:
owltools http://ccdb.ucsd.edu/PKB/1.0/PKB_classes.owl --slurp-import-closure -d ~/mirror -c ./catalog-v001.xml
This creates a catalog-v001.xml file in your local directory. Note that the catalog will use absolute paths on the file system, so it can live anywhere (in future we can make it possible to specify relative paths, which can be useful for sharing catalogs).
Now, the next time you want to load PKB, you can do it offline. Assuming you are in the same directory as the catalog
owltools --use-catalog http://ccdb.ucsd.edu/PKB/1.0/PKB_classes.owl
Note there is no facility for auto-updating, handling versions, anything fancy like that. You are responsible for refreshing the contents of the mirror directory yourself.
The process is fairly dependent on people being well-behaved and naming their ontologies the same as their their URLs