# Uniform Resource Identifier (URI)
A Uniform Resource Identifier (URI) is a string of characters that identifies a resource—either by location, name, or both. Defined by [[Tim Berners-Lee]] in RFC 3986, URIs are the universal addressing system for the web and beyond. A URI can be a [[Uniform Resource Locator (URL)]] (identifies *where* to find something) or a URN (Uniform Resource Name—identifies *what* something is, regardless of location). Every URL is a URI, but not every URI is a URL.
## URI vs URL vs URN
| Type | Purpose | Example |
|------|---------|---------|
| **URI** | Generic identifier (superset) | Any of the below |
| **URL** | Locator—where to find it | `https://example.com/page` |
| **URN** | Name—what it is (persistent) | `urn:isbn:0451450523` |
```
URI = URL ∪ URN
┌─────────────────────────────┐
│ URI │
│ ┌─────────┐ ┌─────────┐ │
│ │ URL │ │ URN │ │
│ └─────────┘ └─────────┘ │
└─────────────────────────────┘
```
## URI Syntax
```
scheme://authority/path?query#fragment
│ │ │ │ │
│ │ │ │ └── Fragment (within resource)
│ │ │ └── Query (parameters)
│ │ └── Path (resource location)
│ └── Authority (host, port, user)
└── Scheme (protocol)
Example: https://user:
[email protected]:8080/path/file?key=val#section
```
## References
- RFC 3986: Uniform Resource Identifier (URI): Generic Syntax
- https://en.wikipedia.org/wiki/Uniform_Resource_Identifier
## Related
- [[Uniform Resource Locator (URL)]]
- [[World Wide Web]]
- [[Tim Berners-Lee]]
- [[Hypertext Transfer Protocol (HTTP)]]