Sunday, January 31, 2010

URI, URL, URN: Difference between URI and URL

There is lot of confusion between URL, URI and most of the people are still unaware of the distinctions. I started a little research on it. I provided information related to URI, URL, URN. Here we go:

I found the following at the W3C's Contemporary View of Uniform Resource Identifiers:

"...a URL is a type of URI that identifies a resource via a representation of its primary access mechanism (e.g., its network "location"), rather than by some other attributes it may have. Thus as we noted, "http:" is a URI scheme. An http URI is a URL. The phrase "URL scheme" is now used infrequently, usually to refer to some subclass of URI schemes..."

However, as is typical with W3C documents and specs, there's a little too much technical mumbo-jumbo floating around in that explanation to satisfy anyone who doesn't balance their checkbook in binary, so I kept looking. Kenneth Fly's Web Site provided the following:

"URI stands for Universal Resource Identifier and URL stands for Universal Resource Locator. Often times people use the terms interchangably, which is not entirely correct. A URL is a subset of the URI popular protocols. These are protocols (http://, ftp://, mailto:). Therefore all URLs are URIs. The term URL is deprecated and the more correct term URI is used in technical documentation. All URIs are means to access a resource on the Internet and are a a technical short hand used to link to the resource. URIs always designate a method to access the resource and designate the specific resource to be accessed."

So...the terminology is apparently way out-dated and I need to start saying "URI" instead of "URL." Why? Because anything that has been deprecated is bad news.

From various other Sites:

· Whereas URLs always refer to network addresses (including a protocol specification, host name or address, and local path), a URI does not necessarily refer to a remote resource. For example, the URI file:///c:/ specifies a local directory. Because file does not refer to any specific network protocol, this URI is not also a URL. (Check with, A URL is a subset of the URI popular protocols. These are protocols (http://, ftp://, mailto:) as mentioned in the above paragraph)

RFC by Tim Berners – Lee: http://www.faqs.org/rfcs/rfc2396

As mentioned in the RFC 2396, the abbreviation terms Uniform, Resource, and Identifier are straight forward. Tim was conveyed how they divided URI into URL and URN.


Uniform:

Uniformity provides several benefits: it allows different types of resource identifiers to be used in the same context, even when the mechanisms used to access those resources may differ; it allows uniform semantic interpretation of common syntactic conventions across different types of resource identifiers; it allows introduction of new types of resource identifiers without interfering with the way that existing identifiers are used; and, it allows the identifiers to be reused in many different contexts, thus permitting new applications or protocols to leverage a pre-existing, large, and widely-used set of resource identifiers.

Resource:

A resource can be anything that has identity. Familiar examples include anelectronic document, an image, a service e.g., "today's weather report for Los Angeles"), and a collection of other resources. Not all resources are network "retrievable"; e.g., human beings, corporations, and bound books in a library can also be considered resources. The resource is the conceptual mapping to an entity or set of entities, not necessarily the entity which corresponds to that mapping at any particular instance in time. Thus, a resource can remain constant even when its content---the entities, to which it currently corresponds---changes over time, provided that the conceptual mapping is not changed in the process.

Identifier:

An identifier is an object that can act as a reference to something that has identity. In the case of URI, the object is a sequence of characters with a restricted syntax.

A URI can be further classified as a locator, a name, or both. The term "Uniform Resource Locator" (URL) refers to the subset of URI that identify resources via a representation of their primary access mechanism (e.g., their network "location"), rather than identifying the resource by name or by some other attribute(s) of that resource. The term "Uniform Resource Name" (URN) refers to the subset of URI that are required to remain globally unique and persistent even when the resource ceases to exist or becomes unavailable.

To read more: http://www.faqs.org/rfcs/rfc2396.html#ixzz0eAl5m8dL

The important point in URL is the “Network Location” as mentioned in the example which provides the distinction:

For example, the URI file:///c:/ specifies a local directory. Because file does not refer to any specific network protocol, this URI is not also a URL.

Computer scientists may classify a URI as a locator (URL), or a name (URN), or both. A Uniform Resource Name (URN) functions like a person's name, while a Uniform Resource Locator (URL) resembles that person's street-address. In other words: the URN defines an item's identity, while the URL provides a method for finding it.

The ISBN system for uniquely identifying books provides a typical example of the use of URNs. ISBN 0486275574 (urn:isbn:0-486-27557-4) cites unambiguously a specific edition of Shakespeare's play Romeo and Juliet. In order to gain access to this object and read the book, one would need its location: a URL address.

From technical point of view as mentioned in Wikipedia:


A URL is a URI that, in addition to identifying a network homed resource, specifies the means of acting upon or obtaining the representation, through description of the primary access-mechanism, or network "location". For example, the URL http://www.wikipedia.org/ identifies a resource (Wikipedia's home page) and implies that a representation of that resource (such as the home page's current HTML code, as encoded characters) is obtainable via HTTP from a network host named www.wikipedia.org. A Uniform Resource Name (URN) is a URI that identifies a resource by name, in a particular namespace. One can use a URN to talk about a resource without implying its location or how to access it. The resource does not need to necessarily be network homed. For example, the URN urn:isbn:0-395-36341-1 is a URI that specifies the identifier system, i.e. International Standard Book Number (ISBN), as well as the unique reference within that system and allows one to talk about a book, but doesn't suggest where and how to obtain an actual copy of it.