We've all probably heard the term URL. When we hear the term, we usually interpret it as a hyperlink. What about URIs, then? This term is probably still known by a few people.
URI is an abbreviation for Uniform Resource Identifier. is a distinct text or character used to identify internet resources. Continue reading to learn more about what a URI is and how it differs from a URL!
What are URIs?
A URI is a generic character that identifies a web resource by its name, location, or both names and locations, and whether or not the resource is available on the internet.
URL (Uniform Resource Locator) and URN (Uniform Resource Name) are two specializations or subsets of URI (Uniform Resource Name). This is the URL we use the most on a daily basis. The URL is part of the URI without our knowledge.
The function of URI and URL is the same; that is, they are both used to identify resources; only the structure is different. As explained above, URIs use a name, a location, or both. While the URL only uses the location of the resource, every URL is a URI, but not all URIs are URLs.
How Do URIs Work?
After knowing what a URI is, how does this URI work? Maybe some of you are also wondering what an example of URI syntax looks like. Don't worry because we will discuss it in full below.
URIs provide a simple, extensible way to identify internet resources. But more than that, URIs can also identify various resources, such as .
- Documents
- File
- Books
- Pictures and more.
The general URI syntax is as follows.
[//[user:password@]host[:port]][/]path[?query][#fragment]
From the syntax, it is divided into several elements, including:
Scheme (Skema)
Scheme is the first element in the URI syntax. This element is not case sensitive and then separated from other objects using a colon.
"Scheme is the protocol used to access these resources. There are several commonly used URI schemes such as HTTP, HTTPS, file, mailto, telnet, and many more.
If there is a URI syntax as follows: telnet://192.0.2.16:80 then the scheme is telnet.
Authority. This element consists of several parts, namely:
- Userinfo: is the username and password separated by a colon.
- Host: is a registered IP address or domain name.
- Port: is the protocol used to connect to the server.
If the previous URI syntax was telnet://192.0.2.16:80, there was already a scheme, namely telnet. Then the authority is the numbers after the double slash ( // ).
Another example of URI syntax is file:website.com/pathtofile/document.pdf. Then the authority is website.com.
Path is a path that contains a sequence of data segments to indicate the location of the resource. For example, like the example URI telnet://192.0.2.16:80/.
The example is a valid URI because there is no path pointing to a specific resource location.
Query
A query is an optional component that contains a non-hierarchical data query string. Then it's usually a string pair like key=value that starts with a question mark.
An example of URI syntax is as follows
foo://techtarget.com:8042/over/there?name=parrot#beak
Then the query is name=parrot
Fragment
The last element of the URI is the fragment. As before, this element is optional. The fragment will give direction to the secondary resource. This element usually begins with a hashtag (#).
In the following syntax example,
foo://techtarget.com:8042/over/there?name=parrot#beak
The fragment part is #beak.
Well, those are some elements in the URI syntax that can later help identify the resource being searched for.
Types of URIs
As mentioned earlier, URIs have two subsets or types, namely URLs and URNs. URLs may have often been heard before, but what about URNs? Therefore, just take a look at the explanation below.
URN
The first type of URI is URN. URN is a location-related fixed identifier, meaning that it can identify a resource permanently even if the data is moved to another location.
In this case, the URN uses a schema to distinguish each resource. For example, urn:isbn:0405999832, meaning that this URN will identify a book based on its ISBN number.
Among them are 3 components, among them are
- URN: as in the example above, each URN begins with urn: which is the schema specification.
- NID: is a namespace identifier registered with the IANA (Internet Assigned Numbers Authority) which can be letters, numbers, or hyphens followed by a colon.
- NSS: a special string that identifies internet resources. NSS can be numbers, punctuation marks, or special characters.
URL
Not only does it identify the resource, but the URL also tells how to reach that resource. URLs can indicate the location of a website, video, image, or anything else available online.
If the URN is always the same or permanent, then the URL is different because it also specifies the path to the resource location, which can change over time.
So, the difference between a URN and a URL is that the URN only specifies the name of the resource, while the URL uses an access protocol to get the location of the resource.
Difference between URI and URL
After knowing what a URI is, you should be able to distinguish between a URI and a URL. Well, to make it easier to understand, below is a table of the differences between URIs and URLs that are often confused.
| URI | URL |
| Abbreviation for Uniform Resource Identifier | Abbreviation for Uniform Resource Locator |
| Is a superset of URN and URL | Is a subset or part of the type URI |
| Identify resources and differentiates resources by name, location, or both | Identifying website addresses or specific resource locations
|
| The components are scheme , authority , path (path), query, and fragment | The components are similar to URIs, but the authority URL is the domain name and port.Example |
| URI file: website.com/pathtofile/kesumpulan.pdf | Example URL https://dewaweb.com/ |
| Commonly used for XML, tag files, and other files, such as JSTL and XSL | Commonly used to search web pages on the internet |
| The schema used can be a protocol, or a designation such as HTTP, file, or data | The scheme that URLs use protocols such as HTTP and HTTP and HTTP and HTTP and HTTP and HTTP and HTTP and HTTP and HTTP and HTTP and HTTP and HTTP and HTTP and HTTP and HTTP and HTTP and HTTP and HTTP and HTTP and HTTP and HTTPS |
Do you already understand what URI is?
How do you know what a URI is now? The URI is a character that is used to identify a specific resource not only on the internet but also in other files such as documents, books, and many others.
His name, location, or both his name and location are used in the identification. Understanding the distinction between URI and URL is critical, especially if you own a website. I hope this article was useful!


Post a Comment
Post a Comment