Repository navigation
Closed
Labels
Description
@justinwb informed me that projects he's building rely on adding extra triples to the container state.
This works with PUT:
curl -X PUT http://localhost:3000/ -H "Content-Type: text/turtle" --data '
<http://example/book1> <http://example/book1> <http://example/book1>.
'
However, currently this fails with PATCH:
curl -X PATCH http://localhost:3000/ -H "Content-Type: application/sparql-update" --data '
INSERT DATA
{
<http://example/book1> <http://example/book1> <http://example/book1>.
}
'with
# ConflictHttpError
## Technical details
Container bodies are not allowed to have containment triples.This seems to be because in
the full representation is processed, not just the delta.
As a resolution, I would have proposed that we filter disallowed triples from the client body (or patch) rather than rejecting.
However, the spec mandates a 409.
We might need to install a patch body parser for containers that makes these checks.
(Or just add that functionality to the existing parser, but perhaps that is less extensible.)
Reacted by Justin Bingham
Activity
jvherweg commentedon Aug 17, 2021
Note that we have a related issue in #384 that was paused, where some related solutions were discussed.
jvherweg commentedon Aug 17, 2021
Now that we put generated metadata in a separate graph, one other potential solution is having a patcher that knows that for containers it should run on the metadata object and then re-create the container body to only contain the non-generated triples and PUT that back to the store.
RubenVerborgh commentedon Aug 17, 2021
Makes sense.
Alternatively, we could see this as part of a (future) validation workflow (#87) where we check if the patch maintains a valid state and/or whether a
PUTsends a valid state.jvherweg commentedon Sep 23, 2021
Added in #955