Confused by the exact meaning of these terms? If you perform a Google search you'll notice you are not the only one.
So what's the difference?
As Tim Berners-Lee explains it in the Uniform Resource Identifier (URI): Generic Syntax (RFC3986)
A URI can be further classified as a locator, a name, or both. The term “Uniform Resource Locator” (URL) refers to the subset of URIs that, in addition to identifying a resource, provide a means of locating the resource by describing its primary access mechanism (e.g., its network “location”).
The term "Uniform Resource Name" (URN) has been used historically to refer to both URIs under the "urn" scheme [RFC2141], which are required to remain globally unique and persistent even when the resource ceases to exist or becomes unavailable, and to any other URI with the properties of a name.
To put it differently:
- URL
- is a URI that identifies a resource and also provides the means of locating the resource by describing the way to access it
- a URL is a URI
- a URI is not necessarily a URL
I'd say the only thing left to make it 100% clear would be to have an example of an URI that is not an URL. We can use the examples in the RFC3986:
- URL:
ftp://ftp.is.co.za/rfc/rfc1808.txt
- URL:
http://www.ietf.org/rfc/rfc2396.txt
: URL - URL:
ldap://[2001:db8::7]/c=GB?objectClass?one
: URL - URL:
mailto:John.Doe@example.com
: URL - URL:
news:comp.infosystems.www.servers.unix
: URL - URL:
telnet://192.0.2.16:80/
: URL - URN (not URL):
urn:oasis:names:specification:docbook:dtd:xml:4.1.2
: - URN (not URL):
tel:+1-816-555-1212
(?)
I'm not 100% sure about the last example though, but here is what I think: it is an URN because even if it identifies a resource it doesn't provide the means to locate it. Am I wrong?
7 comments:
The term "URL" no longer has any officially defined meaning. See http://www.tbray.org/ongoing/When/200x/2003/02/27/URL
Thanks a lot Stefan for the link to Tim Bray's post. I must confess that I am a bit confused now as the RFC cited in the post is dated 2005 (and I couldn't find place making it clear that URL is officially undefined) while Tim's post is from 2003.
Well yes, that's why in my understanding at least the RFC (which used to define URLs and now defines URIs) is so vague. But there's no longer any URL RFC, nor is there any formal definition. Which is the root of your problems :-)
I try to avoid "URL" unless I'm talking to a non-technical audience that would be confused by "URI". For all practical purposes, it doesn't really matter IMO.
I think this article would have been much more helpful if it simply listed a bunch of strings and showed which categories (ie: URI, URL, URN) it falls under. And, fwiw, the category of "not URL" isn't very helpful to me.
@Anonymous: You are probably right and that was my intention when including the examples at the end. I have changed it to indicate that the last 2 are URNs. Thanks
Can you show an example of a URI as they all seem to be URL except the last two which are URN?
@Anonymous 2: A URI is either a URL or a URN, so all above examples are URIs. Also, please read Stefan's comments above: the term URL is now 'undefined'
Post a Comment