Distinction between URIs, URLs and URNs
Posted on January 23, 2012 | Last updated: January 29, 2012 at 17:47 GMT
Understanding the difference between Uniform Resource Identifiers, Uniform Resource Locators and Uniform Resource Names might seem a trivial and even boring terminology topic, but it tends to generate confusion among the Internet community and for that reason, it is considered beneficial to dedicate this article to explain and clarify the differences.
An easy way to understand the distinction is by visualizing the relationships between terms. Imagine a URI as the parent entity and both URL and URN as the children. The following statements are true and help to understand relationships better:
- Any URL is a URI.
- Any URN is a URI.
- Not every URI is a URL.
- Not every URI is a URN.
The best approach to fully understand differences is to study each of the concepts involved, as explained below.
Uniform Resource Identifier (URI)
The purpose of a URI is to identify or distinguish one resource from all other resources, regardless of how that purpose is accomplished (by name or address for instance). This means that a URI can be considered a locator, a name, or both.
Uniform Resource Locator (URL)
With a URL it is possible not only to identify a web resource, but also to locate it. For example, a mailing address does not provide any further information or details about a person or organization, except for the location. A URL is also used to specify where to find a web resource.
Uniform Resource Name (URN)A URN is used for referring to a resource without providing details on how to find or access it. This can be compared to the name of a person, since it is used to mention or identify someone without revealing details on how to find or locate that person. The "where" is not addressed by a URN, only the "what", or the "who" if it were a person.
It is typical to hear URL all the time from the media, online, and everywhere as a synonym of "web address". It even seems to be a buzzword nowadays. Even though it is a technical word, a lot of people can easily understand the meaning and associate it with the web address for visiting a website or a link from a web browser.
URL is definitely the most popular term from the three covered in this article, and most of the time it does not create any kind of confusion for people, but it is still important to understand the meaning of terms because especially in technical documents, the concepts are used in ways that expect readers to clearly understand the differences. For example, the creation of this article was inspired by reading this sentence at http://www.sitemaps.org/faq.html#faq_xml_encoding and not understanding the difference between URL and URI:
"You should also make sure that all URLs follow the RFC-3986 standard for URIs, the RFC-3987 standard for IRIs, and the XML standard."
Having a rich technical vocabulary is helpful in the web development environment as it is for people in other areas to understand the jargon in their fields.
- Berners-Lee T., Fielding R., Masinter L. [ed.] Uniform Resource Identifier (URI): Generic Syntax Request for Comments 3986, Network Working Group <http://www.ietf.org/rfc/rfc3986.txt> January 2005. (Accessed 27 January 2012).