-
Notifications
You must be signed in to change notification settings - Fork 13
perf(profiles): ⚡️ speed up SPARQL target queries on medium/large crates #191
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
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,9 +26,11 @@ ro-crate:SoftwareSourceCodeTarget a sh:SPARQLTarget ; | |
| sh:select """ | ||
| SELECT ?this | ||
| WHERE { | ||
| { SELECT DISTINCT ?root WHERE { | ||
| ?metadatafile schema:about ?root . | ||
| FILTER(contains(str(?metadatafile), "ro-crate-metadata.json")) | ||
| } } | ||
|
Comment on lines
+29
to
+32
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't see ?metadatafile or ?root referenced elsewhere in this target - is this part necessary? |
||
| ?this a schema:SoftwareSourceCode . | ||
| ?metadatafile schema:about ?root . | ||
| FILTER(contains(str(?metadatafile), "ro-crate-metadata.json")) | ||
| } | ||
| """ . | ||
|
|
||
|
|
@@ -48,9 +50,11 @@ ro-crate:ScriptDefinition a sh:NodeShape, validator:HiddenShape ; | |
| sh:select """ | ||
| SELECT ?this | ||
| WHERE { | ||
| { SELECT DISTINCT ?root WHERE { | ||
| ?metadatafile schema:about ?root . | ||
| FILTER(contains(str(?metadatafile), "ro-crate-metadata.json")) | ||
| } } | ||
|
Comment on lines
+53
to
+56
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as above - I don't see ?metadatafile or ?root referenced elsewhere in this target - is this part necessary? |
||
| ?this a schema:SoftwareSourceCode . | ||
| ?metadatafile schema:about ?root . | ||
| FILTER(contains(str(?metadatafile), "ro-crate-metadata.json")) | ||
| FILTER NOT EXISTS { ?this a bioschemas:ComputationalWorkflow } | ||
| } | ||
| """ | ||
|
|
@@ -78,9 +82,11 @@ ro-crate:WorkflowDefinition a sh:NodeShape, validator:HiddenShape ; | |
| sh:select """ | ||
| SELECT ?this | ||
| WHERE { | ||
| { SELECT DISTINCT ?root WHERE { | ||
| ?metadatafile schema:about ?root . | ||
| FILTER(contains(str(?metadatafile), "ro-crate-metadata.json")) | ||
| } } | ||
|
Comment on lines
+85
to
+88
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as above - I don't see ?metadatafile or ?root referenced elsewhere in this target - is this part necessary? |
||
| ?this a bioschemas:ComputationalWorkflow . | ||
| ?metadatafile schema:about ?root . | ||
| FILTER(contains(str(?metadatafile), "ro-crate-metadata.json")) | ||
| } | ||
| """ | ||
| ] ; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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.
It would be really useful to document this as a recommended pattern for profile developers when they need to fetch the root in a query
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.
Also: the wording of this PR is very jargon-heavy, and I found it difficult to parse until I read the code myself ("Cartesian products in target queries" in particular meant nothing to me). It would help in future if you could describe the solution in simpler language, to make it easier for others to review the code, understand why it works, and (in my case) understand what further changes might be needed downstream.