Skip to main content

A Python library and set of command line utilities for exchanging Knowledge Graphs (KGs) that conform to or are aligned to the Biolink Model.

Project description

Knowledge Graph Exchange

Python Run testsDocumentation Status Quality Gate Status Maintainability Rating Coverage PyPI Docker

KGX (Knowledge Graph Exchange) is a Python library and set of command line utilities for exchanging Knowledge Graphs (KGs) that conform to or are aligned to the Biolink Model.

The core datamodel is a Property Graph (PG), represented internally in Python using a networkx MultiDiGraph model.

KGX allows conversion to and from:

KGX will also provide validation, to ensure the KGs are conformant to the Biolink Model: making sure nodes are categorized using Biolink classes, edges are labeled using valid Biolink relationship types, and valid properties are used.

Internal representation is a property graph, specifically a networkx MultiDiGraph.

The structure of this graph is expected to conform to the Biolink Model standard, as specified in the KGX format specification.

In addition to the main code-base, KGX also provides a series of command line operations.

Installation

The installation for KGX requires Python 3.7 or greater.

Installation for users

Installing from PyPI

KGX is available on PyPI and can be installed using pip as follows,

pip install kgx

To install a particular version of KGX, be sure to specify the version number,

pip install kgx==0.5.0

Installing from GitHub

Clone the GitHub repository and then install,

git clone https://github.com/biolink/kgx
cd kgx
python setup.py install

Installation for developers

Setting up a development environment

To build directly from source, first clone the GitHub repository,

git clone https://github.com/biolink/kgx
cd kgx

Then install the necessary dependencies listed in requirements.txt,

pip3 install -r requirements.txt

For convenience, make use of the venv module in Python3 to create a lightweight virtual environment,

python3 -m venv env
source env/bin/activate

pip install -r requirements.txt

To install KGX you can do one of the following,

pip install .

# OR 

python setup.py install

Setting up a testing environment

KGX has a suite of tests that rely on Docker containers to run Neo4j specific tests.

To set up the required containers, first install Docker on your local machine.

Once Docker is up and running, run the following commands:

docker run -d --name kgx-neo4j-integration-test \
            -p 7474:7474 -p 7687:7687 \
            --env NEO4J_AUTH=neo4j/test  \
            neo4j:3.5.25
docker run -d --name kgx-neo4j-unit-test  \
            -p 8484:7474 -p 8888:7687 \
            --env NEO4J_AUTH=neo4j/test \
            neo4j:3.5.25

Note: Setting up the Neo4j container is optional. If there is no container set up then the tests that rely on them are skipped.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kgx-1.5.1.tar.gz (88.8 kB view details)

Uploaded Source

Built Distributions

kgx-1.5.1-py3.7.egg (109.5 kB view details)

Uploaded Source

kgx-1.5.1-py3-none-any.whl (112.4 kB view details)

Uploaded Python 3

File details

Details for the file kgx-1.5.1.tar.gz.

File metadata

  • Download URL: kgx-1.5.1.tar.gz
  • Upload date:
  • Size: 88.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.7.4

File hashes

Hashes for kgx-1.5.1.tar.gz
Algorithm Hash digest
SHA256 1ad18b6bd86e323c03632372268c47224c69da2eccfd770bae556a1dc0f77d29
MD5 8c3d912cb0149e944a9273e600f934ed
BLAKE2b-256 09f6b20c9ac5a9eb6366fca64bd55a2f7491e4edbf7ba377fa4eee0f473f3dc8

See more details on using hashes here.

Provenance

File details

Details for the file kgx-1.5.1-py3.7.egg.

File metadata

  • Download URL: kgx-1.5.1-py3.7.egg
  • Upload date:
  • Size: 109.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.7.4

File hashes

Hashes for kgx-1.5.1-py3.7.egg
Algorithm Hash digest
SHA256 394206592586d5d37e4877a2fa7cb408ae6adb1d87d2a6151886157cc0ee609b
MD5 052d9056a06d12b409c5065297e5c72d
BLAKE2b-256 240aa5965b82d534110da63cac51b49076524bd2068dd753671b1952a271921b

See more details on using hashes here.

Provenance

File details

Details for the file kgx-1.5.1-py3-none-any.whl.

File metadata

  • Download URL: kgx-1.5.1-py3-none-any.whl
  • Upload date:
  • Size: 112.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.7.4

File hashes

Hashes for kgx-1.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 59dcfaa616e80ca20d81e5681c8cef8b30bc9f46ac41ba9b5aa9feb1acc86a72
MD5 d940268cf3160e2711e61ee93a1a26af
BLAKE2b-256 b4944c6c232f7bc6cc372ed68158454f214dd89c98b685f5c65c631f42daff8b

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page