Skip to main content

Difference between URI, URL and URN

Here you will learn about difference between URI, URL and URN.

When it comes about accessing WebPages, data, files, audio, videos and other stuff, the foremost thing a programmer has to take care of is about URIs, URLs, and URNs.

So what are they? What roles do they play on the World Wide Web i.e. Internet? And how they differ?

In this tutorial we are going to find answers about these questions and understand these three terms.

URI

Uniform Resource Identifier or URI (by definition as per Wikipedia), is a string of character that is used to identify a resource.

URI is actually used to provide an address to a resource on any system, whether over Internet or on your local machine. URI start with the protocol that should be used to access the resource which is followed by the actual address of the resource and other information or constraints parameters about the resource.

URI consists of two main parts – URL and URN.

URL

Uniform Resource Locator (URL) is a subset of URI, which is the actual physical or logical address of the resource, starting with the protocol that will be used to access that resource and other parameters. URL take up a general form: protocol://host/address_to_file/key=value. Where key = value defines the parameters and constraints used.

For Example – HTML WebPages are accessed using the HTTP (Hyper Text Transfer Protocol) protocol whereas files are accessed using the FTP (File Transfer Protocol) protocol.

URN

Uniform Resource Name (URN) is an item specific property of a resource. It doesn’t provide with the protocol used to access the resource neither any address to the resource, however, it give data about the resource itself. Its unique name, encoding used to define the resource, type of resource and other details.

Example for a better understanding:

Let’s take up an example of a man, named Arjun Gupta, living in New Delhi, at 405 B Gomti Nagar.

Here

Arjun Gupta,

405 B Gomti Nagar

New Delhi, 266895

This is the URI for the man, the actual address to reach the person.

Arjun Gupta, a man – This is URN specific information about the person that will never change.

405 B Gomti Nagar, New Delhi, 266895 – This is the URL for the man that may change over time, if the resource (here, man) is moved to some other address.

This is just an example, should not be compared in reality.

Difference between URI, URL and URN

Uniform Resource Identifier Uniform Resource Locator Uniform Resource Name
Combination of URL and URN used to get access to a resource. Subset of URI. Subset of URI.
URI is the physical or logical address to the resource which also includes protocol related information with it. URL is the address of the resource with the protocol and resource specific information included. URN contains the resource specific information.
URI may change over time. URL may change over time. URN never changes for a resource.
Every URI in not URL or URN. Every URL is a URI. Every URN is a URI.

Example: 

  • URI: https://en.wikipedia.org/wiki/Main_Page
  • URL: https://en.wikipedia.org/wiki/Main_Page
  • URN: ISBN number of book, urn:isbn:0451450523

Comment below if you have queries related to difference between uri, url and urn.

The post Difference between URI, URL and URN appeared first on The Crazy Programmer.



from The Crazy Programmer https://www.thecrazyprogrammer.com/2018/04/difference-between-uri-url-and-urn.html

Comments

Popular posts from this blog

Rail Fence Cipher Program in C and C++[Encryption & Decryption]

Here you will get rail fence cipher program in C and C++ for encryption and decryption. It is a kind of transposition cipher which is also known as zigzag cipher. Below is an example. Here Key = 3. For encryption we write the message diagonally in zigzag form in a matrix having total rows = key and total columns = message length. Then read the matrix row wise horizontally to get encrypted message. Rail Fence Cipher Program in C #include<stdio.h> #include<string.h> void encryptMsg(char msg[], int key){ int msgLen = strlen(msg), i, j, k = -1, row = 0, col = 0; char railMatrix[key][msgLen]; for(i = 0; i < key; ++i) for(j = 0; j < msgLen; ++j) railMatrix[i][j] = '\n'; for(i = 0; i < msgLen; ++i){ railMatrix[row][col++] = msg[i]; if(row == 0 || row == key-1) k= k * (-1); row = row + k; } printf("\nEncrypted Message: "); for(i = 0; i < key; ++i) f...

Data Encryption Standard (DES) Algorithm

Data Encryption Standard is a symmetric-key algorithm for the encrypting the data. It comes under block cipher algorithm which follows Feistel structure. Here is the block diagram of Data Encryption Standard. Fig1: DES Algorithm Block Diagram [Image Source: Cryptography and Network Security Principles and Practices 4 th Ed by William Stallings] Explanation for above diagram: Each character of plain text converted into binary format. Every time we take 64 bits from that and give as input to DES algorithm, then it processed through 16 rounds and then converted to cipher text. Initial Permutation: 64 bit plain text goes under initial permutation and then given to round 1. Since initial permutation step receiving 64 bits, it contains an 1×64 matrix which contains numbers from 1 to 64 but in shuffled order. After that, we arrange our original 64 bit text in the order mentioned in that matrix. [You can see the matrix in below code] After initial permutation, 64 bit text passed throug...

Accessibility Insights for the Web and Windows makes accessibility even easier

I recently stumbled upon https://accessibilityinsights.io . There's both a Chrome/ Edge extension and a Windows app, both designed to make it easier to find and fix accessibility issues in your websites and apps. The GitHub for the Accessibility Insights extension for the web is at https://github.com/Microsoft/accessibility-insights-web and they have three trains you can get on: Canary (released continuously) Insider (on feature completion) Production (after validation in Insider) It builds on top of the Deque Axe core engine with a really fresh UI. The "FastPass" found these issues with my podcast site in seconds - which kind of makes me feel bad, but at least I know what's wrong! However, the most impressive visualization in my opinion was the Tab Stop test! See below how it draws clear numbered line segments as you Tab from element. This is a brilliant way to understand exactly how someone without a mouse would move through your site. I can easily s...