Skip to content

Commit 248bc3a

Browse files
committed
Docs update and version increase
1 parent 5b9e506 commit 248bc3a

7 files changed

+142
-107
lines changed

README.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[![Downloads](https://static.pepy.tech/badge/ontolearn)](https://pepy.tech/project/ontolearn)
22
[![Downloads](https://img.shields.io/pypi/dm/ontolearn)](https://pypi.org/project/ontolearn/)
33
[![Coverage](https://img.shields.io/badge/coverage-86%25-green)](https://ontolearn-docs-dice-group.netlify.app/usage/09_further_resources#code-coverage)
4-
[![Pypi](https://img.shields.io/badge/pypi-0.8.1-blue)](https://pypi.org/project/ontolearn/0.8.1/)
5-
[![Docs](https://img.shields.io/badge/documentation-0.8.1-yellow)](https://ontolearn-docs-dice-group.netlify.app/usage/01_introduction)
4+
[![Pypi](https://img.shields.io/badge/pypi-0.9.0-blue)](https://pypi.org/project/ontolearn/0.9.0/)
5+
[![Docs](https://img.shields.io/badge/documentation-0.9.0-yellow)](https://ontolearn-docs-dice-group.netlify.app/usage/01_introduction)
66
[![Python](https://img.shields.io/badge/python-3.10.13+-4584b6)](https://www.python.org/downloads/release/python-31013/)
77
 
88

@@ -18,6 +18,7 @@ $E^+$ and $E^-$, learning [OWL Class expression](https://www.w3.org/TR/owl2-synt
1818
$$\forall p \in E^+\ \mathcal{K} \models H(p) \wedge \forall n \in E^-\ \mathcal{K} \not \models H(n).$$
1919

2020
To tackle this supervised learning problem, ontolearn offers many symbolic, neuro-symbolic and deep learning based Learning algorithms:
21+
- **TDL** → Tree-based OWL Class Expression Learner for Large Graphs
2122
- **Drill** → [Neuro-Symbolic Class Expression Learning](https://www.ijcai.org/proceedings/2023/0403.pdf)
2223
- **EvoLearner** → [EvoLearner: Learning Description Logics with Evolutionary Algorithms](https://dl.acm.org/doi/abs/10.1145/3485447.3511925)
2324
- **NCES2** → [Neural Class Expression Synthesis in ALCHIQ(D)](https://papers.dice-research.org/2023/ECML_NCES2/NCES2_public.pdf)
@@ -121,7 +122,7 @@ print(owl_expression_to_sparql(expression=h))
121122
save_owl_class_expressions(expressions=h,path="#owl_prediction")
122123
```
123124

124-
Fore more please refer to the [examples](https://github.com/dice-group/Ontolearn/tree/develop/examples) folder.
125+
Fore more please refer to the [examples](https://github.com/dice-group/Ontolearn/tree/develop/examples) folder.
125126

126127
## ontolearn-webservice
127128

docs/usage/01_introduction.md

+19-21
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,44 @@
11
# About Ontolearn
22

3-
**Version:** ontolearn 0.8.1
3+
**Version:** ontolearn 0.9.0
44

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

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

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

1111
**License:** MIT License
1212

1313
--------------------------------------------------------------------------------------------
1414

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

17-
Ontolearn started with the goal of using _Explainable Structured Machine Learning_
18-
in OWL 2.0 ontologies and this
19-
exactly what our library offers. The main contribution are the exclusive concept learning
20-
algorithms that are part of this library. Currently, we have 6 fully functioning algorithms that
21-
learn concept in description logics. Papers can be found [here](09_further_resources.md).
19+
One of OntoLearn’s key contributions is its exclusive concept learning algorithms, specifically tailored for Description
20+
Logics (DL). The library currently includes nine fully functional algorithms capable of learning complex concepts in DL.
21+
For further details and references, relevant research papers can be found [here](09_further_resources.md).
2222

23-
For the base (core) module of Ontolearn we use [owlapy](https://github.com/dice-group/owlapy). _Owlapy_ is a python package
24-
based on owlapi (the java counterpart), and implemented by us, the Ontolearn team.
25-
For the sake of modularization we have moved it in a separate repository.
26-
The modularization aspect helps us to increase readability and reduce complexity.
27-
So now we use owlapy not only for OWL 2 entities representation but
28-
for ontology manipulation and reasoning as well.
23+
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
24+
the OntoLearn team. To enhance modularity, readability, and maintainability, we have separated Owlapy from Ontolearn into an
25+
independent repository. This modular approach allows Owlapy to serve not only as a framework for representing OWL 2
26+
entities, but also as a tool for ontology manipulation and reasoning.
2927

3028
---------------------------------------
3129

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

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

4543
------------------------------------
4644

docs/usage/02_installation.md

+8-10
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Installation
22

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

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

1111
## Installation via _pip_
1212

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

7977
## Download External Files
8078

docs/usage/04_knowledge_base.md

+24-18
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ and a reasoner of type [AbstractOWLReasoner](https://dice-group.github.io/owlapy
77
are not compatible with each other. For example, you can not use [TripleStore](ontolearn.triple_store.TripleStore)
88
knowledge base with
99
[StructuralReasoner](https://dice-group.github.io/owlapy/autoapi/owlapy/owl_reasoner/index.html#owlapy.owl_reasoner.StructuralReasoner),
10-
but you can use _TripleStore_ KB with [TripleStoreReasoner](ontolearn.triple_store.TripleStoreReasoner).
10+
but you can use [TripleStore](ontolearn.triple_store.TripleStore) knowledge base with [TripleStoreReasoner](ontolearn.triple_store.TripleStoreReasoner).
1111
_AbstractKnowledgeBase_ contains the necessary methods to facilitate _Structured Machine Learning_.
1212

1313
Currently, there are two implementation of _AbstractKnowledgeBase_:
@@ -20,9 +20,10 @@ Currently, there are two implementation of _AbstractKnowledgeBase_:
2020
These terms may be used interchangeably sometimes but in Ontolearn they are not the same thing,
2121
although they share a lot of similarities. An ontology in owlapy, as explained
2222
[here](https://dice-group.github.io/owlapy/usage/ontologies.html) is the object where we load
23-
the OWL 2.0 ontologies from a _.owl_ file containing the ontology in an RDF/XML or OWL/XML format.
24-
On the other side a knowledge base combines an ontology and a reasoner together.
25-
Therefore, differently from the ontology you can use methods that require reasoning. You can check
23+
the OWL 2.0 ontologies (supporting different formats OWL/XML, RDF/XML, Triples etc.)
24+
On the other side a knowledge base combines an ontology and a reasoner together and is main purpose
25+
is to ease the process of concept learning serving as both a storing entity and a data retrieval entity.
26+
Therefore, differently from the ontology object you can use reasoning methods. You can check
2627
the methods for each in the links below:
2728

2829
- [AbstractKnowledgeBase](ontolearn.knowledge_base.AbstractKnowledgeBase)
@@ -37,16 +38,13 @@ is required to run a learning algorithm.
3738
can retrieve information from signature of this ontology. In case of a local the ontology, it can be modified and
3839
saved.
3940

40-
- Although they have some similar functionalities, there are a lot of other distinct
41-
functionalities that each of them has.
42-
43-
41+
4442
## Create an Instance of KnowledgeBase
4543

46-
Let us show how you can initialize an object of `KnowledgeBase`.
47-
We consider that you have already an OWL 2.0 ontology (containing *.owl* extension).
44+
Let us show how you can initialize an instance of `KnowledgeBase`.
45+
We consider that you have already an OWL 2.0 ontology locally (for example a file ending with *.owl*).
4846

49-
The simplest way is to use the path of your _.owl_ file as follows:
47+
The simplest way is to use the path of your local ontology as follows:
5048

5149
```python
5250
from ontolearn.knowledge_base import KnowledgeBase
@@ -55,7 +53,10 @@ kb = KnowledgeBase(path="file://KGs/Family/father.owl")
5553
```
5654

5755
What happens in the background is that the ontology located in this path will be loaded
58-
in the `AbstractOWLOntology` object of `kb` as done [here](https://dice-group.github.io/owlapy/usage/ontologies.html#loading-an-ontology).
56+
in the `AbstractOWLOntology` object of `kb` as well as a reasoner will be created using that
57+
ontology during initialisation. You may as well initialise an instance of `KnowledgeBase` using
58+
an instance of an ontology and reasoner. For this example we are using a minimalistic ontology
59+
called the _father_ ontology which you can download as instructed [here](02_installation.md#download-external-files).
5960

6061

6162
## Ignore Concepts
@@ -145,8 +146,8 @@ male_individuals = kb.individuals(male_concept)
145146
Sometimes ontologies and therefore knowledge bases can get very large and our
146147
concept learners become inefficient in terms of runtime. Sampling is an approach
147148
to extract a portion of the whole knowledge base without changing its semantic and
148-
still being expressive enough to yield results with as little loss of quality as
149-
possible. [OntoSample](https://github.com/alkidbaci/OntoSample/tree/main) is
149+
still being expressive enough to yield results (in the learning task) with as little
150+
loss of quality as possible. [OntoSample](https://github.com/alkidbaci/OntoSample/tree/main) is
150151
a library that we use to perform the sampling process. It offers different sampling
151152
techniques which fall into the following categories:
152153

@@ -164,7 +165,10 @@ You can check them [here](https://github.com/alkidbaci/OntoSample/tree/main).
164165

165166
When operated on its own, Ontosample uses a light version of Ontolearn (`ontolearn_light`)
166167
to reason over ontologies, but when both packages are installed in the same environment
167-
it will use `ontolearn` module instead. This is made for compatibility reasons.
168+
it will use `ontolearn` module instead. This is made for compatibility reasons. However, since
169+
the libraries are managed separately, you may encounter potential errors when installing them
170+
in the same environment. In this case we recommend using Ontosample in another environment
171+
to perform sampling.
168172

169173
Ontosample treats the knowledge base as a graph where nodes are individuals
170174
and edges are object properties. However, Ontosample also offers support for
@@ -237,15 +241,17 @@ folder. You will find descriptive comments in that script that will help you und
237241

238242
For more details about OntoSample you can see [this paper](https://dl.acm.org/doi/10.1145/3583780.3615158).
239243

244+
Note: You cannot use sampling on a `TripleStore` knowledge base.
245+
240246
## TripleSore Knowledge Base
241247

242-
Instead of going through nodes using expensive computation resources why not just make use of the
248+
Instead of querying knowledge graphs loaded locally using expensive computation resources why not just make use of the
243249
efficient approach of querying a triplestore using SPARQL queries. We have brought this
244-
functionality to Ontolearn for our learning algorithms, and we take care of the conversion part behind the scene.
250+
functionality to Ontolearn for our learning algorithms.
245251
Let's see what it takes to make use of it.
246252

247253
First of all you need a server which should host the triplestore for your ontology. If you don't
248-
already have one, see [Loading and Launching a Triplestore](#loading-and-launching-a-triplestore) below.
254+
already have one and just want to try things out, see [Loading and Launching a Triplestore](#loading-and-launching-a-triplestore) below.
249255

250256
Now you can simply initialize an instance of `TripleStore` class that will serve as an input for your desired
251257
concept learner:

0 commit comments

Comments
 (0)