It's been explained to me numerous times that all URLs are URIs but not all URIs are URLs. Can anyone give an example of something that is a URI but is not a URL?
A URI is a sequence of characters that identifies a web resource by location, name, or both available on the internet. Whereas, URL is a sequence of characters that only identifies the location of a resource available on the internet.
A URI — short for “Uniform Resource Identifier” — is a sequence of characters that distinguishes one resource from another. For example, foo://example.com:8042/over/there?name=ferret#nose is a URI containing a scheme name, authority, path, query and fragment.
URL and URI, both crucial concepts of the web, are terms that are often interchanged and used. However, they are not the same. The URI can represent both the URL and the URN of a resource, simultaneously, while URL can only specify the address of the resource on the internet.
The URI comprises: A non-empty scheme 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 ( - ).
The example of URI is urn:isbn:0-476-27557-4, whereas the example of URL, is https://google.com. The URI can be used to find resources in HTML, XML, and other files also, whereas, URL can only be used to locate a web page. Each URL can be a URI, whereas all URIs cannot always be URLs. Difference chart between URI and URL
A URI has two subsets; URL (Uniform Resource Locator) and URN (Uniform Resource Number). If it contains only a name, it means it is not a URL. Instead of directly URI, we mostly see the URL and URN in the real world. A URI contains scheme, authority, path, query, and a fragment.
The term identifier within the URI refers to the prominence of the resources, despite the technique used. The former category in URI is URL, during which a protocol is employed to specify the accessing method of the resource and resource name is additionally laid out in the URL.
A Uniform Resource Name (URN) is a URI that identifies a resource by name in a particular namespace. A URN can be used to talk about a resource without implying its location or how to access it. For example, the URN urn:isbn:0-395-36341-1 is a URI.
Example stolen from here (where there is also a description of the differences):
URL http://www.pierobon.org/iis/review1.htm URN www.pierobon.org/iis/review1.htm#one URI http://www.pierobon.org/iis/review1.htm.html#one
urn:isbn:0451450523
http://en.wikipedia.org/wiki/Uniform_Resource_Name
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With