Subject: [apps-discuss] the URI definition model (was: Fun with URLs and regex)

From: Matthew Kerwin <[email-masked]>
Date: Fri, 30 Jan 2015 07:55:36 +1000

On 29 January 2015 at 20:46, t.petch <[email-masked]> wrote:

> ----- Original Message -----
> From: "Matthew Kerwin" <[email-masked]>
> To: "Roy T. Fielding" <[email-masked]>
> Cc: "IETF Apps Discuss" <[email-masked]>
> Sent: Thursday, January 29, 2015 5:14 AM
>
>
> I'm still suffering a misalignment: RFC 3986 defines the whole generic
> URI
> syntax as:
>
>     URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
>
> and my draft that references it essentially defines (or will soon
> define)
> the whole file-URI syntax as:
>
>     file-URI = subset-of-scheme ":" subset-of-hier-part
>
> By leaving off the query part, I've either said that a URI with a query
> part cannot be a 'file' URI, or that a URI that starts with "file:" and
> has
> a query part is invalid. Potayto potahto.
>
> <tp>
>
> When I read your I-D, I assumed that you knew what you were doing:-)  I
> can see a use for 'query' but if noone implements it, then better the
> I-D left it out.  But I did have it as a point to pursue, once the
> bigger issue, to me, of splitting what is valid according to RFC3986
> from what is not and seeing that reflected in the I-D (and of course,
> there is the mini-charter to agree:-(
>
> Tom Petch
>
> </tp>
> ​​
>
>
>
Ouch ;) To be honest, I think I thought I knew more than I really did. I'd
like to think that, as I've discovered holes in my knowledge I've also
filled them. Also in my defense, I've not had enough sleep the past week.

Part of my problem is that I'm somewhere between a software engineer and a
code hacker, so while I appreciate and take advantage of patterns and
frameworks, I can usually get by without. In the case of a URI scheme, as
Sean said earlier, our document model (write the ABNF) and the URI
definition model (define a subset of RFC 3986) don't line up. Because the
patterns don't work, I've gone with the approach of developing prototypes
that swing back and forth until they focus on the (local?) maximal solution.

Having (at least in my mind, and in local incomplete drafts) resolved the
issue of "c|/", and having some way forward for UNC, the remaining fuzzy
parts are the query and fragment. Nobody uses queries, so there's no point
adding them in. Fragments are currently out, because I was advised early on
to leave them out. The fuzziness is how to do it while remaining compatible
with both the document and definition models.

What I've seen, having looked at other schemes written or revised since RFC
3986, is that they all seem to dance around the relationship with RFC 3986.
'dns' keeps the subtleties implicit, 'acct' only says it borrows syntactic
elements, 'stun' goes out of its way to say RFC 3986 doesn't apply, 'geo'
doesn't even mention it, etc. Maybe that just means I'm overthinking it.

-- 
  Matthew Kerwin
  http://matthew.kerwin.net.au/

---

From: Sam Ruby <[email-masked]>
Date: Thu, 29 Jan 2015 18:49:14 -0500

On 01/29/2015 04:55 PM, Matthew Kerwin wrote:
>
> Having (at least in my mind, and in local incomplete drafts) resolved
> the issue of "c|/", and having some way forward for UNC, the remaining
> fuzzy parts are the query and fragment. Nobody uses queries, so there's
> no point adding them in. Fragments are currently out, because I was
> advised early on to leave them out. The fuzziness is how to do it while
> remaining compatible with both the document and definition models.

Permit me to provide a use case for both queries and fragments?

In a recent discussion with Tim Berners-Lee, he described a use case for 
file: URIs, namely developing an HTML application locally (using only 
relative references), and being able to push that code to a server and 
have it "just work" when served over HTTP.

HTML applications may include stylesheets and scripts.  Scripts, when 
running, may do interesting things based on the query and fragment.  The 
fragment, in particular, is routinely (ab)used by so-called "Single Page 
Applications".

- Sam Ruby

---

From: Bjoern Hoehrmann <[email-masked]>
Date: Fri, 30 Jan 2015 11:29:06 +0100

>fragment, in particular, is routinely (ab)used by so-called "Single Page 

You can always use fragment identifiers regardless of the scheme used.
As for query strings, I would not be surprised if question marks are
interpreted as path data in many implementations. Either way, the use
case above was a valid one a decade ago, but nowadays it is so often
necessary, and much easier than in the past, to actually use `http` or
in fact `https` in the near future, that `file://` is not a plausible
way to develop, starting with the inability to use `XMLHttpRequest` on
`file://` in some browsers.
-- 
Björn Höhrmann · mailto:[email-masked] · http://bjoern.hoehrmann.de
D-10243 Berlin · PGP Pub. KeyID: 0xA4357E78 · http://www.bjoernsworld.de
 Available for hire in Berlin (early 2015)  · http://www.websitedev.de/