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

Added collection backend #44

Merged
merged 10 commits into from
Dec 3, 2022
Merged

Conversation

jesper-friis
Copy link
Contributor

@jesper-friis jesper-friis commented Dec 1, 2022

Closes #41

Simple backend providing a tripper interface to DLite collections. Will be used by oteapi when DLite is chooses as interoperability platform.

This PR also include tests for utils.py - they are written as a script since they are so simple that test isolation via pytest is not needed.

Note this is a minimal implementation. Support for prefixes should be added in follow-up PRs.

Right now all triples are stored written out completely, but for the user of dlite, I guess it would be easier if the IRIs stored in the collection would be prefixed. This is a topic for a later PR, though.

@jesper-friis jesper-friis linked an issue Dec 1, 2022 that may be closed by this pull request
@codecov-commenter
Copy link

codecov-commenter commented Dec 1, 2022

Codecov Report

Base: 72.38% // Head: 74.25% // Increases project coverage by +1.87% 🎉

Coverage data is based on head (f4ae97c) compared to base (db8426c).
Patch coverage: 81.25% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #44      +/-   ##
==========================================
+ Coverage   72.38%   74.25%   +1.87%     
==========================================
  Files          11       12       +1     
  Lines         659      703      +44     
==========================================
+ Hits          477      522      +45     
+ Misses        182      181       -1     
Impacted Files Coverage Δ
tripper/literal.py 83.33% <0.00%> (ø)
tripper/triplestore.py 78.22% <ø> (+0.44%) ⬆️
tripper/backends/collection.py 85.71% <85.71%> (ø)
tripper/utils.py 86.04% <88.23%> (+8.90%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Contributor

@quaat quaat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean up code, use regexp for parse_object. Try to avoid redefining built-ins

tests/test_utils.py Show resolved Hide resolved
tripper/utils.py Show resolved Hide resolved
@jesper-friis jesper-friis merged commit 3cc3199 into main Dec 3, 2022
@jesper-friis jesper-friis deleted the 41-add-dlite-collection-backend branch December 3, 2022 19:00
jesper-friis added a commit that referenced this pull request Dec 3, 2022
…ing tests.

Reduced code dublication.
Hopefully addressed comments by Thomas in PR #44
jesper-friis added a commit that referenced this pull request Dec 13, 2022
* Improved generality of parse_literal() and parse_object() fixing failing tests.

Reduced code dublication.
Hopefully addressed comments by Thomas in PR #44

* Added __hash__() and __eq__() methods to Literal and fixed some tests.

* Added __hash__() and __eq__() to Namespace as well.

* Added test to infer IRI from pydantic datamodel

* Added a pylint disable because of yet another bug in pylint

* Changed `uri` to `identity` to match soft7 datamodels

* Added comment

* Also handle blank nodes correctly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add DLite collection backend
3 participants