Skip to content

How does PATCH work #15

Closed
Closed

Description

@jvherweg

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?

Activity

  1. added
    ❓question
    on Jul 8, 2020
  2. RubenVerborgh commented on Jul 8, 2020

    @RubenVerborgh
    Member

    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:

    1. we can implement multiple patch formats
    2. 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 ResourceStore might 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:
      1. first trying the patch on its underlying store via modifyResource
      2. in case of failure, going through its internal list of Patchers implementing the handler pattern, checking of any of them supports the Patch.
      3. 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)
      4. 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?

    Exactly (handler pattern again).

  3. removed their assignment
    on Jul 8, 2020
  4. jvherweg commented on Jul 14, 2020

    @jvherweg
    MemberAuthor

    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?

  5. rubensworks commented on Jul 14, 2020

    @rubensworks
    Contributor

    We could consider combining this effort with comunica/comunica#435.

    Different graph semantics should then be pluggable: comunica/comunica#198

  6. RubenVerborgh commented on Jul 14, 2020

    @RubenVerborgh
    Member

    the WHERE bodies can be full SPARQL queries

    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.

  7. csarven commented on Aug 4, 2020

    @csarven

    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.

  8. added a commit that references this issue on Sep 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ❓question

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions