-
Notifications
You must be signed in to change notification settings - Fork 44
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
Are URI semantics just necessary or sufficient to determine containment relation? #505
Comments
I agree that this is a common practice in implementations and applies to different kinds of auxiliary resources In #538 I proposed a non-normative note to clarify that it's necessary but not sufficient. I think this will be discussed during the next CG meeting. We could also consider adding it as a normative requirement. In lines of: Clients MUST determine containment based on /cc @csarven @woutermont |
While it seems to be common practice, this violates the strict letter of the current spec, which imposes a 1-1 correspondence between slashes and containment (ref). Given the confusion this keeps causing, it is definitely a good idea to schedule this for another discussion in the CG meeting. EDIT: added ref |
My two cents on which direction this could/should go: The decision to deviate* from basic Web conventions on generic URI slash semantics and instead have a 1-1 correspondence between path hierarchy and container hierarchy was made a long time ago, for better or worse, to have some unix file-system familiarity in Solid URIs, affording the (i.m.o. minor) practicality of infering containment hierarchy from path hierarchy (for relative reference and offline parent discovery). While I would normally be the first to try and revert that decision, I have learned that sometimes it is best to leave settled things be settled. Unless we want to do the whole discussion over, we therefore have to live with the (i.m.o. major) downside: we MAY NOT use URIs with a path component for non-hierarchical resources. All non-hierarchical resources must therefore have an URI consisting of the root of the Solid server and at most one (opaque) path segment (optionally followed by query and fragment components, of course); in @timbl's words: "You can build a flat non hierarchical system in solid - just don't use the slash/." In practice, this means, for example, that if we want to treat auxiliary resources as Solid resources, these will either have to follow the slash semantics rule, or have an identifier as described above. Again, I think that, for now, it may be best to leave this decision as it is, and bring practice in line with it. Non-hierarchical URI's (max 1 path segment) are a viable, if somewhat convoluted, way to cope with the restriction:
* The belief that the URI generic syntax spec itself informs such a correspondence, on which the original decision for the 1-1 correspondence is based (ref), is wrong. The URI spec only states that "[t]he path component contains data, usually organized in hierarchical form," and that "[u]se of the slash character to indicate hierarchy is only required when a URI will be used as the context for relative references" (my bold). In other words, as far as the generic syntax is concerned, URIs can perfectly contain a path that is not hierarchical, and thus consumers of them should not assume so. |
I think I align with you here, @woutermont . Indeed, the aux resources and their consequences for containment hierarchy has not been done sufficiently clear, and we should have addressed that sooner. However, I'll also note that
one thing is the wording that went into the spec, another thing are the assumptions that was done with early Web architects, that wasn't written in MUSTs. The 1-1 correspondence was based on a the URI syntax, which was again informed by earlier hierarchical systems, but it was kept more flexible when it went into the specs. |
Thank you for adding that nuanced background, @kjetilk! As action following on todays CG meeting, I hereby do a call specifically for Use Cases concerning the hierarchical nature of Solid Resource URIs:
I've added the Use Cases I've encountered up till now. I'll try to keep this list updated as people comment. EDIT: Added use cases provided by @elf-pavlik. |
OK, that sounds more like a full reopening of the issue. I wasn't quite thinking that would be worthwhile at this point, but if the CG wants that, OK. I think it makes sense to accept the slash semantics at this point, but to explore the many important edge cases, like aux resources, the compound resource state (like having a HTML representation of it, should it be writeable by the client, etc), resource naming constraints in general (#368 , which I think would be very helpful in resolving the problem in this issue too). I have reduced my engagement in Solid for the time being, but that would be my advice, but the CG is certainly free from my perspective to think otherwise. |
Like I have already indicated in an earlier comment, that would also be my preference at this point, but only under the condition that we have it for all resources (including auxiliaries). In any case, we will end up with a better overview of the real pro's and con's. |
When we want the ability to move the resource in the hierarchy without changing its URL
There is a broader case besides auxiliary resources. For example |
Thanks for the valuable additions, @elf-pavlik! Could you elaborate on the following?
What would 'moving a resource' entail? On a semantic level, resources can't move (they can be copied to another URL though). On the level of implementation, some storage backends might have a notion of 'movement' (e.g. a file system), but the hierarchy of those backends is not necessarily coupled to the (LDP) hierarchy of resources with which the 1-1 correspondence with URLs is concerned.
Would it be semantically incorrect to say that a Solid storage contains it's Well-Known resources? For example a storage
|
I don't think it is incorrect, I think Solid Protocol shouldn't force
Moving a resource from one container to another. If containment is only tracked in the description one could easily go
With hierarchical paths, once one organizes |
Great points! Thanks for clarifying 👍 |
@elf-pavlik, I want to come back on those two last points you made.
I don't agree that the 1-1 correspondence forces that: we can still decide to host the Solid server on a non-empty path of the domain, e.g.
I wonder how you would go about doing that even without the 1-1 correspondence...
|
Given the long history of this decision, the clear advantages, and few disadvantages, I believe we should really move this forward and close the issue, possibly creating new issues regarding the few issues we listed. |
I think we should at least address the specific case of auxiliary resources. Currently, some implementations just add
I think POSTing to the container should be possible if the storage uses a flat IRI template When it comes to PUTing new resources, the resource would not be PUT to the container but to the Storage, again it could advertise an IRI template like
I would like to evaluate
Thinking further I think we should look at solid/data-interoperability-panel#174 and evaluate LDP Direct Containers and Indirect Containers to see if they can be used or adapted for SAI inherited access. Noting the similarity of I agree that the broader discussion about URI semantics being necessary is better to be addressed outside of this issue. For this issue, we probably should assume it is necessary and only address the question of it being sufficient. |
Indeed. I agree The question is not about imposing that constrain on periphary. But about The case is not limited to current practice of aux uris in CSS and NSS. But also any other. For example, one of the uri has no corresponding resource existing at all. Then there is obviously no containment relation with non existing resource. So we cannot deduce such thing as mentioned in OP. For to authoritatively deduce containment relation between
Those all of above rules must be satisfied, along with added uri-semantics constrain. uri slash semantics are just a constrain to uphold. |
👀 looking that up ...
Fully agree, the current practice is the most painful contrast with the correspondence our forward by the protocol. As I commented earlier, I believe having Well-Known paths for auxiliary resources is the way to go. I really think it is a minor loss of current practice, compared to not following the URI generic syntax, and losing the intuitive, offline processable, unix-like hierarchical notion of paths. Moreover, going with separately contained auxiliary resources means only changing a little server code to actually conform with a long-standing piece of the protocol; letting go of the sufficiency means changing all existing client code that relies on that long-standing piece of the protocol.
Yes, but they are a constraint held up by practically the entire web. |
@woutermont , I think you are missing the point. No where in spec says it's sufficient. For they For, say two uris are given to you, |
Could you please provide a few examples of what exactly implementations would have to change? |
@damooo, I did not misunderstand. As I pointed out in my very first comment, the Solid protocol does state that "[t]here is a 1-1 correspondence between containment triples and relative reference within the path name hierarchy." |
That expresses
By just seeing two uris one cannot deduce any semantic relation, for one cannot be sure if they exist at all, or if any of them advertise their conformance to a protocol, etc. |
Also plz note that, it talks as |
I'm sorry, but that is simply not correct. Any logician will be able to tell you. A 1-1 correspondence is both a necessary and a sufficient relation, meaning
Of course not, I agree: if a resource does not exist, the deduction would be incorrect. But applications don't get URIs from nothing: they start at a resource they know exists, and follow their nose from there. If this is your main point, I concede that we might add a 'only if the resource exists' clause to the paragraph on the 1-1 correspondence.
This example, if it would occur, is simply not conformant with the spec (neither with Solid, nor with LDP or URI generic syntax). The 1-1 correspondence means that if |
That's on;y true if domain is total. The domain of the spec statement is
Doesn't matter where they get a value of the domain from, a proposition must hold if it is true.
When they followed their nose, that implies they have another necessary implicit param about existence and linkage for deduction which makes the deduction true. That means uri-semantics alone were not sufficient. If they were, then a random conformant string generator alone should have been sufficient.
That's simply incorrect. LDP doesn't force any semantics to uri. For any resource we include A client must follow stated interaction model, and follow their nose, without arbitrary assumptions and deductions from resource names. |
As I already said, we are not disagreeing on the implicit premise of existence of the resource. I merely claim that applications (at least those following the RESTful Way) always make good on that premise. But if you think this implicature is dangerous, we could definitely make the premise explicit in the spec. Aside, what I do not agree on, however, is your claim about LDP. LDP conforms to URI Generic Syntax, which conforms to slash semantics. Not as strong of a slash semantics as Solid (just generic hierarchy instead of LDP Containment), but still semantics that allow us to deduce hierarchy based on slashes. |
I must say I do like your thoroughness, @damooo. Thinking a bit further on LDP/URI vs Solid slash semantics, I do think, however, that there is even no difference at all. The Containment relation that LDP defines is so utterly generic, that it is i.m.o. not less broad than the generic 'hierarchy' the URI Generic Syntax hangs on the slash. Therefore, the correspondence Solid makes explicit is i.m.o. one that is already implicit in LDP. Fact remains, of course, that in none of those specs, the assumption that the contained resource must exist to deduce the hierarchy/containment is made explicit. So I'm all in favour of adding that at least to our Solid spec. 👍 |
URI generic When it deals with dot segments, it essentially talks about Aside from that, in it's words:
If a resource identifies a real world entity, what
|
I quote: "The generic syntax uses the slash ("/"), question mark ("?"), and number sign ("#") characters to delimit components that are significant to the generic parser's hierarchical interpretation of an identifier. [...] This uniform representation of hierarchy across naming schemes allows scheme-independent references to be made relative to that hierarchy. Since URI's represent resources, I interpret this as the hierarchy being about resources.
The kind of hierarchy is not the question, only the fact that there is one. That is exactly the difference between LDP Containment (there is hierarchy) and LDP Membership (what are the semantics of that hierarchy). But we're not being constructive here. This kind of interpretation game was exactly what I was hoping to avoid by instead listing use cases for each of the constraints. Even more, as I said in one of my first comments: I would personally also be in favor of dropping the explicit mention of slash semantics! I believed it to be nothing more than @timbl's pet-peeve. But I've grown to appreciate the value of it [1]; and it has been in the spec so long (and definitely in the necessary AND implicitly sufficient version; that is very clear from the issue from back then). [1] I think what triggerd my change of mind was the realisation that we can do literally everything WITH the slash semantics that we can do without (non-hierarchical resources can stick with slash-less URIs), and get advantages as well: we gain strong two-way deduction that we even can perform offline. I think the question then remains: do we really want to break this all open again, with only things to lose, and none to gain? |
Spec says that:
If it is
necessary
:If above statement is expressing a
necessary
condition, then if two resources areknown
to be in container-child relation, their uriMUST follow
(neccessary) follow above condition.But vice-versa may not be true. I.e, if uris of two resources share hierarchical relation ship, then they
need not
be in containment relation, as the condition isnot sufficient
.This indeed seems the case, that resource with uri
a/abc.acl
, need not be child of resource with uri ofa/
, even though their uris are in hierarchical relation. But it instead may be aux ofa/abc
.If it is also
sufficient
:Let's assume, there are three resorces:
R1
with uri/path/to/r1/
,R2
with uri/path/to/r1/abc
,Rx
with uri/path/to/r1/<slug>
.Then if condition is also
sufficient
, one can conclude thatRx
MUST be child of
R1`, for they satisfy suffient condition for containment.But we see this is not the case. We can see that if
<slug>
inRx
isabc.acl
, then it may be instead acl ofR2
rather than child ofR1
.Problem
We above saw that, uri-slash-semantics are actually necessary for containment to hold, but not sufficient to unambiguously infer containment between to resources.
But we have been seeing in many places, the slash semantics beeing inconsistently treated as sufficient, and being used to infer containment when that may not be guaranteed.
For example:
If a container resource
R1
with uri/path/to/r1/
is known to exist, and resourceRx
with uri/path/to/r1/<slug>
is is known tonot yet exist
, and aGET
is sent forRx
, then should we consultacl:default
ofR1
's acl for determining status code to 403/404?My sense says that, as resource
Rx
known to not exist yet, it is not child of any resource, as semantics are necessary but not sufficient. This is indeed the case if<slug>
may beabc.acl
, it can be slot for aux of other instead. But many places in the issues, it is taken for granted thatR1
's acl'sacl:default
will be applied to determine method access overRx
.The text was updated successfully, but these errors were encountered: