1001Ferramentas
🆔Dev

URN Parser

Decompose a URN (urn:NID:NSS) into namespace identifier (NID) and namespace-specific string (NSS). Supports r-component and q-component (RFC 8141).

Formato: urn:NID:NSS[?+r-component][?=q-component][#fragment]

URN: identifying without saying where it is

A URL says where to fetch; a URN says only what the thing is. The difference matters when the identifier must outlive the server: a book's ISBN stays correct after the publisher closes, and that is what the form urn:isbn:0451450523 expresses. The structure is always urn, the namespace identifier and the string specific to it.

RFC 8141, from 2017, added three optional trailing parts, and the page separates them: the r-component, opened by question mark and plus, carrying parameters for the resolver; the q-component, opened by question mark and equals, carrying parameters for the resource; and the fragment, after the hash. None of the three takes part in identification — two URNs differing only in them name the same thing.

The namespace identifier is registered with IANA and the page recognises the common ones: isbn, issn, uuid, oid, ietf, nbn. The name urn is reserved and cannot name a namespace. Worth knowing the practical criticism: a URN identifies but nothing resolves it by default, so without an agreed resolution system it becomes a label — which explains why the DOI, born with its own resolver, won in academia.

Frequently asked questions

What are the rules for the namespace identifier?
From 2 to 32 characters, starting and ending with a letter or digit, with letters, digits and hyphens in between. Comparison is case-insensitive. A NID beginning with x followed by a hyphen was the informal form and has been discouraged since RFC 8141.
Is urn:uuid the same as a bare UUID?
It is the same identifier expressed as a URI. The urn:uuid form exists for when the context demands a URI — in RDF, in XML and in formats that only accept identifiers in that shape. The value after the colon is the ordinary UUID, lowercase with hyphens.
Are URNs still used?
Yes, more than it seems, and almost always underneath: ISO standard identifiers, national bibliography numbers, XML namespaces, resource identifiers in telecoms. What did not catch on was the idea of URNs replacing URLs in browsing — for that they would have needed a universal resolver that never existed.

Related Tools