The relationship and difference between URL, URI and URN

The relationship and difference between URL, URI and URN

URL

Uniform Resource Locator (URL) is a reference to a resource and a method of accessing it. It is commonly known as the URL, which is in the address bar of the browser.

A URL consists of the following different parts:

  • Protocol: usually https or http, a method of telling the browser or device how to access resources. Of course, there are other protocols, such as ftp, mailto, etc.
  • Next is ://
  • Hostname: A registered name (domain name) or IP address that represents an IP address, a numeric identifier used to identify a device connected to a network.
  • The port number, preceded by a colon:
  • Path: can refer to a file system path, usually used as a code segment
  • Parameters: optional query parameters starting with a question mark, where multiple parameters are connected with &
  • Hash: used to provide quick links to titles on a page, such as anchor links

URI

Similar to URL, Uniform Resource Identifier (URI) provides a method to identify resources. However, unlike URL, URI does not provide a method to locate the resource.

The most common form of URI is the Uniform Resource Locator (URL), often specified informally as a web address. From this, it can be seen that URI is a superset of URL, and every URL is essentially a URI.

URN

Uniform Resource Name (URN) is the historical name of Uniform Resource Identifier (URI), and URN is used as the URI scheme.

From the perspective of a set, URN and URL are both subsets of URI, as shown in the figure:

Taking a website as an example, the following clearly shows the contents of URI, URN, and URL, which can more intuitively reflect the relationship between the three:

To conceptually summarize the relationship between the three, as shown in the figure:

picture

<<:  Get started quickly and build a personalized Python GUI calculator in five minutes

>>:  Several steps and tools for troubleshooting the network

Recommend

Network configuration auditing is more important than ever

To get the most intuitive understanding of how en...

The first interpretation in China: the potential game-changer behind IIoT

If the Industrial Internet is to be implemented, ...

How does 5G help enterprises explore the development of the Internet of Things?

What is the Internet of Things? The “internet of ...