-
Notifications
You must be signed in to change notification settings - Fork 103
Perform RDF Merge for POST to existing LDP-RS #120
Comments
Do you have a use case? Isnt that covered by PATCH with and INSERT the body. As RDF is a set, the dups would be removed. questions
|
The simple case of just adding a few triples to a resource. Like in
It is covered by the PATCH, but at the cost of writing SPARQL and firing up a SPARQL engine. It seems overkill and bad DevX to require that for just adding a triple. You could have servers that don't wish to support PATCH because of SPARQL, but they could support POST and the RDF Merge algorithm. An example of this is a microcontroller, you can't have SPARQL on 64 kB RAM. :-) Just adding a few triples is the actual thing you would do, tying it to the RDF Merge definition is just for ensuring that it is rigorously defined for the blank node-induced corner cases. :-)
It works if all payloads are RDF, the details need to be worked out if that is not the case, I would think a
Nothing.
Dunno :-) |
Not in solid you cant, it's part of the spec. See https://github.com/solid/solid-spec/blob/master/api-rest.md#alternative-using-sparql-1 Is the proposal to remove this from the spec? |
Yeah, I know, and no, I don't want to remove it. I'm just saying that POST to do RDF Merge is a "90% solution" that would simplify DevX, and could accomodate for those that cannot do a full implementation. |
We dont run a full SPARQL engine, we just strip out the initial INSERT. Maybe that has lead to some confusion. My initial concerns
I think this proposal, probably belongs in LDP next? |
Perhaps it should go in LDP Next, but I think the question, in the interest of DevX, needs to be reversed: What is the use case for using SPARQL, if RDF Merge can do the job? Ah, BTW, found something, there is something about this in the RDF Graph Store. Lots of stuff in SPARQL is defined in terms of RDF merges. To answer my own question, PATCH is used to do actual edits, i.e. both deletes and inserts, and we want to be able to extend what the PATCH method can do, right? But still, I think it is important of how the simplest operations are perceived by devs. |
Delete? We are open to extending patch in future, but right now it's just simple insert and delete (I think!). As long as I can remember POST is up to the implementer to decide what to do with. We only define POST for LDPC's. What about improving the devx be part of an easy to use library? What would it do?
A better route? |
Yeah, I made that edit about delete right there before your comment. Obviously :-) Libraries are fine. We can do it in libraries, I just don't see why you would want the extra complexity for something this simple. INSERT DATA {} is doing an RDF merge behind the scenes, it is just extra complexity. That extra complexity needs to be justified. Obviously it can be justified, I just don't see why you should have everyone deal with the extra complexity. |
I've added the tag enhancement to this. Because it's not really an issue in the spec, it's a feature request. So, I think the next step is to turn this into a proposal. What strikes me is that the proposal covers half or PATCH (insert and not delete) and is inferior due to lack of extensibility. All solid servers can do this already, and this is not wanted outside of solid servers. So no new functionality. It seems the main justification is some syntactic sugar around There doesnt seem to be a use case behind it, right now, so I'm not optimistic for this propsoal's chances. Interesting food for thought, tho! |
No, no, it is the reverse! Simple things should be easy, that should be the main guiding principle. Devs are familiar with the idea that POST adds stuff, PUT replaces it, DELETE deletes it. That intuition should take them 78% of the way. At least :-) Then, they could move to the next level, where editing requires rudimentary understanding of SPARQL. Some devs my become scared at that point, and not be willing to go there, but those that do might be motivated if they had already been able to do stuff with simple HTTP operations. |
One may add, the stuff between the |
Got it! It's certainly interesting. Some Meta Comments So, we need a process to manage such proposals, and I suggest we chat about that out of band. Typically with early specs, you can change them, but as solid is maturing now, we need to be more cautious, and create more of a process. Fast track changes such as typos or the wrong path. Proposals with wider implications, such as changing the sense of an HTTP verb (like this one). With some gray areas in between. I think we can loosely base it on W3C / IETF work flows such as raising issues, and then then ensuring commenters are satisfied. I find the following doc great guidance in this respect, in case you may not have seen it https://tools.ietf.org/html/rfc7282 ends meta |
One concern I would have about this is that, with this proposal, What about LDPatch? This is a much lighter-weight "update" mechanism than SPARQL-Update, and it can be used with |
Right. Then, I suppose you are right, this is not something that is easily doable with LDP. But you know, you gave me a good argument to say that my hypermedia-approach to this problem is better, because it tells the client what it can do as a part of the metadata of the resource. Now, Tim didn't like the idea of mixing in metadata, and I can see that point, but it reinforces my skepticism towards LDP, it requires too much up-front, unintuitive, out-of-band knowledge. Anyway, now we have LDP as the foundation, and we need to see where it takes us for now. So, just leave it here as a proposal. |
I do like the simplicity, but I don't like that you can't use it to delete/update triples, you can only append. And I think we have enough different PATCH syntaxes as it is, let's not add an extra one? Can this issue be closed? |
Not sure I feel about it... I think it is such an obvious way to do stuff that we should have that append with RDF-Merge semantics, everything beyond that could confuse people. However, since it can't be a part of LDP as it stands now, perhaps it does not belong in solid-spec at all, but in LDP Next. Perhaps just keep it open until we see if LDP Next will actually happen? |
It appears to be inconsistent only because the semantics of LDP suggests to use What I take away from LDP off-the-shelf is that
|
OK, thanks @csarven ! My starting point has always been what I perceive as a strong developer intuition, which is backed by RFC2616 and RFC7231 alike, that POST can be thought of as an append operation. Back before my Ph.d., which is a while, that seemed to be how we used it. It is good to see that this can be reconciled with LDP. :-) I might have become out of touch with developer communities, and it might be that the HTTP verbs are not that important given libraries anymore, but if possible, I think this belongs in the interaction model. |
If It seems simpler to me to rely on I don't quite follow what you mean by belonging in the interaction model - do you mean to have a new model? Is there a loss of signal somewhere with |
OK, perhaps the mention of interaction model was not appropriate, but as for the comment to
the point is really that With I think that we shouldn't make people look up the spec for something like this, it is poor DevX. If we don't need to be Solid-specific, we shouldn't be. But I could be entirely wrong about it, I just don't think we should be risking it. |
I acknowledge your core point and generally agree I would just add not looking things up is one way of going at it. Of course the other is to check the spec, the companion primer, tutorials etc to get acquainted. Intending to do RDF merge via |
The way I have previously implemented a POST operation on an existing LDP RDF Source is to perform an RDF Merge between the existing resource and the payload body.
I could have bet I read that in a spec at some point, but I can't find it, and it doesn't seem to be implemented? Intuitively, I think it makes sense, and is a very simple operation.
The text was updated successfully, but these errors were encountered: