Skip to main content

pyontutils

PyPI version Build Status Coverage Status

python utilities for working with ontologies

Installation

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.

Configuration

pyontutils makes use of 3 configuration files:

  1. ~/.config/pyontutils/config.yaml. This file can be used to augment the varibles defined in auth-config.py. For more details about the config see the orthauth guide.
  2. secrets.yaml that you can put wherever you want by editing the 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.
  3. ./nifstd/scigraph/curie_map.yaml or ~/.config/pyontutils/curie_map.yaml if a 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.

Development Installation

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.

Requirements

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.

Utility Scripts

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.

  1. ttlfmt Reserialize ontology files using deterministic turtle (spec).
  2. ontutils Various useful and frequently needed commands for ontology processes as well as less frequent refactorings.
  3. ontload Load an ontology managed by git into SciGraph for easy deployment of services.
  4. qnamefix Set qnames based on the curies defined for a given ontology.
  5. necromancy Find dead ids in an ontology and raise them to be owl:Classes again.
  6. scigraph-codegen Generate a rest client against a SciGraph services endpoint.
  7. scig Run queries against a SciGraph endpoint from the command line.
  8. graphml_to_ttl Convert yEd graphml files to ttl.
  9. ontree Run a webserver to query and view hierarchies from the ontology.

NIF-Ontology

Many of these scripts are written for working on the NIF standard ontology found here.

SciGraph

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.

Building releases

See release.org.

Metadata

Release files for pyontutils 0.1.40

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyontutils 0.1.40
File Size Uploaded Provenance Actions
pyontutils-0.1.40.tar.gz 330.0 kB Without provenance Details for pyontutils-0.1.40.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyontutils 0.1.40
File Interpreter ABI Platform Actions
pyontutils-0.1.40-py2.py3-none-any.whl Python 2, Python 3 none any Details for pyontutils-0.1.40-py2.py3-none-any.whl

Total release size: 562.9 kB

Release files / pyontutils-0.1.40.tar.gz

Download URL pyontutils-0.1.40.tar.gz
Size 330.0 kB
Tags Source
SHA-256 checksum
How to use checksums
9b5f6ffb837d9dcc6cd2194aa318b47bdafe35ca545489f51500ff52e5b96de1
BLAKE2b-256 checksum
How to use checksums
0b09117d9af6ac47020577d035263d68b6b9ced07ffd9ae29895bf5b08b08ada
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / pyontutils-0.1.40-py2.py3-none-any.whl

Download URL pyontutils-0.1.40-py2.py3-none-any.whl
Size 232.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
ee64709e31875c257c9cd00075fbd3c243effcd7d73bace51dd48b8441854ded
BLAKE2b-256 checksum
How to use checksums
3d6b15486df4fd7de52a48e5cc372a93df3036b47225f9b61c4010375ac54eda
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for pyontutils 0.1.40

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.40 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page