uri url urn examples

URI, URL, URN: Practical Examples & Differences

By Daniel Thompson
AD

In the vast landscape of the web, Uniform Resource Identifiers (URIs), Uniform Resource Locators (URLs), and Uniform Resource Names (URNs) serve as the basic building blocks for identifying and locating digital resources. While these terms are often used interchangeably, they each hold distinct purposes, leading to confusion. Let's demystify these concepts with practical examples.

Imagine URIs, URLs, and URNs as different parts of a web address. Each plays a crucial role in directing your browser to the correct online destination. Understanding their differences can help you dictate how your website content is named and addressed on the World Wide Web.

URIs: The Universal Identification System

URIs provide a compact string for uniquely identifying resources on the internet. They are the broadest category, encompassing both URLs and URNs. Think of a URI as a unique name tag that identifies information available online.

AD
url vs uri vs urn
url vs uri vs urn
URL vs URI vs URN
URL vs URI vs URN
a sign with an arrow pointing to zebras and the words uri on it
a sign with an arrow pointing to zebras and the words uri on it

In an URI, the first part is referred to as the scheme. The most familiar scheme is 'http' or 'https', indicating a protocol used to access the resource.

URLs: Pointers to Resources

URLs are a subset of URIs, used for locating specific resources on the internet. They provide a way of displaying and thus, accessing data and resources. Commonly, URLs begin with 'http' or 'https'.

The Real Difference Between a URL and a URI
The Real Difference Between a URL and a URI
What Is The Difference Between A URI And A URL?
What Is The Difference Between A URI And A URL?
the structure of url is shown in this diagram
the structure of url is shown in this diagram

Let's break down an example URL: https://www.example.com/path/to/resource?query=value. Here, 'https' is the scheme, 'www.example.com' is the domain name, 'path/to/resource' is the path to the specific resource, and 'query=value' is additional information for navigating websites.

URNs: Names for Resources

URNs, on the other hand, represent resources with unique names that remain constant over time and across different locations. Unlike URLs, URNs do not indicate the location of the resource. Instead, they rely on another mechanism, like a VHN (Virtual Host Name), to locate the resource.

AD

A typical URN appears like this: urn:isbn:0451450523. Here, 'urn' represents the scheme, 'isbn' is the namespace, and '0451450523' is the unique name within that namespace.

URL Structure Explained 🌐 | Learn Parts of a Website Link Easily
URL Structure Explained 🌐 | Learn Parts of a Website Link Easily
Structure Of Url
Structure Of Url
Website URL Examples Explained
Website URL Examples Explained
These are Urns?!
These are Urns?!
⧓⠀My URL list ~
⧓⠀My URL list ~
a poster with the words url on it and an image of a house in the background
a poster with the words url on it and an image of a house in the background

How They Differ in Practice

To further illustrate their differences, consider the New York Public Library. A URI for this library could be http://www.nypl.org, where 'http' specifies the protocol used to access the resource, 'www.nypl.org' is the domain name, and the rest is the path to a specific resource.

The specific catalog might have a URN, for instance, urn:isbn:0451450523, serving as a unique, permanent identifier for a specific book.

AD

URIs can also identify services, such as a REST API. For instance, http://api.weather.gov/forecast/94060?Units=US is an URI identifying a specific service that provides a weather forecast for Washington D.C. The 'http' scheme specifies it's a resource that can be fetched over the HTTP protocol.

On the flipside, urn:oasis:names:specification:docbook:dtd:xml:4.1.2 points to the DocBook DTD (Document Type Definition) specification, a standard for XML formatting. It doesn't indicate how to locate the specification, just that it exists with a unique identifier.

Each plays a unique and vital role in making the web what it is today - a vast, interconnected network of resources and services. Understanding the difference between URIs, URLs, and URNs can help you navigate this web more effectively and develop more efficient online systems.

the key parts of a url
the key parts of a url
AD