-
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/deletes #215 #219
Feature/deletes #215 #219
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 great overall! A few questions / little things to address, but good to merge after that.
@@ -899,6 +899,18 @@ | |||
%)))] | |||
(assoc select :spec spec*))) | |||
|
|||
(defn update-delete | |||
"Updates a delete statement variables with final where clause positions of items." | |||
[{:keys [s p o] :as delete} where {group-out-vars :out-vars, :as _group-by}] |
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.
Is group-by
applicable to deleting?
{:select '?name | ||
:where [['?s :schema/name '?name]]}) | ||
["Jane" "Bob"]) | ||
"Only Jane and Cam should be left in the db.") |
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.
s/Jane and Cam/Jane and Bob/
?
{:id :ex/bob, | ||
:rdf/type [:ex/User], | ||
:schema/name "Bob"}) | ||
"Only Jane and Cam should be left in the db.") |
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.
Should this be something like "Bob should no longer have an age."?
This addresses #215 and adds a deletion capability to Fluree which can leverage a query :where clause to define exact data to remove. This is a substantial increase in capability to current Fluree's delete capability which always requires one to know the subject being removed, and anything more complex than simple deletes can require
compare and swap
operations.You can now issue the following as examples (see new tests for full detail)
Delete everything for a subject:
Delete all values for a subject+predicate:
What's completely new however is that you can target other information based on predicates + values:
Delete all subjects that have an email address:
Delete all subjects who are 30 years old: