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

# Uniform Resource Identifier (URI) (`uri`)

> **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.

Identifier of a resource in the generic syntax of RFC 3986: a scheme, a colon and a scheme-specific part, optionally followed by ?query and #fragment, such as https://example.com/, mailto:John.Doe@example.com, urn:isbn:0451450523 or tel:+1-816-555-1212. URLs, which locate a resource, and URNs, which name it, are both URIs. The scheme starts with a letter and may contain letters, digits, +, - and .; IANA keeps the registry of schemes. The regexp accepts only the ASCII characters that RFC 3986 allows, with other characters percent-encoded, so IRIs with non-ASCII characters do not match.

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

## Detection

Regular expression (Python `re`):

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

## Examples

- `ldap://[2001:db8::7]/c=GB?objectClass?one` — Example of RFC 3986, section 1.1.2
- `mailto:John.Doe@example.com` — Example of RFC 3986, section 1.1.2
- `news:comp.infosystems.www.servers.unix` — Example of RFC 3986, section 1.1.2
- `tel:+1-816-555-1212` — Example of RFC 3986, section 1.1.2
- `urn:oasis:names:specification:docbook:dtd:xml:4.1.2` — Example of RFC 3986, section 1.1.2
- `www.example.com` (invalid example) — No scheme
- `10:30` (invalid example) — A time; a scheme starts with a letter
- `http://example.com/a b` (invalid example) — Unencoded space

## Mappings

- fhir: `urn:ietf:rfc:3986`

## Translations

- ru: Унифицированный идентификатор ресурса (URI): Идентификатор ресурса в общем синтаксисе RFC 3986: схема, двоеточие и часть, зависящая от схемы.

## Sources

- wikipedia: <https://en.wikipedia.org/wiki/Uniform_Resource_Identifier>
- doc: <https://www.rfc-editor.org/rfc/rfc3986>
- doc: <https://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml>

## Quality

Score 90/100. Missing: detector coverage.

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