python utilities for working with ontologies
pyontutils
is slowly approaching stability. You can obtain it and other related
packages from pypi and install them as you see fit (e.g. pip install --user pyontutils
).
If you need a bleeding edge version I reccomend installing it into your environment
(virtual or otherwise) using pip install --user --editable .[dev,test]
run from
from your local copy of this repo.
pyontutils
makes use of 3 configuration files:
auth-stores: secrets: path:
entry in config.yaml.
The file mode needs to be set to 0600
so that only you can read and write it.
It is also advisable to place it inside a folder with a mode set to 0700
since
some editors do not preserve file modes. orthauth
will fail loudly if this happens.pyontutils
git repository is not found. pyontutils
will retrieve the
latest version of this file from github on first run if it cannot find a local copy.
The full list of locations that are searched for curie_map.yaml
are specified in
auth-config.py. If you are going to use the SciCrunch SciGraph production instance follow the
instructions
in the sparc curation setup guide to obtain an API key and put it in the right place.
In short you can set the key in your secrets file and specify the path to it in
config.yaml under the =scigraph-api-key= variable.
Alternately you can set the key using the SCICRUNCH_API_KEY
environment variable
(e.g., by running export SCICRUNCH_API_KEY=$(cat path/to/my/apikey)
) or by whatever
means you prefer for managing your keys.
From the directory that contains this readme run the following. Refer to .travis.yml for full details.
for f in {librdflib,htmlfn,ttlser,.,neurondm,nifstd}; do pushd $f; pip install --user --pre --editable . ; popd; done
If you need even more information there is fairly exhaustive doccumentation located in the sparc curation setup doc.
This repo requires PyPy3 or >=Python3.6.
See and setup.py and Pipfile for additional requirements.
ontload
requires Java8 and >=maven3.3 in order to build SciGraph.
parcellation requires FSL
to be installed or you need to obtain the atlases in
some other way. In order to build the packages required by this repo you will need
gcc (and toolchain) installed and will need to have the development packages for
libxml
installed. To build the development dependencies you will also need the
development packages for postgresql
, and protobuf
installed on your system.
Building the documentation for the ontology requires pandoc
and emacs
along
with orgstrap. See .travis.yml
for an example of how to bootstrap a working dev environment. Alternately see
pyontutils-9999.ebuild and
nifstd-tools-9999.ebuild in tgbugs-overlay.
pyontutils provides a set of scripts that are useful for maintaining and managing ontologies
using git, and making them available via SciGraph. Note that if you choose the development
installation option you will need to ln -sT
the scripts to your preferred bin folder.
For the full list please see the documentation.
Many of these scripts are written for working on the NIF standard ontology found here.
scigraph_codegen.py is code geneator for creating a python client library against a SciGraph REST endpoint. scigraph_client.py is the client library generated against the nif development scigraph instance. ontload can be used to load your ontology into SciGraph for local use.
See release.org.