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

fix(api-v1): Optimise link value queries for Fuseki (DSP-1243) #1791

Merged
merged 5 commits into from Jan 22, 2021

Conversation

benjamingeer
Copy link

@benjamingeer benjamingeer commented Jan 21, 2021

This PR improves the performance of the API v1 SPARQL queries that find link values when using Fuseki.

resolves DSP-1243

@benjamingeer benjamingeer self-assigned this Jan 21, 2021
Copy link
Contributor

@SepidehAlassi SepidehAlassi left a comment

Choose a reason for hiding this comment

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

This looks great, I just have one point, please see the comment.

case Some(objectIri) => {

BIND(IRI("@objectIri") AS ?object)
BIND(IRI("@linkValueIri") AS ?linkValue)
Copy link
Contributor

Choose a reason for hiding this comment

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

In line 50 and 72 below, you are using <@linkValueIri> not the ?linkValue, is the bind here really necessary?
I see that ?linkValue is used in Select, so if for that purpose BIND is necessary, why not use ?linkValue in the other statements?

Copy link
Author

Choose a reason for hiding this comment

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

The bind is there only so we can return ?linkValue in SELECT. Using an IRI literal instead of a variable improves performance, so I changed all the variables to literals wherever possible in these queries.

@SepidehAlassi SepidehAlassi self-requested a review January 22, 2021 12:18
Copy link
Contributor

@SepidehAlassi SepidehAlassi left a comment

Choose a reason for hiding this comment

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

Thanks for this optimization!

@benjamingeer
Copy link
Author

Thanks for reviewing!

@benjamingeer benjamingeer merged commit b1e1b9e into main Jan 22, 2021
@benjamingeer benjamingeer deleted the fix/DSP-1243-api-v1-link-query branch January 22, 2021 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants