Wednesday, August 17th, 2016
The note Resources and URIs introduced the foundations of the Resource-Oriented Architecture (ROA). The current note is about two different types of URIs: URL and URN.
Uniform Resource Identifier. A URI is a string of characters used to identify a resource. It is the name and address of a resource on the web.
As both URL and URN are URIs, all of the URL and URN examples showed below, are also valid as URI examples.
Uniform Resource Locator. A URL is a URI that identifies a resource and also provides the means of locating the resource by describing the way to access it.
Uniform Resource Name. A URN is a URI. A URN only defines a name. It provides no details about how to get the resource over a network.
URNs are commonly used to define namespaces in XML Schema documents, such as:
Summing-up: both URL and URN are URIs as the both identify a resource. We can get a “thing” (a resource) via a URL, but we can’t get anything with a URN. If the URL describes both the location and name of a resource, the correct term to use is URI.
A URN functions like a person’s name, while a URL resembles that person’s street address.