-
Notifications
You must be signed in to change notification settings - Fork 2
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 argument ignore_unrecognised
to tripper.convert()
#247
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #247 +/- ##
==========================================
+ Coverage 78.35% 78.40% +0.05%
==========================================
Files 18 18
Lines 1723 1723
==========================================
+ Hits 1350 1351 +1
+ Misses 373 372 -1 ☔ View full report in Codecov by Sentry. |
I have trouble seeing how to use this function prperly. Could you add some examples? |
An example use case: from tripper import DCTERMS, Literal, Triplestore
from tripper.convert import load_container, save_container
ts = Triplestore("rdflib")
dataset = {"a": 1, "b": 2}
save_container(ts, dataset, ":data_indv")
# Add additional context to our data individual
ts.add((":data_indv", DCTERMS.title, Literal("My wonderful data")))
data = load_container(ts, ":data_indv") # <-- this will raise an exception complaining about DCTERMS.title is not a recognised key
data = load_container(ts, ":data_indv", ignore_unrecognised=True) # <-- this will works (ignores ECTERMS.title) |
The example is now added to module docstring. It is checked by doctest. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very nice.
Description
Added argument
ignore_unrecognised
to tripper.convert().Question: One could consider to set
ignore_unrecognised=True
by default. It will be a small change in behavior, but more user friendly. I think that would be wise change.Type of change
Checklist for the reviewer
This checklist should be used as a help for the reviewer.