Uniform Resource Name (URN)
A Uniform Resource Name (URN) is a type of URI
identifying a resource by a globally unique, persistent
name. A URN always uses the urn scheme and provides
no information about how or where to access the resource.
Format
The URN syntax follows this structure:
urn:<NID>:<NSS>
The Namespace Identifier (NID) names the namespace. NIDs are case-insensitive and registered with IANA. The Namespace-Specific String (NSS) identifies the resource within the namespace. The combination of NID and NSS guarantees global uniqueness.
A URN is allowed to carry optional components after the NSS:
- r-component: resolution parameters, prefixed by
?+ - q-component: query passed to the resolved resource,
prefixed by
?= - f-component: fragment identifier, prefixed by
#
urn:example:resource?+res-param?=query#fragment
Namespaces
IANA maintains two categories of registered URN namespaces:
Formal namespaces
Formal namespaces serve a broad community of users and go through a structured registration process. The NID is a meaningful string chosen by the registrant. Well-known formal namespaces include:
| NID | Purpose |
|---|---|
isbn |
International Standard Book Numbers |
issn |
International Standard Serial Numbers |
ietf |
IETF documents and standards |
oid |
Object Identifiers (ISO/ITU-T) |
uuid |
Universally Unique Identifiers |
Informal namespaces
Informal namespaces follow a simpler registration process.
IANA assigns the NID as the prefix urn- followed by a
number (e.g., urn-7). The registrant does not choose the
NID. Informal namespaces carry the same rights and
responsibilities as formal ones.
The full list of registered namespaces is available in the IANA URN Namespaces registry.
Examples
These examples show the URN scheme identifying resources by name. No location or access method is specified.
A URN identifying an IETF RFC
urn:ietf:rfc:7230
The ietf namespace identifies IETF documents. The NSS
rfc:7230 refers to the original HTTP/1.1
Message Syntax and Routing specification, since
superseded.
A URN identifying a book by ISBN
urn:isbn:0451450523
The isbn namespace maps to International Standard Book
Numbers. This URN persistently identifies the book
regardless of which retailer or library holds a copy.
A URN containing a UUID
urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6
The uuid namespace wraps a Universally Unique Identifier,
providing a URN for resources identified by UUID.
URNs in practice
HTTP and web standards lean on URNs wherever a
stable name matters more than a fetchable address.
The urn:ietf:params branch names protocol
parameters across specifications: OAuth grant types
travel as values like
urn:ietf:params:oauth:grant-type:device_code, and
WHIP registers its protocol extensions
under urn:ietf:params:whip:ext so a server can
announce an extension without hosting a page for
the identifier. Problem details
kept its urn:ietf:rfc:7807 namespace across the
specification's revision for the same reason: names
already deployed in APIs stay valid.
The uuid namespace does the day-to-day work.
WebDAV servers mint lock tokens and resource
identifiers as urn:uuid: values, which is why
208 responses carry them, and APIs use the form
wherever an identifier needs to be globally unique
without a registry. XML-based standards run on
URNs as namespace names, with SAML's
urn:oasis:names:tc:SAML:2.0:assertion among the
most widely deployed.
The pattern across all of these: the identifier appears inside message bodies and protocol fields, never on the wire as a request target, since nothing listens at a name.
Resolution
A URN on its own does not describe how to retrieve the resource. Resolution is the process of translating a URN into one or more URLs or other metadata. Resolution services (such as Handle System, DOI, or application-specific resolvers) map URNs to current resource locations.
Not every URN has a resolver. Many URNs serve purely as stable identifiers within databases, catalogs, and XML namespaces.
See also
- RFC 8141: Uniform Resource Names (URNs)
- IANA URN Namespaces registry
- Uniform Resource Identifier
- Uniform Resource Locator
- Percent-Encoding
- Problem Details
- WHIP
- HTTP headers