Metadata-Version: 2.1
Name: kglab
Version: 0.6.2
Summary: A simple abstraction layer in Python for building knowledge graphs
Home-page: https://derwen.ai/docs/kgl/
Author: Paco Nathan
Author-email: Paco Nathan <info@derwen.ai>
License: MIT License
        
        Copyright (c) 2020-2022 Derwen, Inc.
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Home, https://derwen.ai/docs/kgl/
Project-URL: DOI, https://doi.org/10.5281/zenodo.6360664
Project-URL: Discussions, https://www.linkedin.com/groups/6725785/
Project-URL: DockerHub, https://hub.docker.com/r/derwenai/kglab
Project-URL: Tutorial, https://derwen.ai/docs/kgl/tutorial/
Project-URL: Issues, https://github.com/DerwenAI/kglab/issues
Project-URL: Source, https://github.com/DerwenAI/kglab
Keywords: controlled vocabulary,cugraph,deep learning,embedding,gpu,graph algorithms,igraph,inference,interactive visualization,json-ld,knowledge graph,managing namespaces,morph-kgc,n3,networkx,owl,pandas,parquet,probabilistic soft logic,psl,pyvis,rapids,rdf,rml,roam research,serialization,shacl,skos,sparql,statistical relational learning,topology,turtle,validation
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Scientific/Engineering :: Human Machine Interfaces
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Text Processing :: Indexing
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: aiohttp (>=3.8)
Requires-Dist: chocolate (>=0.0.2)
Requires-Dist: csvwlib (>=0.3.2)
Requires-Dist: cryptography (>=35.0)
Requires-Dist: decorator (>=5.1)
Requires-Dist: fsspec[gs,s3] (>=2022.2)
Requires-Dist: gcsfs (>=2022.2)
Requires-Dist: icecream (>=2.1)
Requires-Dist: morph-kgc (>=2.0.0)
Requires-Dist: networkx (>=2.7)
Requires-Dist: numpy (>=1.23.0)
Requires-Dist: owlrl (>=6.0.2)
Requires-Dist: oxrdflib (>=0.3.1)
Requires-Dist: pandas (>=1.4)
Requires-Dist: pslpython (>=2.2.2)
Requires-Dist: pyarrow (>=7.0)
Requires-Dist: pynvml (>=11.4)
Requires-Dist: pyshacl (>=0.18)
Requires-Dist: python-dateutil (>=2.8)
Requires-Dist: pyvis (>=0.1.9)
Requires-Dist: rdflib (>=6.1)
Requires-Dist: requests (>=2.27)
Requires-Dist: scikit-learn (==1.1.3)
Requires-Dist: scipy (>=1.8.0)
Requires-Dist: statsmodels (>=0.13)
Requires-Dist: tqdm (>=4.63)
Requires-Dist: urlpath (>=1.2)
Provides-Extra: base
Requires-Dist: aiohttp (>=3.8) ; extra == 'base'
Requires-Dist: chocolate (>=0.0.2) ; extra == 'base'
Requires-Dist: csvwlib (>=0.3.2) ; extra == 'base'
Requires-Dist: cryptography (>=35.0) ; extra == 'base'
Requires-Dist: decorator (>=5.1) ; extra == 'base'
Requires-Dist: fsspec[gs,s3] (>=2022.2) ; extra == 'base'
Requires-Dist: gcsfs (>=2022.2) ; extra == 'base'
Requires-Dist: icecream (>=2.1) ; extra == 'base'
Requires-Dist: morph-kgc (>=2.0.0) ; extra == 'base'
Requires-Dist: networkx (>=2.7) ; extra == 'base'
Requires-Dist: numpy (>=1.23.0) ; extra == 'base'
Requires-Dist: owlrl (>=6.0.2) ; extra == 'base'
Requires-Dist: oxrdflib (>=0.3.1) ; extra == 'base'
Requires-Dist: pandas (>=1.4) ; extra == 'base'
Requires-Dist: pslpython (>=2.2.2) ; extra == 'base'
Requires-Dist: pyarrow (>=7.0) ; extra == 'base'
Requires-Dist: pynvml (>=11.4) ; extra == 'base'
Requires-Dist: pyshacl (>=0.18) ; extra == 'base'
Requires-Dist: python-dateutil (>=2.8) ; extra == 'base'
Requires-Dist: pyvis (>=0.1.9) ; extra == 'base'
Requires-Dist: rdflib (>=6.1) ; extra == 'base'
Requires-Dist: requests (>=2.27) ; extra == 'base'
Requires-Dist: scikit-learn (==1.1.3) ; extra == 'base'
Requires-Dist: scipy (>=1.8.0) ; extra == 'base'
Requires-Dist: statsmodels (>=0.13) ; extra == 'base'
Requires-Dist: tqdm (>=4.63) ; extra == 'base'
Requires-Dist: urlpath (>=1.2) ; extra == 'base'
Provides-Extra: docs
Requires-Dist: bandit (>=1.7) ; extra == 'docs'
Requires-Dist: codespell (>=2.1) ; extra == 'docs'
Requires-Dist: coverage (>=6.3) ; extra == 'docs'
Requires-Dist: flask (>=2.0) ; extra == 'docs'
Requires-Dist: flit (>=3.8) ; extra == 'docs'
Requires-Dist: grayskull (>=1.1) ; extra == 'docs'
Requires-Dist: jupyterlab (>=3.3) ; extra == 'docs'
Requires-Dist: mistune (>=0.8) ; extra == 'docs'
Requires-Dist: mkdocs-git-revision-date-plugin (>=0.3) ; extra == 'docs'
Requires-Dist: mkdocs-material (>=8.2) ; extra == 'docs'
Requires-Dist: mknotebooks (>=0.7) ; extra == 'docs'
Requires-Dist: mypy (>=0.940) ; extra == 'docs'
Requires-Dist: nbconvert (>=6.4) ; extra == 'docs'
Requires-Dist: nbmake (>=1.3) ; extra == 'docs'
Requires-Dist: notebook (>=6.4) ; extra == 'docs'
Requires-Dist: pipdeptree (>=2.2) ; extra == 'docs'
Requires-Dist: pre-commit (>=2.17) ; extra == 'docs'
Requires-Dist: pygments (>=2.11) ; extra == 'docs'
Requires-Dist: pylint (>=2.12) ; extra == 'docs'
Requires-Dist: pymdown-extensions (>=9.2) ; extra == 'docs'
Requires-Dist: pytest (>=7.1) ; extra == 'docs'
Requires-Dist: responses (>=0.19) ; extra == 'docs'
Requires-Dist: scikit-learn (>=1.0) ; extra == 'docs'
Requires-Dist: selenium (>=4.1) ; extra == 'docs'
Requires-Dist: setuptools (>=65.5.1) ; extra == 'docs'
Requires-Dist: twine (>=3.8) ; extra == 'docs'
Requires-Dist: types-python-dateutil (>=2.8) ; extra == 'docs'
Requires-Dist: types-requests (>=2.27) ; extra == 'docs'
Requires-Dist: wheel (>=0.37) ; extra == 'docs'
Requires-Dist: xmltodict (>=0.12) ; extra == 'docs'
Provides-Extra: tutorial
Requires-Dist: cairocffi (>=1.3) ; extra == 'tutorial'
Requires-Dist: gensim (>=3.8) ; extra == 'tutorial'
Requires-Dist: igraph (>=0.9) ; extra == 'tutorial'
Requires-Dist: jupyterlab (>=3.1.4) ; extra == 'tutorial'
Requires-Dist: leidenalg (>=0.8) ; extra == 'tutorial'
Requires-Dist: matplotlib (>=3.3.4) ; extra == 'tutorial'
Requires-Dist: pylev (>=1.3) ; extra == 'tutorial'

# kglab

[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.6360664.svg)](https://doi.org/10.5281/zenodo.6360664)
![Licence](https://img.shields.io/github/license/DerwenAI/kglab)
![Repo size](https://img.shields.io/github/repo-size/DerwenAI/kglab)
![GitHub commit activity](https://img.shields.io/github/commit-activity/w/DerwenAI/kglab?style=plastic)
[![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)
[![security: bandit](https://img.shields.io/badge/security-bandit-yellow.svg)](https://github.com/PyCQA/bandit)
[![Language grade: Python](https://img.shields.io/lgtm/grade/python/g/DerwenAI/kglab.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/DerwenAI/kglab/context:python)
![CI](https://github.com/DerwenAI/kglab/workflows/CI/badge.svg)
[![Docker Pulls](https://img.shields.io/docker/pulls/derwenai/kglab.svg?maxAge=604800)](https://hub.docker.com/r/derwenai/kglab/)
![downloads](https://img.shields.io/pypi/dm/kglab)
![sponsor](https://img.shields.io/github/sponsors/ceteri)


Welcome to *Graph Data Science*:
<https://derwen.ai/docs/kgl/>

The **kglab** library provides a simple abstraction layer in Python 3.7+
for building knowledge graphs, leveraging Pandas, NetworkX, RAPIDS, RDFLib,
Morph-KGC, pythonPSL, and many more.

> **SPECIAL REQUEST:**  
> Which features would you like in an open source Python library for building knowledge graphs?  
> Please add your suggestions through this survey:  
> https://forms.gle/FMHgtmxHYWocprMn6  
> This will help us prioritize the **kglab** roadmap.


## Reviews

[@kaaloo](https://github.com/kaaloo): 
> "Feels like it's a Hugging Face for graphs! 🤯"


## Getting Started

See the ["Getting Started"](https://derwen.ai/docs/kgl/start/)
section of the online documentation.

We recommend installing from [PyPi](https://pypi.python.org/pypi/kglab):
```bash
python3 -m pip install kglab
```

If you work directly from this Git repo, be sure to install the 
dependencies:
```bash
python3 -m pip install -U pip wheel
python3 -m pip install -r requirements.txt
```

Alternatively, to install dependencies using `conda`:
```bash
conda env create -f environment.yml --force
conda activate kglab
```

Then to run some simple uses of this library:
```python
import kglab

# create a KnowledgeGraph object
kg = kglab.KnowledgeGraph()

# load RDF from a URL
kg.load_rdf("http://bigasterisk.com/foaf.rdf", format="xml")

# measure the graph
measure = kglab.Measure()
measure.measure_graph(kg)

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

# serialize as a string in "Turtle" TTL format
ttl = kg.save_rdf_text()
print(ttl)
```

See the **tutorial notebooks** in the `examples` subdirectory for
sample code and patterns to use in integrating **kglab** with other
graph libraries in Python:
<https://derwen.ai/docs/kgl/tutorial/>


> **WARNING when installing in an existing environment:**  
> Installing a new package in an existing environment may reveal  
> or create version conflicts. See the **kglab** requirements  
> in `requirements.txt` before you do. For example, there are  
> [known version conflicts](https://github.com/DerwenAI/kglab/issues/160) regarding NumPy (>= 1.19.4) and [TensorFlow 2+](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/pip_package/setup.py) (~-1.19.2)


<details>
  <summary>Using Docker</summary>

For a simple approach to running the tutorials, see use of _docker compose_:
<https://derwen.ai/docs/kgl/tutorial/#use-docker-compose>

Also, container images for each release are available on DockerHub:
<https://hub.docker.com/repository/docker/derwenai/kglab>

To build a container image and run it for the tutorials:
```bash
docker build --pull --rm -f "docker/Dockerfile" -t kglab:latest .
docker run -p 8888:8888 -it kglab
```

To build and run a container image for testing:
```bash
docker build --pull --rm -f "docker/testsuite.Dockerfile" -t kglabtest:latest .
docker run --rm -it kglabtest
```
</details>


<details>
  <summary>Build Instructions</summary>

<strong>
Note: unless you are contributing code and updates,
in most use cases won't need to build this package locally.
</strong>

Instead, simply install from
[PyPi](https://pypi.python.org/pypi/kglab)
or use [Conda](https://docs.conda.io/).

To set up the build environment locally, see the 
["Build Instructions"](https://derwen.ai/docs/kgl/build/)
section of the online documentation.
</details>


<details>
  <summary>Semantic Versioning</summary>

Before <strong>kglab</strong> reaches release <code>v1.0.0</code> the 
types and classes may undergo substantial changes and the project is 
not guaranteed to have a consistent API.

Even so, we'll try to minimize breaking changes.
We'll also be sure to provide careful notes.

See:
[changelog.txt](https://github.com/DerwenAI/kglab/blob/main/changelog.txt)
</details>


<details>
  <summary>Contributing Code</summary>

We welcome people getting involved as contributors to this open source
project!

For detailed instructions please see:
[CONTRIBUTING.md](https://github.com/DerwenAI/kglab/blob/main/CONTRIBUTING.md)
</details>


<details>
  <summary>License and Copyright</summary>

Source code for **kglab** plus its logo, documentation, and examples
have an [MIT license](https://spdx.org/licenses/MIT.html) which is
succinct and simplifies use in commercial applications.

All materials herein are Copyright &copy; 2020-2022 Derwen, Inc.
</details>


<details>
  <summary>Attribution</summary>
Please use the following BibTeX entry for citing **kglab** if you use
it in your research or software.
Citations are helpful for the continued development and maintenance of
this library.

```bibtex
@software{kglab,
  author = {Paco Nathan},
  title = {{kglab: a simple abstraction layer in Python for building knowledge graphs}},
  year = 2020,
  publisher = {Derwen},
  doi = {10.5281/zenodo.6360664},
  url = {https://github.com/DerwenAI/kglab}
}
```
</details>


<img
 alt="illustration of a knowledge graph, plus laboratory glassware"
 src="https://raw.githubusercontent.com/DerwenAI/kglab/main/docs/assets/logo.png"
 width="231"
/>


## Kudos

Many thanks to our open source [sponsors](https://github.com/sponsors/ceteri);
and to our contributors:
[@ceteri](https://github.com/ceteri),
[@dvsrepo](https://github.com/dvsrepo),
[@Ankush-Chander](https://github.com/Ankush-Chander),
[@louisguitton](https://github.com/louisguitton),
[@tomaarsen](https://github.com/tomaarsen),
[@Mec-iS](https://github.com/Mec-iS),
[@cutterkom](https://github.com/cutterkom),
[@RishiKumarRay](https://github.com/RishiKumarRay),
[@Tpt](https://github.com/Tpt),
[@ArenasGuerreroJulian](https://github.com/ArenasGuerreroJulian),
[@fils](https://github.com/fils),
[@gauravjaglan](https://github.com/gauravjaglan),
[@pebbie](https://github.com/pebbie),
[@CatChenal](https://github.com/CatChenal),
[@jake-aft](https://github.com/jake-aft),
[@dmoore247](https://github.com/dmoore247),
plus general support from [Derwen, Inc.](https://derwen.ai/);
the [Knowledge Graph Conference](https://www.knowledgegraph.tech/)
and [Connected Data World](https://connected-data.world/);
plus an even larger scope of [use cases](https://derwen.ai/docs/kgl/use_case/)
represented by their communities;
[Kubuntu Focus](https://kfocus.org/),
the [RAPIDS team @ NVIDIA](https://rapids.ai/),
[Gradient Flow](https://gradientflow.com/),
and
[Manning Publications](https://www.manning.com/).

<img
 alt="kglab contributors"
 src="https://contributors-img.web.app/image?repo=derwenai/kglab"
/>


## Star History

[![Star History Chart](https://api.star-history.com/svg?repos=derwenai/kglab&type=Date)](https://star-history.com/#derwenai/kglab&Date)
