You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Will this always be a SPARQL update query or do we support multiple input formats? I would guess the second since the architecture specifies multiple types of patches, but what exactly are a LineBasedPatch, BinaryPatch, ImageFilter, etc. then?
And who is supposed to execute those patches then? The architecture defines a PatchOperationHandler, and modifyResource, a function of a ResourceStore which takes a Patch as input. Does that mean the handler just passes the Patch along to the resource store?
If there are all these different kinds of Patches, how would the necessary permissions get extracted then? A PermissionsExtractor for every type of Patch that can only handle that specific type?
Will this always be a SPARQL update query or do we support multiple input formats?
In principle, multiple.
That said, we should be careful that clients do not start relying on patch formats that are not mandated by the spec.
So we will implement SPARQL UPDATE, but in such a way that:
we can implement multiple patch formats
stores are able to provide optimized implementations of it
And who is supposed to execute those patches then?
I'll quote from the architecture document here (but happy to elaborate):
A ResourceStoremight have knowledge on how to apply certain types of patches itself. For instance, file-based stores might have built-in support for LineBasedPatch, and SPARQL endpoints or in-memory RDF stores likely have built-in support for GraphPatternPatch.
There is case to be made for a Patcher interface for objects that can apply all patches of a certain type to certain representations. For instance, a GraphPatternPatch could be applied to RDF graphs serialized as documents, by a GraphPatternPatcher that operates independently of any specific store.
So what I envisage is the following:
SparqlEndpointStore happily accepts a (parsed or unparsed) SPARQL UPDATE query to modifyResource (note that parsing is still required for permission checking in any case), and passes that text string as-is to the backend.
FileBasedStore does not implement modifyResource at all.
Using the decorator pattern, PatchingStore implements modifyResource by:
first trying the patch on its underlying store via modifyResource
in case of failure, going through its internal list of Patchers implementing the handler pattern, checking of any of them supports the Patch.
If found, call getRepresentation on the underlying store, patch the representation with the patcher, then and setRepresentation on the underlying store (which should be locked)
if not found, fail
If there are all these different kinds of Patches, how would the necessary permissions get extracted then? A PermissionsExtractor for every type of Patch that can only handle that specific type?
Is the plan to (eventually) fully support all SPARQL update queries? Because then we will definitely need a SPARQL engine seeing as the WHERE bodies can be full SPARQL queries.
Regarding that, how should graphs be handled then? This is under the assumption that graphs are used to indicate different containers/paths. Should update queries with with WITH/USING/GRAPH/etc. queries be allowed, and how should those be interpreted?
We don't yet have consensus on level of SPARQL Update support: solid/specification#125 . Related: solid/specification#139 . It is also unclear the level of support that existing implementations (servers and clients) have. In context of PATCH, I'd be in favour of requiring something minimal/simpler along the lines of what @kjetilk suggested "DELETE/INSERT/WHERE can be dropped in favour of DELETE DATA ; INSERT DATA" in solid/specification#125 (comment) . Implementations can always do more. If you'd like to provide input to the spec, that'd be very helpful.
Activity
RubenVerborgh commentedon Jul 8, 2020
In principle, multiple.
That said, we should be careful that clients do not start relying on patch formats that are not mandated by the spec.
So we will implement SPARQL UPDATE, but in such a way that:
I'll quote from the architecture document here (but happy to elaborate):
So what I envisage is the following:
SparqlEndpointStorehappily accepts a (parsed or unparsed) SPARQL UPDATE query tomodifyResource(note that parsing is still required for permission checking in any case), and passes that text string as-is to the backend.FileBasedStoredoes not implementmodifyResourceat all.PatchingStoreimplementsmodifyResourceby:modifyResourcePatchers implementing the handler pattern, checking of any of them supports thePatch.getRepresentationon the underlying store, patch the representation with the patcher, then andsetRepresentationon the underlying store (which should be locked)Exactly (handler pattern again).
jvherweg commentedon Jul 14, 2020
Is the plan to (eventually) fully support all SPARQL update queries? Because then we will definitely need a SPARQL engine seeing as the WHERE bodies can be full SPARQL queries.
Regarding that, how should graphs be handled then? This is under the assumption that graphs are used to indicate different containers/paths. Should update queries with with WITH/USING/GRAPH/etc. queries be allowed, and how should those be interpreted?
rubensworks commentedon Jul 14, 2020
We could consider combining this effort with comunica/comunica#435.
Different graph semantics should then be pluggable: comunica/comunica#198
RubenVerborgh commentedon Jul 14, 2020
Woah, I don't think we were realizing this. @csarven, @acoburn, what do you think?
Also worrying about denial of service here.
SPARQL engine indeed though.
csarven commentedon Aug 4, 2020
We don't yet have consensus on level of SPARQL Update support: solid/specification#125 . Related: solid/specification#139 . It is also unclear the level of support that existing implementations (servers and clients) have. In context of PATCH, I'd be in favour of requiring something minimal/simpler along the lines of what @kjetilk suggested "DELETE/INSERT/WHERE can be dropped in favour of DELETE DATA ; INSERT DATA" in solid/specification#125 (comment) . Implementations can always do more. If you'd like to provide input to the spec, that'd be very helpful.
Merge pull request #15 from thdossch/changes