---
id: "urn"
kind: "datatype"
status: "draft"
is_pii: false
categories: ["internet"]
langs: ["common"]
quality: 80
url: "http://registry.apicrafter.io/datatype/urn"
---

# Uniform Resource Name (URN) (`urn`)

> **Draft.** Draft records have not been reviewed yet and may be incomplete or wrong; do not treat them as authoritative for legal or compliance decisions.

Persistent, location-independent name in the urn URI scheme, defined by RFC 8141. It has the form urn:<NID>:<NSS>. The namespace identifier (NID) is a name registered with IANA, 2 to 32 letters, digits and hyphens long, such as isbn, uuid or ietf. The namespace-specific string (NSS) follows the rules of that namespace. The urn prefix is case-insensitive. A URN names a resource; it does not say where to retrieve it.

- Parent datatype: `uri`
- Personal data (PII): no
- Categories: Internet (internet)
- Countries: global
- Languages: Common to most languages (common)
- Classification: identifier

## Detection

Regular expression (Python `re`):

```
^[Uu][Rr][Nn]:[A-Za-z0-9][A-Za-z0-9-]{0,30}[A-Za-z0-9]:(?:[A-Za-z0-9._~!$&'()*+,;=:@-]|%[0-9A-Fa-f]{2})(?:[A-Za-z0-9._~!$&'()*+,;=:@/-]|%[0-9A-Fa-f]{2})*$
```

## Examples

- `urn:isbn:0451450523` — Book identified by its ISBN
- `urn:ietf:rfc:2648` — IETF RFC 2648
- `urn:uuid:6e8bc430-9c3a-11d9-9669-0800200c9a66` — UUID namespace
- `urn:nbn:de:bvb:19-146642` — National Bibliography Number (Germany)
- `urn:a:123` (invalid example) — The namespace identifier must be at least two characters long
- `https://example.org/a` (invalid example) — A URL, not a URN

## Translations

- ru: Унифицированное имя ресурса (URN): Постоянное имя ресурса в схеме urn (RFC 8141) вида urn:<пространство имён>:<строка>.

## Sources

- wikipedia: <https://en.wikipedia.org/wiki/Uniform_Resource_Name>
- doc: <https://www.rfc-editor.org/rfc/rfc8141>
- doc: <https://www.iana.org/assignments/urn-namespaces/urn-namespaces.xhtml>

## Quality

Score 80/100. Missing: mapping (Wikidata, Schema.org, ...), detector coverage.

JSON: <http://registry.apicrafter.io/api/v1/datatypes/urn.json> · Edit: <https://github.com/apicrafter/metacrafter-registry/edit/main/data/datatypes/any/internet/urn.yaml>
