Skip to content
New issue

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

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

Already on GitHub? # to your account

Add caching and extension to tripper.Namespace #194

Closed
jesper-friis opened this issue Mar 9, 2024 · 0 comments · Fixed by #195
Closed

Add caching and extension to tripper.Namespace #194

jesper-friis opened this issue Mar 9, 2024 · 0 comments · Fixed by #195

Comments

@jesper-friis
Copy link
Contributor

tripper.Namespace already allow working with ontologies using numerical IDs, like EMMO, in a user friendly way. However, it requires that the ontology is downloaded at every invocation, which may have a detrimental impact on performance.

Also, some ontologies does not load all its modules by default. This is e.g. the case of EMMO that for instance doesn't load pre-fixed and non-coherent units by default. Hence, by default not all concepts are accessible from the namespace object.

To address these two issues:

  1. cache the downloaded ontology
  2. make it easy to load additional modules into the namespace
@jesper-friis jesper-friis linked a pull request Mar 10, 2024 that will close this issue
10 tasks
jesper-friis added a commit that referenced this issue Mar 16, 2024
# Description
Simplified and improved the usability of namespaces

* Added persistent cache to Namespace. Loading a large namespace like EMMO from cache is now almost instant.
* Added extend_namespace() utility function.
* Simplified the implementation of Namespace, including:
  - replaced `cachemode` argument with the simple boolean argument `reload`
  - removed `triplestore_url` argument
  - added `format` argument for supporting loading ontologies in formats other than turtle
* Updated the `Triplestore.bind()` method to make it simpler to use.
* Updated the tutorial and improved the description of how namespaces can be used.
* Added and improved tests. Added example for simplified SPARQL queries using tripper Namespace.

Closes #194 

## Type of change
- [ ] Bug fix and code cleanup
- [x] New feature
- [x] Documentation update
- [x] Testing

Co-authored-by: Tor S. Haugland <tor.haugland@sintef.no>
Co-authored-by: Francesca L. Bleken <48128015+francescalb@users.noreply.github.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant