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

Allowing backends to indicate whether they prefer the sparql interface #255

Merged
merged 9 commits into from
Oct 15, 2024

Conversation

jesper-friis
Copy link
Contributor

Description

Allow backends to add a class attribute prefer_sparql attribute, indicating whether they prefer calls to the SPARQL query() method instead of the triples() method.

Added the Triplestore.prefer_sparql property for easy access to this attribute.

Also renamed TriplestoreError to TripperError and some additional cleanup of warnings.

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?

…they prefer the sparql query() or triples() interface
Copy link

codecov bot commented Oct 13, 2024

Codecov Report

Attention: Patch coverage is 88.88889% with 2 lines in your changes missing coverage. Please review.

Project coverage is 79.21%. Comparing base (455cd08) to head (bc1a59d).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
tripper/triplestore.py 50.00% 1 Missing ⚠️
tripper/tripper.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #255      +/-   ##
==========================================
+ Coverage   79.11%   79.21%   +0.09%     
==========================================
  Files          18       18              
  Lines        1719     1727       +8     
==========================================
+ Hits         1360     1368       +8     
  Misses        359      359              

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

tripper/triplestore.py 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.

Do we have any documentation anywhere on what is needed to create a new backend? If so we should add there that the prefer_sparql attribute should be set. If not, we should have an issue on making such a template/documentation.

Furthermore, have you tested this with PyBackTrip? I guess this is not backwards compatible?

Co-authored-by: Francesca L. Bleken <48128015+francescalb@users.noreply.github.com>
@jesper-friis
Copy link
Contributor Author

jesper-friis commented Oct 15, 2024

Do we have any documentation anywhere on what is needed to create a new backend? If so we should add there that the prefer_sparql attribute should be set. If not, we should have an issue on making such a template/documentation.

Furthermore, have you tested this with PyBackTrip? I guess this is not backwards compatible?

The best documentation is the interface.py file. I have already added the prefer_sparql atteibute to that file.
The interface.py file is not used for anything else apart from documentation.

@francescalb
Copy link
Contributor

Do we have any documentation anywhere on what is needed to create a new backend? If so we should add there that the prefer_sparql attribute should be set. If not, we should have an issue on making such a template/documentation.
Furthermore, have you tested this with PyBackTrip? I guess this is not backwards compatible?

The best documentation is the interface.py file. I have already added the prefer_sparql atteibute to that file. The interface.py file is not used for anything else apart from documentation.

Great, then I think it would be very good to add a sentence about looking into this file if one wants to make a new backend. (In the documentation for developers part). It is enough with one sentence for now

@jesper-friis
Copy link
Contributor Author

Do we have any documentation anywhere on what is needed to create a new backend? If so we should add there that the prefer_sparql attribute should be set. If not, we should have an issue on making such a template/documentation.
Furthermore, have you tested this with PyBackTrip? I guess this is not backwards compatible?

The best documentation is the interface.py file. I have already added the prefer_sparql atteibute to that file. The interface.py file is not used for anything else apart from documentation.

Great, then I think it would be very good to add a sentence about looking into this file if one wants to make a new backend. (In the documentation for developers part). It is enough with one sentence for now

done

@jesper-friis jesper-friis merged commit d45e9e6 into master Oct 15, 2024
19 checks passed
@jesper-friis jesper-friis deleted the prefer_sparql branch October 15, 2024 13:16
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants