-
Notifications
You must be signed in to change notification settings - Fork 47
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
Implications of semaphore mechanism for SPARQL Update #322
Comments
https://www.w3.org/TR/sparql11-update/#updateLanguage
My interpretation is that given requested DELETE/INSERT operation, and DELETE fails, then the rest (INSERT) should be ignored. I don't see INSERT failing (feasible?) or preceding DELETE. |
That's actually a different thing. A DELETE WHERE { ?foo a <Bar> } ;
INSERT { ?foo a <Baz> } WHERE { ?foo a <Bar> } are two operations in a single request, whereas DELETE { ?foo a <Bar> }
INSERT { ?foo a <Baz> } WHERE { ?foo a <Bar> } is a single operation. I asked in #125 (comment) whether we should support several operations in one request, and @RubenVerborgh 's response was "not yet". Indeed, it is possible to design something around this, but the key problem in our case is that the result of a |
Right, I suspected as much for the |
So, one possibility is that we do not allow full SPARQL for 0.9... We only allow the constrained subset and with that mechanism... I don't like that option myself, but what do others think? |
hmmm, yeah, but actually, perhaps we should have a content type for it... With something that incompatible with |
I might also add that exactly that kind of query DELETE DATA {
<https://ruben2021.solidcommunity.net/profile/card#me> <http://www.w3.org/2006/vcard/ns#fn> "Kjetil" .
}
; INSERT DATA { <https://ruben2021.solidcommunity.net/profile/card#me> <http://www.w3.org/2006/vcard/ns#fn> "Ruben" .
} was the reason I originally proposed to have just |
I think it should be straightforward to follow the SPARQL Update spec here (for
|
I have now made an alternative PR in #330, where I try out what @timbl has been voicing, i.e. I don't quite feel that we have exhaustively answered the question: "When using the semaphore mechanism, would the triples that you want to change be known before the I bet there are desirable cases where that's not quite true, but then, are they significant enough? My feeling around this is: The case for The case for What I really struggle with is the idea that there should be a failure when the query has multiple solutions. Like, yes, it might be something wrong, but it also might not be, it might be very legitimate reasons why there are multiple solutions. And if there really is a problem, this conflict resolution mechanism would be the wrong way to do that, as there are many other reasons why that might have been introduced than an edit conflict. That would be more in the realms of shape validation and so on. It also departs very much from my understanding of what SPARQL is. I have nevertheless included that language in #330 , but I'd rather leave it out. |
While writing up a text around the semaphore mechanism from the RWW Design Issue, also discussed in #125 , solid/solid-spec#193 , solid-contrib/query-panel#3 and others, I found that I have not yet fully understood the problem.
Is it also the idea that the same mechanism can be used in a situation where there isn't actual concurrency? I could see a case for that, say that one client
GET
s a certain resource, looks at it, and then wants to change something using aPATCH
but meanwhile another client has changed the same? This is more the archetypal case for conditional requests, so I didn't think of it as a valid situation for the semaphore mechanism, but I guess a case for that this is actually a simpler mechanism could be made, as maintaining validators are more work for servers, and since it is a validator for the entire document, it scales badly if many people are co-editing a large document.This issue has usually been discussed in terms of atomicity, including rdflib's documentation. I have not quite managed to understand that angle in light of the SPARQL Update spec, which says:
In our case, it means that if the
WHERE
clause doesn't match anything, the variable will be unbound and so nothing will be deleted. In other words, it sounds like we have standard behavior from the query language.However, it is true that no error is raised by standard SPARQL, as a measure to not leak information. Thus, we must expect that standard SPARQL implementations will need possibly substantial modifications to accommodate for this case now.
To accommodate for this situation on the Solid protocol, I wonder if it would suffice to say something like
"If any solution produces a triple containing an unbound variable or an illegal RDF construct, then the server MUST abort any modifications and respond with a
409
status code."That seems like a relatively minor change compared to standard SPARQL. This wouldn't be a violation of the language, AFAICS, it is a protocol thing.
I have only seen the semaphore mechanism mention in connection to the
DELETE INSERT WHERE
case, does that mean we only have to consider it in that context?In the case where there is a pure delete operation, you don't actually care if someone has deleted the data before you, it is gone, and then all is fine, right?
It seems to me like the
DELETE DATA
/INSERT DATA
case is a bigger problem than theDELETE INSERT WHERE
case, because in SPARQL, they are considered separate operations, even if executed in a single HTTP request. This would lead to that bothINSERT DATA
s are committed, isolation or not.The easy way out of that is that developers should always use
DELETE INSERT WHERE
if they need semaphore behavior. That would, as far as I can see, be compatible with NSS.The alternative is to say that if
DELETE DATA
deletes nothing, then the server must return409
, which is an actual spec violation. It may not be very different practically, I suppose, but still a spec violation.The text was updated successfully, but these errors were encountered: