Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merging TripleStore and TripleStroreKnowledgeBase, Refactoring and Documentation update #510

Merged
merged 17 commits into from
Feb 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
- master
- documentation # only for quick updates or testing purposes
pull_request:
branches:
- master

jobs:
docs:
Expand Down
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Ontolearn is an open-source software library for explainable structured machine
usage/02_installation
usage/03_examples
usage/04_knowledge_base
usage/05_evaluate_ce
usage/06_concept_learners
usage/09_further_resources
autoapi/ontolearn/index
Expand Down
5 changes: 2 additions & 3 deletions docs/usage/01_introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ exactly what our library offers. The main contribution are the exclusive concept
algorithms that are part of this library. Currently, we have 6 fully functioning algorithms that
learn concept in description logics. Papers can be found [here](09_further_resources.md).

For the base (core) module of Ontolearn we use [owlapy](https://github.com/dice-group/owlapy)
which on its end uses [Owlready2](https://owlready2.readthedocs.io/en/latest/index.html). _Owlapy_ is a python package
For the base (core) module of Ontolearn we use [owlapy](https://github.com/dice-group/owlapy). _Owlapy_ is a python package
based on owlapi (the java counterpart), and implemented by us, the Ontolearn team.
For the sake of modularization we have moved it in a separate repository.
The modularization aspect helps us to increase readability and reduce complexity.
Expand All @@ -46,4 +45,4 @@ for ontology manipulation and reasoning as well.
------------------------------------

The rest of content after "examples" is build as a top-to-bottom guide, but nevertheless self-containing, where
you can learn more in depth about the capabilities of Ontolearn.
you can learn more in depth about the components of Ontolearn.
37 changes: 28 additions & 9 deletions docs/usage/02_installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,9 @@ make use of the replace all functionality to change them.
## Download External Files

Some resources like pre-calculated embeddings or `pre_trained_agents` and datasets (ontologies)
are not included in the repository directly. Use the command line command `wget`
to download them from our data server.
are not included in the repository directly. Use the command `wget` to download them from our data server.

> **NOTE: Before you run this commands in your terminal, make sure you are
> **NOTE: Before you run the following commands in your terminal, make sure you are
in the root directory of the project!**

To download the datasets:
Expand All @@ -109,6 +108,14 @@ Finally, remove the _.zip_ file:
rm KGs.zip
```

To download learning problems:

```shell
wget https://files.dice-research.org/projects/Ontolearn/LPs.zip
```

Follow the same steps to unzip as the in the KGs case.

--------------------------------------------------------

### NCES data:
Expand All @@ -130,7 +137,7 @@ rm -f NCESData.zip

### CLIP data:

```commandline
```shell
wget https://files.dice-research.org/projects/Ontolearn/CLIP/CLIPData.zip
unzip CLIPData.zip
rm CLIPData.zip
Expand All @@ -143,11 +150,18 @@ it is necessary to use the `build` tool. It can be invoked with:

```shell
python -m build

# or

python setup.py bdist_wheel sdist
```

from the main source code folder. Packages created by `build` can then
be uploaded as releases to the [Python Package Index (PyPI)](https://pypi.org/) using
[twine](https://pypi.org/project/twine/).
Distribution packages that are created, can then
be published to the [Python Package Index (PyPI)](https://pypi.org/) using [twine](https://pypi.org/project/twine/).

```shell
py -m twine upload --repository pypi dist/*
```


### Building the docs
Expand All @@ -167,12 +181,17 @@ sphinx-build -M latex docs/ docs/_build/

## Simple Linting

Using the following command will run the linting tool [flake8](https://flake8.pycqa.org/) on the source code.
You can lint check using [flake8](https://flake8.pycqa.org/):
```shell
flake8
```

Additionally, you can specify the path where you want to flake8 to run.
or ruff:
```shell
ruff check
```

Additionally, you can specify the path where you want to execute the linter.


----------------------------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions docs/usage/03_examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

In this guide we will show some non-trival examples of typical use-cases of Ontolearn
which you can also find in the
[examples](https://github.com/dice-group/Ontolearn/tree/develop/examples) folder.
[examples](https://github.com/dice-group/Ontolearn/tree/master/examples) folder.


## Ex. 1: Learning Over a Local Ontology
Expand Down Expand Up @@ -133,7 +133,7 @@ save_owl_class_expressions(expressions=h, path="owl_prediction")
Here we have used the triplestore endpoint as you see in step _(1)_ which is
available only on a private network. However, you can host your own triplestore
server following [this guide](06_concept_learners.md#loading-and-launching-a-triplestore)
and run TDL using you own local endpoint.
and run TDL using you own local endpoint. We have a [script](https://github.com/dice-group/Ontolearn/blob/master/examples/concept_learning_via_triplestore_example.py) for that also.

--------------------------------------------------------------

Expand Down Expand Up @@ -263,6 +263,6 @@ if __name__ == '__main__':

-----------------------------------------------------------

In the next guide we will explore the [KnowledgeBase](ontolearn.knowledge_base.KnowledgeBase) class that is needed to
In the next guide we will explore the [KnowledgeBase](ontolearn.knowledge_base.KnowledgeBase) class which is needed to
run a concept learner.

Loading
Loading