Skip to content

Commit

Permalink
Merge pull request #69 from DerwenAI/update
Browse files Browse the repository at this point in the history
Update
  • Loading branch information
ceteri authored Jan 1, 2021
2 parents 683e72f + 833b8a9 commit 506c19f
Show file tree
Hide file tree
Showing 18 changed files with 338 additions and 5,049 deletions.
132 changes: 13 additions & 119 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

The **kglab** library provides a simple abstraction layer in Python
for building knowledge graphs.
Welcome to *graph-based data science*.
Welcome to *graph-based data science*:
<https://derwen.ai/docs/kgl/>

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

Expand Down Expand Up @@ -55,138 +55,31 @@ graph libraries in Python:
<https://derwen.ai/docs/kgl/tutorial/>



### Dependencies

- [Python 3.6+](https://www.python.org/downloads/)
- [cairocffi](https://github.com/Kozea/cairocffi)
- [gensim](https://radimrehurek.com/gensim/)
- [GPUtil](https://github.com/anderskm/gputil)
- [leidenalg](https://github.com/vtraag/leidenalg)
- [matplotlib](https://matplotlib.org/)
- [NetworkX](https://networkx.org/)
- [NumPy](https://numpy.org/)
- [OWL-RL](https://github.com/RDFLib/OWL-RL)
- [pandas](https://pandas.pydata.org/)
- [pslpython](https://psl.linqs.org/)
- [pySHACL](https://github.com/RDFLib/pySHACL)
- [pyarrow](https://arrow.apache.org/)
- [pylev](https://github.com/toastdriven/pylev)
- [python-dateutil](https://pypi.org/project/python-dateutil/)
- [python-igraph](https://igraph.org/python/)
- [pyvis](https://pyvis.readthedocs.io/)
- [RDFlib](https://rdflib.readthedocs.io/)
- [rdflib-json](https://github.com/RDFLib/rdflib-jsonld)


## Build Instructions

**Note: most use cases won't need to build this package locally.**
Instead, simply install from
[PyPi](https://pypi.python.org/pypi/kglab)
or [Conda](https://docs.conda.io/).

To set up the build environment locally:
```
pip install -r requirements_build.txt
```

You will also need to download
[`ChromeDriver`](https://chromedriver.chromium.org/downloads)
for your version of the `Chrome` brower, saved as `chromedriver` in this directory.

This project uses `typing` and [`mypy`](https://mypy.readthedocs.io/) for *type checking*.
To run type checking:
```
mypy kglab/*.py
```

This project uses `unittest` and [`coverage`](https://coverage.readthedocs.io/) for *unit test* coverage.
Source for unit tests is in the `test.py` module.
To run unit tests:
```
coverage run -m unittest discover
```

To generate a coverage report and upload it to the `codecov.io`
reporting site (if you have the token):
```
coverage report
bash <(curl -s https://codecov.io/bash) -t @.cc_token
```

Test coverage reports can be viewed at
<https://codecov.io/gh/DerwenAI/kglab>

To generate documentation pages, this project uses:

* [`MkDocs`](https://www.mkdocs.org/)
* [`makedocs-material`](https://squidfunk.github.io/mkdocs-material/)
* [`MathJax`](https://www.mathjax.org/)
* [`pymdown-extensions`](https://facelessuser.github.io/pymdown-extensions/)
* [`Jupyter`](https://jupyter.org/install)
* [`nbconvert`](https://nbconvert.readthedocs.io/)
* [`Selenium`](https://selenium-python.readthedocs.io/)
* [`Chrome`](https://www.google.com/chrome/)
* [`Flask`](https://flask.palletsprojects.com/)

Source for documentation is in the `docs` subdirectory.
To build the documentation:
```
./nb_md.sh
./pkg_doc.py docs/ref.md
mkdocs build
```

To preview the generated microsite locally:
```
./preview.py
```

Then browse to <http://localhost:8000> to review the generated
documentation.

To package the generated microsite for deployment on a
Flask/WSGI server:
```
tar cvzf kgl.tgz site/
```

To update the [release on PyPi](https://pypi.org/project/kglab/):
```
./push_pypi.sh
```


---

[![kg+lab](https://github.com/DerwenAI/kglab/blob/main/docs/illo/kglab.png)](https://github.com/DerwenAI/kglab/blob/main/docs/illo/kglab.png)

## Production Use Cases

* [Derwen](https://derwen.ai/) and its client projects


## Similar Projects

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

* [zincbase](https://github.com/complexdb/zincbase)
* *pro:* probabilistic graph measures, complex simulation suite, leverages GPUs
* *con:* lacks interchange with RDF or other standard formats
* [KGTK](https://github.com/usc-isi-i2/kgtk)
* *pro:* many excellent examples, well-documented in Jupyter notebooks
* *con:* mostly a CLI tool, primarily based on TSV data
![illustration of a knowledge graph, plus laboratory glassware](https://raw.githubusercontent.com/DerwenAI/kglab/main/docs/assets/logo.png)


## Attribution
## License and Copyright

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 (c) 2020-2021 Derwen, Inc.


## Attribution

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.

Expand All @@ -204,7 +97,8 @@ Citations are helpful for the continued development and maintenance of this libr
## Kudos

Many thanks to our contributors:
[@ceteri]((https://github.com/ceteri),
[@jake-aft](https://github.com/jake-aft),
[@dmoore247](https://github.com/dmoore247),
plus general support from [Derwen, Inc.](https://derwen.ai/)
and [The Knowledge Graph Conference](https://www.knowledgegraph.tech/).
plus general support from [Derwen, Inc.](https://github.com/DerwenAI)
and [The Knowledge Graph Conference](https://github.com/KGConf).
Binary file added docs/assets/learning.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
10 changes: 8 additions & 2 deletions docs/author.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ KTH, NYU, GWU,
U&nbsp;Maryland, Cal&nbsp;Poly, UT/Austin,
U&nbsp;Virginia, CU&nbsp;Boulder.


## Just Enough Math, Edition 2

You'll find elements from most of the above woven throughout this
[**kglab** tutorial](../tutorial/):
data science, business context, AI applications,
Expand All @@ -71,9 +74,12 @@ which had the elevator pitch:
thanks to quick thinking by editor Ann Spencer –
turned into a popular video+notebook series,
followed by tutorials, and then a community focused on open source.
Seven years later the field of
[data science](../glossary/#data-science)
has changed dramatically
This time around, **kglab** starts as an open source Python library,
with a notebook-based tutorial at its core,
focused on a community and their business use cases.
Perhaps someday it may spin-out a book or other learning materials.

YMMV.
The scope now is about [*graph-based data science*](../glossary/#graph-based-data-science),
and perhaps someday this may spin-out a book or other learning materials.
18 changes: 17 additions & 1 deletion docs/biblio.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ O'Reilly Media (2020)
**Jesse Anderson**
Apress (2020)


## – B –

### bell2019
Expand All @@ -34,6 +35,7 @@ Manning (2018)
**Eric Brewer**
*Computer* 45:2 (2012)


## – C –

### ceder2018
Expand All @@ -48,6 +50,13 @@ Manning (2018)
**François Chollet**
Manning (2017)

### chong2021ds

[*Become a Leader in Data Science*](https://www.manning.com/books/become-a-leader-in-data-science)
**Jike Chong**, **Yue Cathy Chang**
Manning (2021)


## – D –

### das2020meta
Expand All @@ -61,6 +70,7 @@ Manning (2017)
**Aaron Kalb**, **Daniel Rincon Silva**
LinkedIn (2020)


## – G –

### gosnell2020
Expand All @@ -75,6 +85,7 @@ O'Reilly Media (2020)
**Thomas R. Gruber**
*Knowledge Acquisition* 5 (1993)


## – H –

### hellersteinsgsa17
Expand All @@ -98,6 +109,7 @@ O'Reilly Media (2020)
**Antoine Zimmermann**
*arXiv* (2020)


## – J –

### jonas2019cloud
Expand All @@ -109,6 +121,7 @@ O'Reilly Media (2020)
**Raluca Ada Popa**, **Ion Stoica**, **David A. Patterson**
*arXiv* (2019)


## – K –

### kreps2014
Expand All @@ -117,6 +130,7 @@ O'Reilly Media (2020)
**Jay Kreps**
O'Reilly Media (2014)


## – L –

### ledem2013hadoop
Expand Down Expand Up @@ -151,11 +165,12 @@ Gradient Flow (2020)

### lorica2020rai

["Responsible AI in Practice"](https://gradientflow.com/ResponsibleAI2020)
["Responsible AI in Practice"](https://gradientflow.com/ResponsibleAI2020)
**Ben Lorica**, **Paco Nathan**, **Gina Blaber**, **Andrew Burt**,
**Rumman Chowdhury**, **Yishay Carmiel**
Gradient Flow (2020)


## – N –

### nathan2014jem
Expand All @@ -176,6 +191,7 @@ Manning (2021)
**Natalya F. Noy**, **Deborah L. McGuinness**
*Stanford Knowledge Systems Laboratory Technical Report KSL-01-05* (2001)


## – P –

### perrone2020network
Expand Down
104 changes: 104 additions & 0 deletions docs/build.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# Build Instructions

!!! note
In most cases you won't need to build this package locally.

Unless you're doing development work on the **kglab** library itself,
simply install based on the instructions in
["Getting Started"](https://derwen.ai/docs/kgl/start/).


## Setup

To set up the build environment locally:
```
pip install -r requirements_build.txt
```

You will also need to download
[`ChromeDriver`](https://chromedriver.chromium.org/downloads)
for your version of the `Chrome` brower, saved as `chromedriver` in this directory.


## Type Checking

This project uses `typing` and [`mypy`](https://mypy.readthedocs.io/)
for *type checking*.

To run type checking:
```
mypy kglab/*.py
```


## Test Coverage

This project uses `unittest` and
[`coverage`](https://coverage.readthedocs.io/)
for *unit test* coverage.
Source for unit tests is in the
[`test.py`](https://github.com/DerwenAI/kglab/blob/main/test.py)
module.

To run unit tests:
```
coverage run -m unittest discover
```

To generate a coverage report and (providing you have the access
token) upload it to the `codecov.io` reporting site:
```
coverage report
bash <(curl -s https://codecov.io/bash) -t @.cc_token
```

Test coverage reports can be viewed at
<https://codecov.io/gh/DerwenAI/kglab>


## Online Documentation

To generate documentation pages, this project uses:

* [`MkDocs`](https://www.mkdocs.org/)
* [`makedocs-material`](https://squidfunk.github.io/mkdocs-material/)
* [`pymdown-extensions`](https://facelessuser.github.io/pymdown-extensions/)
* [`MathJax`](https://www.mathjax.org/)
* [`Jupyter`](https://jupyter.org/install)
* [`nbconvert`](https://nbconvert.readthedocs.io/)
* [`Selenium`](https://selenium-python.readthedocs.io/)
* [`Chrome`](https://www.google.com/chrome/)
* [`Flask`](https://flask.palletsprojects.com/)

Source for the documentation is in the
[`docs`](https://github.com/DerwenAI/kglab/tree/main/docs)
subdirectory.

To build the documentation:
```
./nb_md.sh
./pkg_doc.py docs/ref.md
mkdocs build
```

To preview the generated microsite locally:
```
./preview.py
```

Then browse to <http://localhost:8000> to review the generated
documentation.

To package the generated microsite for deployment on a
Flask/WSGI server:
```
tar cvzf kgl.tgz site/
```


## Package Release

To update the [release on PyPi](https://pypi.org/project/kglab/):
```
./push_pypi.sh
```
Loading

0 comments on commit 506c19f

Please sign in to comment.