Hello,

I have a simple question that I can't find an answer to.
My question is: Does a URL include a URN? If yes, how can it include a URN?
For example, this web address:
www.example.com/folder/file.html
In this address, where is the URL, and where is the URN?
Is the URL the full path including "file.html"? Or is it just "www.example.com/folder"??

Thank you.

Dani AI

Generated

Short answer: no — a URL does not “contain” a URN. Both URL and URN are types of URI (the umbrella term). Your example, properly written as http://www.example.com/folder/file.html, is a URL (and therefore a URI): it tells a client how to locate and retrieve the resource. See the URI definition in the IETF specification. RFC 3986 (URI: Generic Syntax). (rfc-editor.org)

RFC 3986 explains that a URI can be classified as a locator, a name, or both: a URL is the locator kind (it encodes an access mechanism and network location), while a URN is intended as a persistent, location‑independent name and typically uses the urn: scheme. A URN looks like urn:<NID>:<NSS>, for example urn:isbn:9780141036144. For practical guidance on the urn: form, see MDN’s URN documentation. MDN: urn scheme. (developer.mozilla.org)

In your string, the whole thing (with a scheme) is the URL. file.html is simply the final path segment of that URL — part of its path component, not a URN or a separate “name” in the URN sense. Decomposed:

http://www.example.com/folder/file.html
  scheme:    http
  authority: www.example.com
  path:      /folder/file.html

If you need a name that is independent of where the resource is hosted, use an actual URN or another persistent identifier (DOI, Handle, etc.) rather than an HTTP path.

On the thread: and were right to stress that URLs locate while URNs name, but file.html is not a URN; it’s a path segment within an HTTP URL. ’s links were a useful starting point for reading more. (rfc-editor.org)

Recommended Answers

All 3 Replies

URL is location bound and defines the mechanism as to how to retrieve the resource over the web. A URN is just a name and isn’t bound to a network location.uniform resource identifier has 2 parts URL and URN.URN does not Specify location.The URL is complete location www.example.com/folder/file.html whereas in my opinion file.html is URN.

URL is location bound and defines the mechanism as to how to retrieve the resource over the web. A URN is just a name and isn’t bound to a network location.uniform resource identifier has 2 parts URL and URN.URN does not Specify location.The URL is complete location www.example.com/folder/file.html whereas in my opinion file.html is URN.

Yes, I agree with smith warnes.
URN is a uniform resource name and url is uniform resource location. Both are Uniform Resource Identifier but URN is used for identification whereas URL is used for locating resources. For example a person's name is a URN and his address will be a URL..
So, www.example.com/folder/file.html is a URL and file.html is URN..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.