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

Get restrictions as dicts #225

Merged
merged 9 commits into from
Jun 24, 2024
Merged

Get restrictions as dicts #225

merged 9 commits into from
Jun 24, 2024

Conversation

jesper-friis
Copy link
Contributor

@jesper-friis jesper-friis commented Jun 21, 2024

Description

Added a return_dicts keyword argument to the Triplestore.retrictions() method, to allow to get the restrictions as dicts instead of blank nodes.

Other changes:

  • Also renamed the target argument of Triplestore.add_retriction() and Triplestore.retrictions() to value in order to be consistent with the naming in EMMOntoPy. These two methods are a very new addition to tripper that haven't been used yet. This change that this change will break existing code is therefore very small.
  • Added tests.
  • Added documentation in the tutorial.

Question
Should we change the default of return_dicts to be true? If so, this is the right time to do it, before people starts to use these methods.

Type of change

  • Bug fix and code cleanup
  • New feature
  • Documentation update
  • Testing

Checklist for the reviewer

This checklist should be used as a help for the reviewer.

  • Is the change limited to one issue?
  • Does this PR close the issue?
  • Is the code easy to read and understand?
  • Do all new feature have an accompanying new test?
  • Has the documentation been updated as necessary?
  • Is the code properly tested?

Copy link

codecov bot commented Jun 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.41%. Comparing base (f7488f5) to head (d0a205e).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #225      +/-   ##
==========================================
+ Coverage   78.34%   78.41%   +0.07%     
==========================================
  Files          18       18              
  Lines        1690     1696       +6     
==========================================
+ Hits         1324     1330       +6     
  Misses        366      366              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jesper-friis jesper-friis changed the title Added convenient get_restriction_dict() function to get a restriction as a dict WIP: Added convenient get_restriction_dict() function to get a restriction as a dict Jun 22, 2024
@jesper-friis jesper-friis changed the title WIP: Added convenient get_restriction_dict() function to get a restriction as a dict Added convenient get_restriction_dict() function to get a restriction as a dict Jun 22, 2024
@jesper-friis jesper-friis changed the title Added convenient get_restriction_dict() function to get a restriction as a dict Get restrictions as dicts Jun 22, 2024
docs/tutorial.md Outdated Show resolved Hide resolved
docs/tutorial.md Outdated Show resolved Hide resolved
docs/tutorial.md Outdated Show resolved Hide resolved
docs/tutorial.md Outdated Show resolved Hide resolved
docs/tutorial.md Outdated Show resolved Hide resolved
Copy link
Contributor

@francescalb francescalb left a comment

Choose a reason for hiding this comment

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

Some suggested changes to the tutorial, but only wording. It looks very good!

I think we should change to return_dicts = True as default as also changing target to value is a breaking change. We just have to state very clearly in the release that this is done, and that thisis a breaking change on a a feature that was added in the previous realease.

jesper-friis and others added 2 commits June 24, 2024 09:47
Co-authored-by: Francesca L. Bleken <48128015+francescalb@users.noreply.github.com>
@francescalb francescalb self-requested a review June 24, 2024 08:26
Copy link
Contributor

@francescalb francescalb left a comment

Choose a reason for hiding this comment

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

Very nice.

@jesper-friis jesper-friis merged commit 20bc142 into master Jun 24, 2024
19 checks passed
@jesper-friis jesper-friis deleted the restriction-dict branch June 24, 2024 08:39
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.

2 participants