Uniform Resource Identifier
A Uniform Resource Identifier (URI), formerly Universal Resource Identifier, is a unique sequence of characters that identifies an abstract or physical resource, such as a webpage, service, email address, phone number, book, real-world…
≈ 7 min read
Names in other languages
No names in other languages are held for this entry yet.
Article bodies are English and are not machine-translated. A name in another language is not a translation of the article.
A Uniform Resource Identifier (URI), formerly Universal Resource Identifier, is a unique sequence of characters that identifies an abstract or physical resource, such as a webpage, service, email address, phone number, book, real-world object (such as person or place), or concept. In particular, the resource need not be retrievable via the Internet, or any computer network.
Uniform Resource Locators (URLs) and Uniform Resource Names (URNs) are both subordinate classifications, and non-mutually exclusive. URLs are those which both identify and provide means of locating a resource "by describing its primary access mechanism" (e.g. its network or file system location). URNs identify resources with names which can be location independent.
The web technologies that use URIs are not limited to web browsers.
Syntax
A URI has a scheme that refers to a specification for assigning identifiers within that scheme. As such, the URI syntax is a federated and extensible naming system wherein each scheme's specification may further restrict the syntax and semantics of identifiers using that scheme. The URI generic syntax is a superset of the syntax of all URI schemes.
It was first defined in , published in August 19981, and finalized in , published in January 2005. A URI is composed from an allowed set of ASCII characters consisting of reserved characters (gen-delims: : , / , ? , # , [ , ] , and @ ; sub-delims: ! , $ , & , ' , ( , ) , * , + , , , ; , and = ), unreserved characters (uppercase and lowercase letters, decimal digits, - , . , _ , and ~ ), and the character % .
Syntax components and subcomponents are separated by delimiters from the reserved characters (only from generic reserved characters for components) and define identifying data represented as unreserved characters, reserved characters that do not act as delimiters in the component and subcomponent respectively, and percent-encodings when the corresponding character is outside the allowed set or is being used as a delimiter of, or within, the component. A percent-encoding of an identifying data octet is a sequence of three characters, consisting of the character % followed by the two hexadecimal digits representing that octet's numeric value.
The URI generic syntax consists of five components organized hierarchically in order of decreasing significance from left to right: URI = scheme ":" ["//" authority] path ["?" query] ["#" fragment] A component is undefined if it has an associated delimiter and the delimiter does not appear in the URI; the scheme and path components are always defined. A component is empty if it has no characters; the scheme component is always non-empty.
The authority component consists of subcomponents: authority = [userinfo "@"] host [":" port] This is represented in a syntax diagram as: The URI comprises: A non-empty component followed by a colon ( : ), consisting of a sequence of characters beginning with a letter and followed by any combination of letters, digits, plus ( + ), period ( . ), or hyphen ( - ). Although schemes are case-insensitive, the canonical form is lowercase and documents that specify schemes must do so with lowercase letters.
Examples of popular schemes include http , https , ftp , mailto , file , data and irc . URI schemes should be registered with the Internet Assigned Numbers Authority (IANA), although non-registered schemes are used in practice.
An optional component preceded by two slashes ( // ), comprising: An optional subcomponent followed by an at symbol ( @ ), that may consist of a user name and an optional password preceded by a colon ( : ). Use of the format username:password in the userinfo subcomponent is deprecated for security reasons.
Applications should not render as clear text any data after the first colon ( : ) found within a userinfo subcomponent unless the data after the colon is the empty string (indicating no password). A subcomponent, consisting of either a registered name (including but not limited to a hostname) or an IP address.
IPv4 addresses must be in dot-decimal notation, and IPv6 addresses must be enclosed in brackets ( [] ). An optional subcomponent preceded by a colon ( : ), consisting of decimal digits. A component, consisting of a sequence of path segments separated by a slash ( / ).
A path is always defined for a URI, though the defined path may be empty (zero length). A segment may also be empty, resulting in two consecutive slashes ( // ) in the path component. A path component may resemble or map exactly to a file system path but does not always imply a relation to one.
If an authority component is defined, then the path component must either be empty or begin with a slash ( / ). If an authority component is undefined, then the path cannot begin with an empty segment—that is, with two slashes ( // )—since the following characters would be interpreted as an authority component.
By convention, in http and https URIs, the last part of a path is named and it is optional. It is composed by zero or more path segments that do not refer to an existing physical resource name (e.g. a file, an internal module program or an executable program) but to a logical part (e.g. a command or a qualifier part) that has to be passed separately to the first part of the path that identifies an executable module or program managed by a web server; this is often used to select dynamic content (a document, etc.) or to tailor it as requested (see also: CGI and PATH_INFO, etc.). Example: URI: where: is the first part of the path (an executable module or program) and is the second part of the path named pathinfo, which is passed to the executable module or program named to select the requested document.
An http or https URI containing a pathinfo part without a query part may also be referred to as a 'clean URL,' whose last part may be a 'slug.' An optional component preceded by a question mark ( ? ), consisting of a query string of non-hierarchical data. Its syntax is not well defined, but by convention is most often a sequence of attribute–value pairs separated by a delimiter.
An optional component preceded by a hash ( # ). The fragment contains a fragment identifier providing direction to a secondary resource, such as a section heading in an article identified by the remainder of the URI. When the primary resource is an HTML document, the fragment is often an id attribute of a specific element, and web browsers will scroll this element into view.
The scheme- or implementation-specific reserved character + may be used in the scheme, userinfo, host, path, query, and fragment, and the scheme- or implementation-specific reserved characters ! , $ , & , ' , ( , ) , * , , , ; , and = may be used in the userinfo, host, path, query, and fragment. Additionally, the generic reserved character : may be used in the userinfo, path, query and fragment, the generic reserved characters @ and / may be used in the path, query and fragment, and the generic reserved character ? may be used in the query and fragment.
URL munging is a technique by which a command is appended to a URL, usually at the end, after a "?" token. It is commonly used in WebDAV as a mechanism of adding functionality to HTTP. In a versioning system, for example, to add a "checkout" command to a URL, it is written as http://editing.com/resource/file.php?command=checkout .
It has the advantage of both being easy for CGI parsers and also acts as an intermediary between HTTP and underlying resource, in this case.
See also
Linked data Extensible Resource Identifier Internationalized Resource Identifier (IRI) Internet resource locator Persistent uniform resource locator Uniform Naming Convention Resource Directory Description Language Universally unique identifier List of URI schemes Resource Description Framework
External links
URI Schemes – IANA-maintained registry of URI Schemes URI schemes on the W3C wiki Architecture of the World Wide Web, Volume One, §2: Identification – by W3C W3C URI Clarification
Text derived from https://en.wikipedia.org/w/index.php?oldid=1378457380 under CC BY-SA 4.0; modifications have been made.
References
- ↩Wikipedia “Uniform Resource Identifier” publication date (×1) · confidence 0.95 revision URL