Feature: Save and restore full SPARQL queries via API#860
Draft
dennisvang wants to merge 31 commits intosupport/1.19.xfrom
Draft
Feature: Save and restore full SPARQL queries via API#860dennisvang wants to merge 31 commits intosupport/1.19.xfrom
dennisvang wants to merge 31 commits intosupport/1.19.xfrom
Conversation
8 tasks
573acad to
66cc0e2
Compare
the ability to save/load full sparql queries is a new feature
to improve encapsulation and readability
because we're just going to add a field to SearchSavedQuery instead This reverts commit 76ed8e6.
the enum is now part of SearchSavedQuery
using string array fields defaultGraphUris and namedGraphUris we can specify multiple graphs in a natural way
…earchQueryVariablesDTO we're not renaming the entity field "variabes", so data migration is not needed
for consistency with SparqlQueryRestricted
…riablesDTO for consistency actually this is a 1-1 mapping, so it is redundant, but I'm following the approach of the existing code (which is to be the hobgoblin from PEP 8...)
…omposeQuery() and remove unnecessary newlines (FRAGMENT_SUFFIX)
because it is a better fit with the existing variables field names and makes more sense semantically
…hSavedQueryDTO and adapt references and usages
to distinguish from SparqlQueryFullChangeDTO to be added later
…lQueryVariablesChangeDTO and adapt references
2f34c6b to
926e80b
Compare
…QueryController this way the DTO mapping is done at the boundary, where is makes most sense to me also the SearchSavedQueryService.create method now only knows about domain objects this is an intentional break in consistency with the existing codebase
…thod instead of SearchSavedQueryMapper again an intentional break in consistency with the existing code base, because I think this makes more sense
and adapt existing mapper and controlled methods accordingly
Contributor
Author
|
WIP: Now we can save a full sparql query, but not all HTTP methods are supported yet. I'm also not happy with the fact that we need to duplicate a lot of code. Perhaps just step back to a single changeDTO with optional fields for |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds save/load support for the full SPARQL queries introduced in v1.19.0.
Rationale
The existing FDP implementation (<=v1.19.0) offers support for saving/loading restricted SPARQL queries by storing
SearchSavedQueryobjects in the relational database:FAIRDataPoint/src/main/java/org/fairdatateam/fairdatapoint/entity/search/SearchSavedQuery.java
Line 58 in 2c893e9
This contains the restricted query in terms of user input, i.e. the values entered by the user:
FAIRDataPoint/src/main/java/org/fairdatapoint/api/dto/search/SearchQueryVariablesDTO.java
Lines 33 to 43 in c8d15b3
These values are used to render the query template:
FAIRDataPoint/src/main/resources/org/fairdatapoint/service/search/queryTemplate.sparql
Lines 1 to 15 in c8d15b3
This PR adds the ability to save/load full SPARQL queries that are not restricted to this template.
TODO:
follow up on #853