kopflos icon indicating copy to clipboard operation
kopflos copied to clipboard

Handlers to update and create resources with PUT

Open tpluscode opened this issue 1 year ago • 0 comments

We need some built-in ways to support updating resources. We should consider how updating a resource complement that resource's GET handler.

UC 1: PUT to update existing resource using kl:OwnGraphLoader

kl:OwnGraphLoader is the default, which should make it easy to handle updates. There is exactly one graph for a resource and a reusable handler would just replace its contents with the request payload.

UC 2: PUT to update existing resource using other loader

It could be kl:DescribeLoader but also any other, where the resource can be spread across multiple graphs. There can also be two possible variants to this scenario:

  • multiple graphs for a single resource, for example partitioned by predicates or with some predicates ignored from payload
  • some graphs shared between multiple resource: TBD

UC 3: PUT to create a new resource

Given a PUT request to a resource which does not exist we can allow it to be created if:

  1. we can find exactly one Resource Shape
  2. that resource shape explicitly allows resources to be PUT (for example using a new term kl:createWithPUT true
  3. loader is kopflos:OwnGraphLoader or it clearly defines how the triples are stored

tpluscode avatar Nov 05 '24 12:11 tpluscode