Recent Articles



































Uniform Resource Identifier



         


Internet protocol element. The IETF codified it as RFC 2396, based on earlier proposals from Tim Berners-Lee.

A URI is 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 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.

Do not mistake URL and URI. A URI can be classified as a locator, a name, or both. The term "Uniform Resource Locator" (URL) refers to 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").


[Top]

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 appended to 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 trailing "#" and fragment identifier, if any, must be removed, because it is strictly speaking not part of the URI; it can be used later, if needed. The remainder of the reference, even if it is an empty string, is then resolved to 'absolute' form, unless it is a complete URI already.

URI references are very commonly used in web document markup languages, in places where there is a need to point to other resources, such as external documents or specific portions of the same document, in terms relative to the URI identifying the document that contains the URI reference (or relative to some other established base URI).

[Top]

Example Absolute URIs

[Top]

Example URI references

[Top]

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.

The forthcoming successor to RFC 2396, currently known as RFC 2396bis, will recognize 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 will also explicitly acknowledge 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.

[Top]

URL and URN

A URL, Uniform Resource Locator, is a URI that, via its scheme, implies a location and method of access, perhaps for the retrieval of a representation of a resource.

A URN, Uniform Resource Name, is a URI that that uses the "urn" scheme and that functions only as a name. It can be used to talk about a resource without necessarily implying where or how to find 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.

[Top]

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.

[Top]

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

[Top]

See also

[Top]




  View Live Article   This article is from Wikipedia. All text is available under the terms of the GNU Free Documentation License