Part-I: Understanding The Concept Of URI

Shivam
4 min readJan 18, 2020

--

Hello,

In this Part-I from the series of posts on the URI, We will be going to cover the concept behind the URI and how it works. This series is divided into three smaller parts, which can also be studied independently.

Introduction:

This blog will give a brief introduction to URI. We will be going to cover the following topics:

  • Why Do We Need the URI?
  • What is the URI?
  • What is the Purpose of URI?
  • What are the characteristics of URI?
  • Classification of URI
  • And What are the URL and the URN?

Let’s go through each of the topics one by one.

Why Do We Need The URI?

The internet is vast and also the number of resources available on it. Naturally, with this large number of resources comes a problem of identifying each of them distinctly.

If we look around, we will find the same kind of problems everywhere, for example identifying a vehicle, citizen of the country or book in the library, etc. All of these systems have a common problem, which is identifying something distinctly. Each of these systems has its standards by which they create a unique identity for their concerned entity. Similarly, URI is used to identify resources uniquely over the internet.

What Is The URI?

URI is the acronym for Uniform Resource Identifier. It is nothing but the sequence of the characters used to identify resources uniquely over the internet. This situation is similar to what we have in Vehicle or Passport registration system where each vehicle or passport, respectively, gets a unique Identifier.

Following is the official definition of the URI:

A Uniform Resource Identifier (URI) is a compact string of characters for identifying an abstract or physical resource.

The Purpose:

Everything in this universe has a purpose of existence, so does the URI.

The purpose of URI is to create a standard set of rules by which we can perform operations like access, update, replace, find attributes, etc. on the resources.

It is similar to our vehicle registration system, but this is a global system. Now we know what the problem statement was creating behind the URI. To solve this problem, URI needs to have some properties. In the next section, we will look into these properties.

Characteristics Of URI:

URI are characterized by the following definitions:

Uniform:

URI considered being uniform. It means the meaning of the URI remains the same in all contexts.

For example, the URI urn:isbn:0–486–27557–4 refers to Shakespeare’s play “Romeo and Juliet” book. If you search 0486275574 on any website which allows you to search a book by its ISBN, you will notice that all these websites will show you the same result.

Resource:

A resource can be anything that has an identity. It can be an abstract or physical entity. For example, a text document, an image, a service, a weather report, etc.

Resources don’t need to be network “retrievable”; e.g., human beings, corporations, and bound books in a library can also be considered resources.

Identifier:

An Identifier is an object that can act as a reference to something that has an identity.

Compare URI with a passport or vehicle registration system; it will help you to understand the concept of URI. The only difference is that the number of resources available on the internet is enormous. And we need a global system which can be interpreted the same everywhere.

Classification Of The URI

A URI can be classified as a locator, a name, or both. When URI used to access resources via their network “location,” we call it URL. And when URI used to identify resources via their “name,” we call it URN.

  • We can say, URI = {URL, URN}.

Let’s look into each type in the next section.

URL (Uniform Resource Locator):

  • This subset of URI used to identify resources by their “location” in the network.
  • It is used to retrieve resources.
  • For example, a URL http://example.org/wiki/Main_Page refers to a resource identified as Main_Page, whose representation is in the form of HTML and related code, which is obtainable via the Hypertext Transfer Protocol (HTTP).

URN (Uniform Resource Name):

  • This subset of URI is used to create an Identifier that remains globally unique and persistent even when the resource ceases to exist or becomes unavailable. In simple words, this is used to create a unique name for the resource.
  • It is used to identify resources and not to locate it.
  • For example, urn:isbn:0–486–27557–4 refers to Shakespeare’s play Romeo and Juliet book.

A URN may be compared to a person’s name, while a URL may be correlated to a street address.

Thanks. That’s all in this part-I, I hope you learned basics and the idea behind the URI. If you have any suggestions or questions, please add it in the comment below. Thanks again for reading, Happy Learning 👏.

Further Reading:

  • In part-II of this series, we are going to look into the Syntax or Grammar used to create URI rules and some real-world examples of URI.
  • Part-III of this series contains more examples of URI which are commonly used.

Reference:

Official RFC document for URI.

--

--

Shivam

Product Engineer @ Gojek. Likes to write on Productivity, Android App Development, Kotlin, Software Engineering, etc.