top of page

Difference between URN and URL

URI(Uniform Resource Identifier)

A URI (Uniform Resource Identifier) is a sequence of characters that identifies a logical or physical resource. Universal Resource Identifiers are specified in the Internet Engineering Task Force (IETF) Request for Comments (RFC) 3986 and are summarized and extended in documentation for the W3C’s Web Architecture, Architecture of the World Wide Web, Volume 1. According to the specifications, resources do not have to be accessible on the Internet. Examples of resources include electronic documents, elevator door sensors, XML namespaces, web pages and ID microchips for pets.




There are two types of URI :

  1. Uniform Resource Name

  2. Uniform Resource Locator


URN (Uniform Resource Name)

(URN) is a string of characters that gives the name of the resource. Like in real life, two objects on the Internet also can have the same name. URN gives a unique identity of a resource within a defined area or namespace. The combination of URL and URN gives the resource a unique identity.


Syntax:

urn:<nid>:<nss></nss><.nid>


URN Components

1. URNs scheme specification

2. namespace identifier

NID. NID should be registered in IANA (The Internet Assigned Numbers Authority). IANA regulates and monitors the domain names, IP addresses, and protocol parameter identifiers that are used by Internet standards. IANA is an administrative function of the Internet.

3. NSS(Namespace specific string) This identifies the specific resource.


URL (Uniform Resource Locator )

URL is a string of characters that refers to the address of the resource on the Internet. URL assists in reaching the location where the object can be found. Basically, they are the web address or location of the files, videos, documents, images, web pages, etc. that have been published and shared on the Internet. URL also provides the approach scheme or protocol to reach the location and retrieve the information.


Syntax:

scheme/protocol://host name[:port number] [/path] [/query_string][/# fragment]


URL Components

1. Protocol

It is the identifier that indicates the name of the protocol to be used to retrieve or fetch the resource. It is the communication to be used between the client browser and the host server.


2. Domain Name

It is the name or the IP address where the resource is located. The domain name in the URL is case-sensitive.


3. Port

The port number is optional. It indicates the port number of the host on which the site is hosted. Sometimes a host can be serving multiple applications, email servers, etc. In such cases, when there are multiple applications hosted, it becomes important to give the port number to connect and reach the specified resource.


4. Path

It is the pathname where the resource is located on the domain mentioned.


5. Resource Fragment

It is optional and used if the resource has to be set at a particular section of the web page, like the top of the page or bottom of the page or a specific section of the page. Browsers search for the fragment tag anchor in the web page’s Html code and scroll the website to it.


6. Query String

It is the feature that allows a query to be executed and the page is loaded as per the result of the query. The main components that follow the ‘?’ are the parameter key and the value of the parameter that needs to be searched follows the ‘=’ sign. Multiple parameter keys can be appended with the ‘&’ separator.




Resource: softwaretestinghelp, Wikipedia


The Tech Platform

0 comments
bottom of page