Differences and connections between URI, URL, and URN
Source: Internet
Author: User
URI, URL, and URN differences and connections URI: Uniform Resource Identifier, unified Resource Identifier;
URL: Uniform Resource Locator, which is a unified Resource Locator;
URN: Uniform Resource Name.
URL and URN are the subset of URIs.
The basic form of the address on the Web is URI, which represents a unified resource identifier. There are two forms:
URL: currently, the most common form of URI is the ubiquitous URL or unified resource locator.
URN: An Update Form of a URL. The Uniform Resource Name (URN, Uniform Resource Name) does not depend on the location, and may reduce the number of invalid connections. However, its popularity still takes time because it requires support from more sophisticated software.
URI is a simple string that identifies a resource in a unified (standardized) manner.
A URI consists of three parts:
1. Resource Access naming mechanism.
2. Host Name for storing resources.
3. The name of the resource, represented by the path.
In typical cases, this string starts with scheme (the identifier of the namespace named URI -- a group of related names). The syntax is as follows:
[Scheme:] scheme-specific-part
URI starts with scheme and colon. Scheme starts with an upper/lower-case letter and is left blank or followed by more upper/lower-case letters, numbers, plus signs, minus signs, and periods. The colon separates scheme from scheme-specific-part, and the syntax and meaning of scheme-specific-part are determined by the URI namespace. Example:
Http://www.cnn.com where http is scheme, // www.cnn.com is scheme-specific-part, and its scheme and scheme-specific-part are separated by colons.
URI has absolute and relative values. Absolute URI refers to the URI starting with scheme (followed by a colon. The http://www.cnn.com mentioned above is an example of absolute URI, and other examples include mailto: jeff@javajeff.com, news: comp. lang. java. help and xyz: // whatever. You can regard the absolute URI as a reference to a resource in some way, and this method does not depend on the environment where the identifier appears. If you use a file system for analogy, the absolute URI is similar to the path of a file starting from the root directory.
Unlike the absolute URI, the relative URI is not a URI starting with scheme (followed by a colon. One example is articles/articles.html. You can regard the relative URI as a reference to a resource in a certain way, which depends on the environment where the identifier appears. If the file system is used as an analogy, the relative URI is similar to the file path starting from the current directory.
URL is the abbreviation of Uniform Resource Location ". Generally speaking, URL is a string used to describe information resources on the Internet. It is mainly used in various WWW client programs and server programs, especially the famous Mosaic. URL can be used to describe various information resources in a unified format, including files, server addresses and directories.
The URL format consists of the following three parts:
The first part is the protocol (or service mode );
The second part is the Host IP address (sometimes including the port number) that contains the resource );
The third part is the specific address of the host resource ., Such as directories and file names.
The first part and the second part are separated by the ": //" symbol, and the second and third parts are separated by the "/" symbol. The first part and the second part are indispensable, and the third part can be omitted sometimes.
At present, the biggest drawback is that when the storage location of information resources changes, the URL must be changed accordingly. Therefore, people are studying new information Resource representation methods, such as URI (Universal Resource Identifier), which is the "general Resource Identifier" (see RFC 1630), and URN (Uniform Resource Name) that is, "unified Resource Name" and URC (Uniform Resource Citation) are "unified Resource quote.
URI is currently under further research. The research direction is to make up for the shortcomings of the URL.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.