Skip to content

Getting Started


To install from PyPi:

python3 -m pip install kglab

If you work directly from this Git repo, be sure to install the dependencies:

python3 -m pip install -r requirements.txt

Alternatively, to install dependencies using conda:

conda env create -f environment.yml
conda activate kglab

Sample Usage

To use kglab in its simplest form:

import kglab

kg = kglab.KnowledgeGraph()
kg.load_rdf("", format="xml")

measure = kglab.Measure()

print("edges: {}\n".format(measure.get_edge_count()))
print("nodes: {}\n".format(measure.get_node_count()))

ttl = kg.save_rdf_text()

Hands-on Coding Tutorial

See the Tutorial notebooks for sample code and patterns to use when integrating kglab with other related libraries in Python.

Last update: 2021-03-24