-
Notifications
You must be signed in to change notification settings - Fork 49
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
Add heuristic to determine resource type #160
Changes from 6 commits
c13dd42
3207529
b8bf670
e40d685
aadf3a3
6ed70e2
c1aac42
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -130,6 +130,104 @@ Note: | |
Servers that wish to disable URI re-use may want to use the `410` status | ||
code. | ||
|
||
### Resource type heuristics ### {#resource-type-heuristics} | ||
|
||
The semantics of slashes in URI paths are shared ([[#uri-slash-semantics]]). | ||
|
||
Servers MUST apply the following heuristics to determine the request's | ||
resource type and to construct the effective request URI for the target | ||
resource of an HTTP `POST` | ||
[[Source](https://github.com/solid/specification/issues/128#issuecomment-573033297)]. | ||
|
||
The consistency of a request is determined by checking the optional `Link` and | ||
`Slug` headers against the target URI | ||
[[Source](https://github.com/solid/specification/issues/40#issuecomment-566995240)]. | ||
|
||
Servers supporting the `Slug` header MUST apply the shared slash semantics on | ||
the `slugtext` on requests that also include the `Link` header with | ||
`rel="type"`. | ||
|
||
Issue: | ||
Redefine `slugtext` eg. exclude recursive container creation? | ||
[Related issue](https://github.com/solid/specification/issues/128) | ||
|
||
<table class="data" id="heuristics-resource-type"> | ||
<caption>Heuristics to determine a resource type</caption> | ||
<thead> | ||
<tr> | ||
<th>`Slug`</th> | ||
dmitrizagidulin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<th>`Link`</th> | ||
<th>Result</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td>`foo/`</td> | ||
<td>No `Link` header.</td> | ||
<td>Create a container with `foo/` appended to the request-URI.</td> | ||
</tr> | ||
<tr> | ||
<td><code>foo/</code></td> | ||
<td>`Link` header with `rel="type"` targeting a valid LDP container | ||
type.</td> | ||
<td>Create a container with `foo/` appended to the request-URI.</td> | ||
</tr> | ||
<tr> | ||
<td><code>foo/</code></td> | ||
<td>`Link` header without a `rel="type"` targeting a valid LDP container | ||
type.</td> | ||
<td>Create a resource with `foo` appended to the request-URI, check for | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This exception I find very weird. I don't think we should derive anything from non-recognized There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's indeed what's intended. What's derived is that it is a non-Container resource. Slug will be ignored in this case. Would rephrasing help? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My interpretation of what written seems to be correct (so writing is ok); but I don't understand why from an unknown header can be derived the resource is non-Container. I don't think we should derive that. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's recognised is "ldp:Container or a specialisation" (ldp:BasicContainer - as that's the only one currently required) as the "container type". I used "other than container type" to express their absence. Open to rephrasing. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah okay, so only There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Only the existence of Link with rel=type LDPC or LDP-BC is checked. Note the check in prior row says "Link header with ldp:Container or a specialisation." - We are really talking about rel=type here. So we can just mention the actual relation. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I would make it clear that it is a We could perhaps call them "indicated types" or so, and then declare above the table how those indicated types are extracted from There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I used "or a specialisation" instead of ldp:BasicContainer figuring that if other container types are supported in the future, they will also follow the slash semantics. If server gets Link rel=type LDP-DC, it will create a container resource with trailing slash. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All fine with me, my issue/misunderstanding was in the phrasing of " There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about e40d685 for this draft? |
||
consistency.</td> | ||
</tr> | ||
<tr> | ||
<td>`foo`</td> | ||
<td>No `Link` header.</td> | ||
<td>Create a resource with `foo` appended to the request-URI, check for | ||
consistency.</td> | ||
RubenVerborgh marked this conversation as resolved.
Show resolved
Hide resolved
|
||
</tr> | ||
<tr> | ||
<td>`foo`</td> | ||
<td>`Link` header with `rel="type"` targeting a valid LDP container | ||
type.</td> | ||
<td>Create a container with `foo/` appended to the request-URI.</td> | ||
</tr> | ||
<tr> | ||
<td>`foo`</td> | ||
<td>`Link` header without a `rel="type"` targeting a valid LDP container | ||
type.</td> | ||
<td>Create a resource with `foo` appended to the request-URI, check for | ||
consistency.</td> | ||
</tr> | ||
<tr> | ||
<td><em>none</em></td> | ||
<td>No `Link` header.</td> | ||
<td>Create a resource with server determined identifier appended to the | ||
request-URI, check for consistency.</td> | ||
</tr> | ||
<tr> | ||
<td><em>none</em></td> | ||
<td>`Link` header with `rel="type"` targeting a valid LDP container | ||
type.</td> | ||
<td>Create a container with server determined identifier appended to the | ||
request-URI.</td> | ||
</tr> | ||
<tr> | ||
<td><em>none</em></td> | ||
<td>`Link` header without a `rel="type"` targeting a valid LDP container | ||
type.</td> | ||
<td>Create a resource with server determined identifier appended to the | ||
request-URI, check for consistency.</td> | ||
</tr> | ||
</tbody> | ||
<tfoot> | ||
<tr> | ||
<td colspan="3"> | ||
</td> | ||
</tr> | ||
</tfoot> | ||
</table> | ||
|
||
|
||
## Auxiliary Resources ## {#rm} | ||
|
||
### Background and Need ### {#ar-need} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider explaining under what circumstances the server needs to fall back to this heuristic approach. (i.e. when the client does not specify an interaction model)?