-
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
Append operations on RDF bearing resources #305
Comments
This sounds very useful. How does this relate to the property of POST that the server can always assign name? If I append to foo.ttl, I would want to expect that foo.ttl is where I can retrieve the merged data. |
Yes, this is With |
I have no particular issue or objection to add this. As mentioned before, I wrote the Protocol text in a way that would make POST w/ RDF Merge possible one day. Some comments:
What is exactly gained by introducing POST to append? Supporting append for text/plain is more clear. It can also be done with PATCH in a richer way with URI Fragment Identifiers for the text/plain Media Type: https://datatracker.ietf.org/doc/html/rfc5147 but I do understand the appeal to only append at the end object with POST. Just saying. When POST to append support is constrained, the response should include constrainedBy ( #185 ) and/or problem details ( #28 ). |
An absolutely crucial enhancement of onboarding experience as well as a lower load on the server side. Say that you come to a pod with some data on it, like something that has been set up with your profile, your first question is likely to be "how do I add something to my profile". Now, that can be partially addressed by libraries, but many developers like to understand technology. There's a learning curve to Solid, and part of that learning curve is RDF, and to think in graphs. Many do not manage to cross that threshold. Without Now, I truly enjoyed helping write those 150 pages, so, it should be noted that the same thing can be done with It is therefore a win both on the front-end and on the back-end. We should not only look for the richer ways, we should also make sure simple things are simple. |
I'm however not too sure about defining the semantics of |
Alright, we can drop the definition of |
@kjetilk I think your response to the question is adequate. The point was to have it on record - which wasn't mentioned in the original comment.
Contextomy. What I said was about writing the spec in a way such that the desired feature can be introduced at ease when there is rough consensus in the future. Here we are discussing that possibility. |
That's true. Which brought up another thing in my mind: I don't think neither we nor LDP has ever said explicitly that all representations of an RDF Source MUST describe the same RDF graph, yet that is clearly the case, it would get really messy if it wasn't. For RDF Sources, it is then quite simple, since the append operation is defined in terms of RDF Semantics, not in terms of a particular serialization and so any representation will apply to the RDF graph. For non-RDF sources is harder, since the strong equivalence requirement does not apply to them. What can be done is that you append to the representation with the same media type as in the It wasn't intended to take on the full complexity here, I really only wanted append for RDF Sources, the rest isn't very important. To avoid tackling that, I'll restrict the scope of this issue. |
So, something more like: Append operations to a RDF bearing non-container resourceWhen a If the target resource and the request payload has a RDF bearing representation, then the server MUST use the RDF Merge algorithm to append the request payload into the target resource. This is equivalent but simpler than to |
The Protocol uses RDF document https://www.w3.org/TR/rdf11-concepts/#dfn-rdf-document (in a concrete RDF syntax). |
Append operations on non-container resources are currently not defined in the spec, and it is clear that what it means to append to a resource will depend on the media type of the target resource. There are some media types that have a straightforward interpretation, among them notably RDF sources. I therefore suggest that we have generic language in the spec and that we define append operations for certain media types, in the continuation of #118.
Moreover, that an append operation can be done using
POST
is veryclearly stated in RFC7231:
It has actually been in since the very first description of HTTP:
So, given that simply adding some data is a common requirement, we have an append operation in Solid, a clear description in HTTP and a straigthforward interpretation in RDF, it seems very clear that we should do it.
I therefore suggest that we add something like this to the Protocol:
Append operations to a non-container resource
When a
POST
method request targets a non-container resource with an existing representation, the server MUST interprete that as an Append operation. The behaviour of an append operation depends on the media type. Servers MAY implement append algorithms for any media type. If the request contains a media type that the Server has no append algorithm for, it MUST respond with the415
status code. Servers MUST implement the two following append algorithms:Media types for RDF serializations
If the target resource and the request payload has a RDF bearing representation, then the server MUST use the RDF Merge algorithm to append the request payload into the target resource. This is equivalent but simpler than to
PATCH
the target resource usingINSERT DATA
from SPARQL Update.text/plain
media type.If the target resource and the request payload has the
text/plain
media type, then the server MUST append the request payload to the end of the target resource.The text was updated successfully, but these errors were encountered: