What’s the difference between an URI, URL and URN? I have read a lot of sites (even Wikipedia) but I don’t understand it.
URI: http://www.foo.com/bar.html
URL: http://www.foo.com/bar.html
URN: bar.html
Is this correct?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A Uniform Resource Identifier (
URI) is a string of characters used to identify a name or a resource on the Internet.A URI identifies a resource either by location, or a name, or both. A URI has two specializations known as URL and URN.
A Uniform Resource Locator (
URL) is a subset of the Uniform Resource Identifier (URI) that specifies where an identified resource is available and the mechanism for retrieving it. A URL defines how the resource can be obtained. It does not have to be a HTTP URL (http://), a URL can also start withftp://orsmb://, specifying the protocol that’s used to get the resource.A Uniform Resource Name (
URN) is a Uniform Resource Identifier (URI) that uses the URN scheme, and does not imply availability of the identified resource. Both URNs (names) and URLs (locators) are URIs, and a particular URI may be both a name and a locator at the same time.This diagram (source) visualizes the relationship between URI, URN, and URL:
The URNs are part of a larger Internet information architecture which is composed of URNs, URCs and URLs.
bar.html is not a URN. A URN is similar to a person’s name, while a URL is like a street address. The URN defines something’s identity, while the URL provides a location. Essentially URN vs. URL is "what" vs. "where". A URN has to be of this form
<URN> ::= "urn:" <NID> ":" <NSS>where<NID>is the Namespace Identifier, and<NSS>is the Namespace Specific String.To put it differently:
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 RFC3986: