The URI is a uniform Resource identifier , and the URL is a uniform resource locator . Therefore, generally speaking, each URL is a URI, but not necessarily each URI is a URL. This is because the URI also includes a subclass, the Uniform Resource name (URN), which names the resource but does not specify how to locate the resource. The mailto, news , and ISBN URIs above are examples of urns.
The conceptual differences between URIs and URLs are reflected in the URL
differences between this class and the class.
An instance of this class represents a URI reference in the syntactic sense defined by RFC 2396. The URI can be absolute or relative. The URI string is parsed according to the general syntax, regardless of the scenario it specifies (if any) does not perform a lookup on the host (if any) and does not construct a schema-dependent stream handler. Equality, hash calculations, and comparisons are strictly defined based on the character content of the instance. In other words, a URI instance is similar to a structured string that supports syntactic, schema-dependent comparisons, normalization, parsing, and relative computations.
As a control, an URL
instance of a class represents the syntax component of a URL and the information required to access the resources it describes. The URL must be absolute, that is, it must always specify a scenario. The URL string is parsed according to its schema. Typically a stream handler is established for the URL, and you cannot actually create a URL instance for a scenario that does not provide a handler. Equality and hash calculations depend on the scenario and the host's Internet address, if any, and no comparison is defined. In other words, a URL is a structured string that supports parsing of syntax operations and network I/O operations such as locating a host and opening a connection to a specified resource.
URI, URL, and URN