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

Final changes before 0.9.0 #517

Merged
merged 3 commits into from
Feb 28, 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: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,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
28 changes: 11 additions & 17 deletions docs/usage/02_installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,29 +116,23 @@ Follow the same steps to unzip as the in the KGs case.

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

### NCES data:
### 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
wget https://files.dice-research.org/projects/NCES/NCES_Ontolearn_Data/NCESData.zip -O ./NCESData.zip
unzip NCESData.zip
rm NCESData.zip
```

If you are getting any error check if the following flags can help:
#NCES:
https://files.dice-research.org/projects/NCES/NCES_Ontolearn_Data/NCESData.zip

```shell
unzip -o NCESData.zip
rm -f NCESData.zip
```
#NCES2:
https://files.dice-research.org/projects/NCES/NCES_Ontolearn_Data/NCES2Data.zip

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

### CLIP data:

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

## Building (sdist and bdist_wheel)
Expand Down
3 changes: 3 additions & 0 deletions ontolearn/ea_initialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
from itertools import chain, cycle

from owlapy.class_expression import OWLClass, OWLClassExpression, OWLThing
from owlapy.iri import IRI
from owlapy.owl_individual import OWLNamedIndividual
from owlapy.owl_literal import OWLLiteral
from owlapy.owl_property import OWLDataProperty, OWLObjectProperty
Expand Down Expand Up @@ -241,6 +242,8 @@ def _select_type(self, ind: OWLNamedIndividual) -> OWLClass:
@lru_cache(maxsize=_cache_size)
def _get_types(self, ind: OWLNamedIndividual, direct: bool = False) -> Set[OWLClass]:
inds = set(self.kb.get_types(ind, direct))
if OWLClass(IRI("http://www.w3.org/2002/07/owl#", "NamedIndividual")) in inds:
inds.remove(OWLClass(IRI("http://www.w3.org/2002/07/owl#", "NamedIndividual")))
return inds if inds else {OWLThing}

@lru_cache(maxsize=_cache_size)
Expand Down