| | bookmark | email | 7 comments

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:

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:// 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?