Skip to content

Commit

Permalink
Merge pull request #431 from dice-group/using_repr
Browse files Browse the repository at this point in the history
 repr() is being used at OWLLiteral with string value to adress
  • Loading branch information
Demirrr authored Aug 2, 2024
2 parents ef257c7 + 5f76a24 commit db3a910
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
20 changes: 16 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ wget https://files.dice-research.org/projects/Ontolearn/KGs.zip -O ./KGs.zip &&
# To download learning problems
wget https://files.dice-research.org/projects/Ontolearn/LPs.zip -O ./LPs.zip && unzip LPs.zip
```
```shell
pytest -p no:warnings -x # Running 64 tests takes ~ 6 mins
```

## Learning OWL Class Expression
```python
Expand Down Expand Up @@ -250,14 +247,29 @@ python examples/concept_learning_cv_evaluation.py --kb ./KGs/Carcinogenesis/carc

## Development


<details> <summary> To see the results </summary>

Creating a feature branch **refactoring** from development branch

```shell
git branch refactoring develop
```

Each feature branch must be merged to develop branch. To this end, the tests must run without a problem:
```shell
# To download knowledge graphs
wget https://files.dice-research.org/projects/Ontolearn/KGs.zip -O ./KGs.zip && unzip KGs.zip
# To download learning problems
wget https://files.dice-research.org/projects/Ontolearn/LPs.zip -O ./LPs.zip && unzip LPs.zip
# Download weights for some model for few tests
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/CLIP/CLIPData.zip && unzip CLIPData.zip && rm CLIPData.zip
pytest -p no:warnings -x # Running 80 tests takes ~ 11 mins
```



</details>

## References
Expand Down
7 changes: 3 additions & 4 deletions ontolearn/triple_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -890,14 +890,13 @@ def abox(self, str_iri: str) -> Generator[
elif data_type == "http://www.w3.org/2001/XMLSchema#double":
yield subject_, OWLDataProperty(p["value"]), OWLLiteral(value=float(o["value"]))
elif data_type == "http://www.w3.org/2001/XMLSchema#string":
yield subject_, OWLDataProperty(p["value"]), OWLLiteral(value=str(o["value"]))
yield subject_, OWLDataProperty(p["value"]), OWLLiteral(value=repr(o["value"]))
else:
raise NotImplementedError(
f"Currently this type of literal is not supported:{o} "
f"but can done easily let us know :)"
)
f"but can done easily let us know :)")
else:
yield subject_, OWLDataProperty(p["value"]), OWLLiteral(value=str(o["value"]))
yield subject_, OWLDataProperty(p["value"]), OWLLiteral(value=repr(o["value"]))

else:
raise RuntimeError(f"Unrecognized type {subject_} ({p}) ({o})")
Expand Down

0 comments on commit db3a910

Please sign in to comment.