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

New Release: 0.9.0 #518

Merged
merged 85 commits into from
Mar 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
5db17e3
Update README.md
Demirrr Nov 25, 2024
d328569
Update README.md
Demirrr Nov 28, 2024
b6c2894
DRILL shifts the quality computation to triplestore
Demirrr Dec 5, 2024
adf2bc4
rounding error fixed assert 0.911803325396488 > 0.92
Demirrr Dec 5, 2024
d2f976a
rounding error fixed assert 0.90 > 0.91
Demirrr Dec 5, 2024
79c58e8
Merge pull request #505 from dice-group/drill_confusion_matrix_sparql…
Demirrr Dec 5, 2024
c74de16
add initial methods for NCES2 and ROCES
Jean-KOUAGOU Dec 6, 2024
4c9a9d2
add Dataset class for ROCES and further dev of NCES2 and ROCES
Jean-KOUAGOU Dec 9, 2024
dd09e22
add script to run Drill and TDL on dbpedia
Jean-KOUAGOU Dec 9, 2024
b63f756
update script for cel on DBpedia
Jean-KOUAGOU Dec 10, 2024
ca050ef
fix issue related to temporary failures on triple store endpoint
Jean-KOUAGOU Dec 10, 2024
7c81717
continued integration of NCES2 and ROCES
Jean-KOUAGOU Dec 10, 2024
0278fcf
Add results to README, document owl_class_expression_learning_dbpedia…
Jean-KOUAGOU Dec 11, 2024
f094c11
update README
Jean-KOUAGOU Dec 11, 2024
5ac3ed8
continue implementation of NCES2 and ROCES
Jean-KOUAGOU Dec 11, 2024
2c882e1
work on trainer for all neural class expression synthesizers
Jean-KOUAGOU Dec 12, 2024
3a1b063
Merge pull request #506 from dice-group/cel_on_dbpedia
Demirrr Dec 13, 2024
3bb2de1
update ncestrainer to accomodate nces2 and roces
Jean-KOUAGOU Dec 16, 2024
bfa492b
Merge remote-tracking branch 'origin/develop' into add_roces_nces2
Jean-KOUAGOU Dec 16, 2024
94a06e6
test nces trainer with new implementation, NCES works
Jean-KOUAGOU Dec 17, 2024
a10fae8
update NCES2 and ROCES scripts. Training NCES2 and ROCES works!
Jean-KOUAGOU Dec 18, 2024
4a2c847
Completed integration. Tests are left to make sure everything runs pr…
Jean-KOUAGOU Dec 19, 2024
d86ffe6
working on tests
Jean-KOUAGOU Dec 20, 2024
55c1484
refactoring KnowledgeBase
alkidbaci Jan 2, 2025
ede1978
update test scripts
Jean-KOUAGOU Jan 6, 2025
ad51e7d
WIP: refactoring due to KnowledgeBase changes
alkidbaci Jan 6, 2025
97a7174
test nces, nces2, roces working.
Jean-KOUAGOU Jan 7, 2025
82753ad
WIP: refactoring due to KnowledgeBase changes
alkidbaci Jan 7, 2025
5caefa4
update nces_trainer test script
Jean-KOUAGOU Jan 7, 2025
efe6e11
WIP: refactoring TripleStore
alkidbaci Jan 8, 2025
b83d6dc
WIP: refactoring Triplestore: deprecated TriplestoreKnowledgeBase and…
alkidbaci Jan 9, 2025
e0fd201
Enhancing TripleStore
alkidbaci Jan 10, 2025
4b5fa54
update more scripts to accomodate integration of NCES2 and ROCES
Jean-KOUAGOU Jan 10, 2025
c0474fb
Removed TripleStoreKnowledgeBase & few fixes
alkidbaci Jan 13, 2025
302eb15
KnowledgeBase changed to AbstractKnowledgeBase where applicable
alkidbaci Jan 13, 2025
261e436
add default value in args
Jean-KOUAGOU Jan 13, 2025
a1c82a9
Removed unused imports
alkidbaci Jan 14, 2025
13c1b30
Updated TS example
alkidbaci Jan 14, 2025
88e11ae
small update for KB type
alkidbaci Jan 15, 2025
f23a068
doc publish on pull req
alkidbaci Jan 15, 2025
fa4b08e
updated docs
alkidbaci Jan 15, 2025
8d496c2
updated docs
alkidbaci Jan 16, 2025
af46315
update NCES2 and write config files
Jean-KOUAGOU Jan 17, 2025
74c4395
change learning rate scheduler to cosine in NCES, NCES2, ROCES
Jean-KOUAGOU Jan 17, 2025
3f596a0
add sampling set sizes for ROCES in config files
Jean-KOUAGOU Jan 20, 2025
1398ff5
remove outdated nces scripts and unify training script for NCES, NCES…
Jean-KOUAGOU Jan 21, 2025
5b1b47c
fix but in NCES dataset class
Jean-KOUAGOU Jan 22, 2025
990b854
fix but in NCES
Jean-KOUAGOU Jan 22, 2025
186ac9a
update inference scripts for NCES
Jean-KOUAGOU Jan 23, 2025
b83e529
Semantic caching algorithm added
Louis-Mozart Jan 27, 2025
a46531f
review changes
alkidbaci Feb 3, 2025
5fafab1
Update README.md
Jean-KOUAGOU Feb 3, 2025
ddfb426
fix typo in train_nces.py
Jean-KOUAGOU Jan 24, 2025
478dc8c
add benchmarking results for NCES2, ROCES, and update concept_learnin…
Jean-KOUAGOU Feb 3, 2025
6424a1f
refactoring due to circular imports
alkidbaci Feb 3, 2025
1f36cd0
Merge pull request #511 from dice-group/add_roces_nces2
alkidbaci Feb 4, 2025
12d8af3
Merge remote-tracking branch 'origin/develop' into refactoring
alkidbaci Feb 5, 2025
683ec24
fixed imports
alkidbaci Feb 5, 2025
ee259ab
Fixed issue with EvoLearner and tidying the code
alkidbaci Feb 6, 2025
524d819
Merge pull request #510 from dice-group/refactoring
Demirrr Feb 10, 2025
45cafb8
Merge remote-tracking branch 'origin/develop' into cache_for_owl_reas…
alkidbaci Feb 10, 2025
bb342bd
Corrections
alkidbaci Feb 10, 2025
5fcd368
Added license terms
alkidbaci Feb 11, 2025
9b6bf6e
`types` no longer ignores owl:NamedIndividuals
alkidbaci Feb 11, 2025
df1a5cd
Added support for the scenario when owl:Thing is not set explicitly
alkidbaci Feb 11, 2025
9c3ce79
Merge pull request #513 from dice-group/drill-update
Demirrr Feb 13, 2025
6d4c000
tests for semantic cache added
Louis-Mozart Feb 19, 2025
9841e06
Add test for eviction strategy
Louis-Mozart Feb 19, 2025
c9eae8c
fixing the path of the family dataset
Louis-Mozart Feb 19, 2025
3805a82
Removing the stopJVM line
Louis-Mozart Feb 19, 2025
7957b9e
Tests on the father dataset
Louis-Mozart Feb 20, 2025
11bb5f3
removig the test on larger cache size
Louis-Mozart Feb 21, 2025
5a0ba19
Removing run time tests
Louis-Mozart Feb 21, 2025
5d63524
Refactoring the tests
Louis-Mozart Feb 21, 2025
27dd35f
increasing the number of concepts in the tests
Louis-Mozart Feb 24, 2025
5b9e506
Merge pull request #512 from dice-group/cache_for_owl_reasoners
alkidbaci Feb 24, 2025
248bc3a
Docs update and version increase
alkidbaci Feb 24, 2025
62abb5b
Merge pull request #514 from dice-group/new-release
Demirrr Feb 25, 2025
7fd6475
Final changes before 0.9.0
alkidbaci Feb 27, 2025
f2634cf
testing only once
alkidbaci Feb 27, 2025
eaa9549
fix for ea_initialization
alkidbaci Feb 28, 2025
a34fc6e
Merge pull request #517 from dice-group/new-release
Demirrr Feb 28, 2025
989ee9c
Excluded recent tests
alkidbaci Mar 3, 2025
4de1dc3
lowered the cap for clip regression
alkidbaci Mar 3, 2025
c8f6454
Merge pull request #519 from dice-group/new-release
alkidbaci Mar 3, 2025
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
4 changes: 3 additions & 1 deletion .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 Expand Up @@ -51,7 +53,7 @@ jobs:
uses: nwtgck/actions-netlify@v1.2
with:
publish-dir: 'docs/_build/html'
production-branch: develop
production-branch: master
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: "Deploy from GitHub Actions ${{ github.sha }}"
alias: ${{ github.head_ref }}
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,16 @@ jobs:
run: |
ruff check ontolearn/learners/ --line-length=200

- name: Test with pytest
- name: Get external files
run: |
wget https://files.dice-research.org/projects/Ontolearn/KGs.zip
wget https://files.dice-research.org/projects/Ontolearn/LPs.zip
wget https://files.dice-research.org/projects/Ontolearn/CLIP/CLIPData.zip
wget https://files.dice-research.org/projects/NCES/NCES_Ontolearn_Data/NCESData.zip
unzip KGs.zip && unzip LPs.zip && unzip NCESData.zip && unzip CLIPData.zip
pytest -p no:warnings -x

- name: Coverage report
- name: Testing and coverage report
run: |
pip install coverage
coverage run -m pytest
coverage report -m
coverage run -m pytest -p no:warnings -x
coverage report -m
100 changes: 66 additions & 34 deletions README.md

Large diffs are not rendered by default.

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
43 changes: 20 additions & 23 deletions docs/usage/01_introduction.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,46 @@
# About Ontolearn

**Version:** ontolearn 0.8.1
**Version:** ontolearn 0.9.0

**GitHub repository:** [https://github.com/dice-group/Ontolearn](https://github.com/dice-group/Ontolearn)

**Publisher and maintainer:** [DICE](https://dice-research.org/) - data science research group of [Paderborn University](https://www.uni-paderborn.de/en/university).

**Contact**: [onto-learn@lists.uni-paderborn.de](mailto:onto-learn@lists.uni-paderborn.de)
**Contact**: [cdemir@mail.uni-paderborn.de](mailto:cdemir@mail.uni-paderborn.de), [alkid@mail.uni-paderborn.de](mailto:alkid@mail.uni-paderborn.de)

**License:** MIT License

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

Ontolearn is an open-source software library for explainable structured machine learning in Python.
OntoLearn is an open-source software library designed for explainable structured machine learning in OWL 2.0 ontologies.
Our primary objective is to leverage structured learning techniques within the OWL framework, providing a robust and
interpretable approach to ontology-based machine learning.

Ontolearn started with the goal of using _Explainable Structured Machine Learning_
in OWL 2.0 ontologies and this
exactly what our library offers. The main contribution are the exclusive concept learning
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).
One of OntoLearn’s key contributions is its exclusive concept learning algorithms, specifically tailored for Description
Logics (DL). The library currently includes nine fully functional algorithms capable of learning complex concepts in DL.
For further details and references, relevant research 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
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.
So now we use owlapy not only for OWL 2 entities representation but
for ontology manipulation and reasoning as well.
At the core of OntoLearn lies [Owlapy]((https://github.com/dice-group/owlapy)), a Python package inspired by the OWL API (its Java counterpart) and developed by
the OntoLearn team. To enhance modularity, readability, and maintainability, we have separated Owlapy from Ontolearn into an
independent repository. This modular approach allows Owlapy to serve not only as a framework for representing OWL 2
entities, but also as a tool for ontology manipulation and reasoning.

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

**Ontolearn (including owlapy and ontosample) can do the following:**

- Load/save ontologies in RDF/XML, OWL/XML.
- **Use concept learning algorithms to generate hypotheses for classifying positive examples in a learning problem**.
- **Use local datasets or datasets that are hosted on a triplestore server, for the learning task.**
- Construct/Generate class expressions and evaluate them using different metrics.
- Define learning problems.
- Load/create/save ontologies in RDF/XML, OWL/XML.
- Modify ontologies by adding/removing axioms.
- Access individuals/classes/properties of an ontology (and a lot more).
- Define learning problems.
- Sample ontologies.
- Construct class expressions.
- Use concept learning algorithms to classify positive examples in a learning problem.
- Use local datasets or datasets that are hosted on a triplestore server, for the learning task.
- Reason over an ontology.
- Other convenient functionalities like converting OWL class expressions to SPARQL or DL syntax.
- Convenient functionalities like converting OWL class expressions to SPARQL or DL syntax.
- Sample ontologies.

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

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.
79 changes: 45 additions & 34 deletions docs/usage/02_installation.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Installation

Since Ontolearn is a Python library, you will need to have Python on
your system. Python comes in various versions and with different,
sometimes conflicting dependencies. Hence, most guides will recommend
to set up a "virtual environment" to work in.
Since Ontolearn is a Python library, you will need to have Python installed on
your system (currently supporting version 3.10.13 or higher). Since python comes in various
versions and with different, sometimes conflicting dependencies, most guides will
recommend to set up a "virtual environment" to work in and so do we.

One such system for virtual python environments is
[conda](https://conda.io/projects/conda/en/latest/index.html).
To create a virtual python environments you can consider using the builtin python module
[venv](https://docs.python.org/3/library/venv.html) or [conda](https://conda.io/projects/conda/en/latest/index.html).

## Installation via _pip_

Expand Down Expand Up @@ -71,18 +71,15 @@ to successfully pass all the tests:
```shell
pytest
```
Note: Since Unix and Windows reference files differently, the test are set to work on Linux
but in Widows the filepaths throughout test cases should be changed which is something that
is not very convenient to do. If you really want to run the tests in Windows, you can
make use of the replace all functionality to change them.
Note: The tests are designed to run successfully on Linux machines since we also use them in
GitHub Action. Therefore, trying to run them on a Windows machine can lead to some issues.

## 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,31 +106,33 @@ Finally, remove the _.zip_ file:
rm KGs.zip
```

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

### NCES data:
To download learning problems:

```shell
wget https://files.dice-research.org/projects/NCES/NCES_Ontolearn_Data/NCESData.zip -O ./NCESData.zip
unzip NCESData.zip
rm NCESData.zip
wget https://files.dice-research.org/projects/Ontolearn/LPs.zip
```

If you are getting any error check if the following flags can help:
Follow the same steps to unzip as the in the KGs case.

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

### Other Data
Below you will find the links to get the necesseray data for _NCES_, _NCES2_, _ROCES_ and _CLIP_.
The process to extract the data is the same as shown earlier with "KGs".

```shell
unzip -o NCESData.zip
rm -f NCESData.zip
```

-------------------------------------------------------
#NCES:
https://files.dice-research.org/projects/NCES/NCES_Ontolearn_Data/NCESData.zip

### CLIP data:
#NCES2:
https://files.dice-research.org/projects/NCES/NCES_Ontolearn_Data/NCES2Data.zip

```commandline
wget https://files.dice-research.org/projects/Ontolearn/CLIP/CLIPData.zip
unzip CLIPData.zip
rm CLIPData.zip
#ROCES:
https://files.dice-research.org/projects/NCES/NCES_Ontolearn_Data/ROCESData.zip

#CLIP:
https://files.dice-research.org/projects/Ontolearn/CLIP/CLIPData.zip
```

## Building (sdist and bdist_wheel)
Expand All @@ -143,11 +142,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 +173,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