ontology_loader
Project description
ontology_loader
Suite of tools to configure and load an ontology from the OboFoundary into the data object for OntologyClass as specified by NMDC schema.
Development Environment
Pre-requisites
-
=Python 3.9
- Poetry
- Docker
- MongoDB
- NMDC materialized schema
- ENV variable for MONGO_PASSWORD (or pass it in via the cli/runner itself directly)
% docker pull mongo
% docker run -d --name mongodb-container -p 27018:27017 mongo
Basic mongosh commands
% docker ps
% docker exec -it [mongodb-container-id] bash
% mongosh
% show dbs
% use test
% db.ontology_class_set.find().pretty()
% db.ontology_relation_set.find().pretty()
Command line
% poetry install
% poetry run ontology_loader --help
% poetry run ontology_loader --source-ontology "envo"
% poetry run ontology_loader --source-ontology "go"
Running the tests
% make test
Running the linter
% make lint
python example usage
pip install nmdc-ontology-loader
from nmdc_ontology_loader.ontology_loader import OntologyLoader
import tempfile
def test_load_ontology():
"""Test the load_ontology method."""
ontology_loader = OntologyLoader(
source_ontology="envo",
output_directory=tempfile.gettempdir(),
generate_reports=True,
)
ontology_loader.load_ontology()
assert ontology_loader.ontology_class_set
assert ontology_loader.ontology_relation_set
assert ontology_loader.ontology_class_set.count() > 0
assert ontology_loader.ontology_relation_set.count() > 0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ontology_loader-0.1.4rc4.tar.gz.
File metadata
- Download URL: ontology_loader-0.1.4rc4.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07ac98b25f0bf39025b6c2bcf5694836933f13ccddb73a9ab116f654e0ef5365
|
|
| MD5 |
78ddddfe51e2c14eb0c06dd5f5c9311a
|
|
| BLAKE2b-256 |
a3d2d1c70f143375160a5301eedc3e062b464f4b42e5c70ac8909b302ce379bd
|
File details
Details for the file ontology_loader-0.1.4rc4-py3-none-any.whl.
File metadata
- Download URL: ontology_loader-0.1.4rc4-py3-none-any.whl
- Upload date:
- Size: 9.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b40c566efbf98b2fd0d9e7fce0f5551b9fdcf5a574bbb4f217f9fbd5edbc60d
|
|
| MD5 |
a9dcc3b1f0568c1b7af349dff5278d3d
|
|
| BLAKE2b-256 |
8a899f87c7eab30bba21ba1ac8c0ecdfe936aebf9c6cabe7e7e1b27e1eb6bc1a
|