Thursday, November 13, 2025
HomeLanguagesJavaDifference Between URI and URN in Java

Difference Between URI and URN in Java

URI stands for Uniform Resource Identifier. It identifies the resource either by name, or by location, or by both. It allows uniform identification of the resources. Here the resource can be anything like documents, images, files, web pages, etc. that can be part of the web architecture. The identifier in the name URI refers to the prominence of the resources, despite the technique used. 

When you are browsing on the internet, you are actually looking up a bundle of web resources. We use the Uniform resource identifiers to define the location of a resource. A URI consists of two things: URL and URN.

URN stands for Uniform Resource Name. It identifies the resources by name in a given name-space. A name-space refers to a group of names or identifiers. It is a subset of URI. URN does not include any protocol. A URN is required to exist globally unique and features global scopes. A URN is an unambiguous way to identify a resource.

Difference Between URI and URN

 URI

URN

It is the superset of URL and URN. It is the subset of URI.
It identifies the recourse by name, location, or both. It identifies the resource by names.
URI is used to distinguish one resource from others regardless of the method used. URN is used to distinguish one resource from others by the globally unique names.

Example:  

https://www.website.com/html/#posts

The above example line completely is referred to as URI whereas the part “www.website.com/html/#posts” of the above example is referred to as a URN.

RELATED ARTICLES

Most Popular

Dominic
32399 POSTS0 COMMENTS
Milvus
95 POSTS0 COMMENTS
Nango Kala
6765 POSTS0 COMMENTS
Nicole Veronica
11916 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11983 POSTS0 COMMENTS
Shaida Kate Naidoo
6889 POSTS0 COMMENTS
Ted Musemwa
7141 POSTS0 COMMENTS
Thapelo Manthata
6834 POSTS0 COMMENTS
Umr Jansen
6838 POSTS0 COMMENTS