Search

The Online Encyclopedia and Dictionary

 
     
 

Encyclopedia

Dictionary

Quotes

 

Uniform Resource Identifier

A Uniform Resource Identifier (URI), is an Internet protocol element consisting of a short string of characters that conform to a certain syntax. The string indicates a name or address that can be used to refer to an abstract or physical resource. The IETF first codified it as RFC 2396, based on earlier proposals from Tim Berners-Lee. After being updated by RFC 2732 and then going through a number of draft revisions under the title rfc2396bis, a revised version of the standard was issued in January 2005 as RFC 3986.

The URI syntax is essentially a URI scheme name like "http", "ftp", "mailto", "urn", etc., followed by a colon character, and then a scheme-specific part. The semantics of the scheme-specific part are determined by the specifications that govern the schemes, although the URI syntax does force all schemes to reserve certain characters for special purposes, without always saying what those purposes are. The URI syntax also enforces restrictions on the scheme-specific part, in order to, for example, provide for a degree of consistency when the part has a hierarchical structure.

URIs are a superset of the more commonly-known Uniform Resource Locator used for website addressing. A URI can be classified as a locator, a name, or both. URLs are the subset of URIs that, in addition to identifying a resource, provide a means of locating the resource by describing its primary access mechanism (e.g., its network "location").

Contents

URI reference

A URI reference is another type of string that represents a URI, and, in turn, the resource identified by that URI. The distinction between a URI and a URI reference is not often maintained in informal usage, but protocol documents should not allow for ambiguity.

A URI reference may take the form of a full URI, or just the scheme-specific portion of one, or even some trailing component thereof —even the empty string. An optional fragment identifier, preceded by "#", may be present at the end of a URI reference. The part of the reference before the "#" indirectly identifies a resource, and the fragment identifier identifies some portion of that resource.

In order to derive a URI from a URI reference, the URI reference is converted to "absolute" form by merging it with an absolute "base" URI, according to a fixed algorithm. Unless it is an absolute URI already, the URI reference is considered to be relative to the base URI. The base URI is typically the URI that identifies the document containing the URI reference, although this can be overridden by declarations made within the document or as part of an external data transmission protocol. If a fragment identifier is present in the base URI, it is ignored during the merging process. If a fragment identifier is present in the URI reference, it is preserved during the merging process.

In web document markup languages, URI references are frequently used in places where there is a need to point to other resources, such as external documents or specific portions of the same logical document.

Examples of URI references in markup languages

  • In HTML, the value of the src attribute of the img element is a URI reference, as is the value of the href attribute of the a element.
  • In XML, the system identifier appearing after the SYSTEM keyword in a DTD is a fragmentless URI reference;
  • In XSLT, the value of the href attribute of the xsl:import element/instruction is a URI reference, as is the first argument to the document() function.

Examples of absolute URIs

  • http://somehost/absolute/URI/with/absolute/path/to/resource.txt
  • ftp://somehost/resource.txt
  • urn:issn:1535-3613

Examples of URI references

  • http://example/resource.txt#frag01
  • http://somehost/absolute/URI/with/absolute/path/to/resource.txt
  • /relative/URI/with/absolute/path/to/resource.txt
  • relative/path/to/resource.txt
  • ../../../resource.txt
  • resource.txt
  • /resource.txt#frag01
  • #frag01
  • [empty string]

URI resolution

To "resolve" a URI means either to convert a relative URI reference to absolute form, or to dereference a URI or URI reference by attempting to obtain a representation of the resource that it identifies. The "resolver" component in document processing software generally provides both services.

According to RFC 2396, if a URI reference is an empty string, or consists of only the "#" character followed by an optional fragment, then the reference is considered to be a same-document reference: a reference to the document containing the reference itself. Document processing software is encouraged to use its current representation of the document to satisfy the resolution of a same-document reference; a new representation should not be fetched. This is only a recommendation, and document processing software is free to use other mechanisms to determine whether obtaining a new representation is warranted.

RFC 3986, the successor to RFC 2396, instead recognizes that a URI reference is a same-document reference if, when resolved to absolute form, it is identical to the base URI that is in effect for the reference. Typically, the base URI is the URI of the document containing the reference. XSLT 1.0, for example, has a "document" function which, in effect, implements this functionality. The specification also explicitly acknowledges that an application is free to use URI equivalence (a concept it formally describes) or other means in order to establish whether a URI reference is a same-document reference.

URL and URN

A URN, Uniform Resource Name, is a URI that uses the "urn" scheme and that functions only as a name. It can be used to talk about a resource without implying its location or how to dereference it. For example, urn:ISBN:0-395-36341-1 is a URN that, like an ISBN book number, allows one to talk about a book, but doesn't suggest where and how to obtain an actual copy of it.

The contemporary point of view among the working group that oversees URIs is that the terms URL and URN are context-dependent aspects of URI and rarely need to be distinguished. Furthermore, the term URL is increasingly becoming obsolete, as it is rarely necessary to differentiate between URLs and URIs, in general.

Registration of URI scheme names

The top level of the URI naming structure is the definition of URI schemes. RFC 2717 describes the procedures for registering new URI schemes.

Relation to XML namespaces

XML has a concept of a namespace, an abstract domain to which a collection of element and attribute names can be assigned. An XML namespace is identified by a character string, the namespace name, which must adhere to the generic URI syntax. However, the namespace name is not considered to be a URI. There has been much debate about this, and some feel that it could be a URI, since the abstract concept that is a particular namespace could be considered to be a resource that is being identified. The consensus seems to be, though, that a namespace name is just a string that happens to look like a URI, nothing more.

Initially, the namespace name was allowed to match the syntax of any non-empty URI reference, but the use of relative URI references was later deprecated by an erratum to the Namespaces In XML Recommendation.

In order to mitigate the confusion that began to arise among newcomers to XML from the use of the URI syntax in namespace names, a descriptive language called RDDL was developed. An RDDL document can provide machine- and human-readable information about a particular namespace and about the XML documents that use it. XML document authors were encouraged to put RDDL documents in locations such that if a namespace name in their document was somehow dereferenced, then an RDDL document would be obtained, thus satisfying the arguably misguided desire among developers for a namespace name to point to a network-accessible resource.

See also

External links

The contents of this article are licensed from Wikipedia.org under the GNU Free Documentation License. How to see transparent copy