-
Notifications
You must be signed in to change notification settings - Fork 22
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
Feature/update #456
Feature/update #456
Conversation
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.
Looks good, here's my understanding of how this works (please feel free to correct any misunderstandings):
Now instead of a "delete" transaction we now have a "modify" transaction, which is defined as a map with a "where" clause and either a "delete" or "insert" select-like statement.
These work by initiating a search with the "where" clause, and then transforming that stream of flakes into some additional assert and retract flakes, according to the "insert" "delete" track.
And this builds on a prior design decision where we're explicitly using "delete" as a keyword instead of "retract" because that's what new users are going to search for when trying to figure out how to change the data.
While true, the reason has more to retain compatibility with SPARQL update. We'd like to stay consistent wherever possible, and stray only if necessary. |
I would rather call this an operation instead of transaction. This describes a way to generate a transaction, or at least the flakes that will go in a transaction, but there's more to it given the where clause. It's more like the combination of a query and transaction performed atomically.
The where search returns a channel that contains solutions, not flakes. A solution is a map who's keys are variable symbols, and the values are matches, which themselves are maps which contain entries for the variable name, the matched value (usually found from a flake) and the data type. These solutions represent some set of flakes from the db that meet all the constraints in the where clause. The update operations take the stream of solutions and build new flakes out of the matched variables found in each solution as well as the values found in the triples within the |
This patch adds a dedicated update query execution namespace with the previous functionality to process delete statements and the additional functionality to process multiple delete statements at once, and also to process one or more "insert" statements in parallel with delete statements which use the same where clause.
Closes https://github.com/fluree/core/issues/11