What are URI and URI Schemes?
Tips / 08.04.2024
In today’s digital era, the world of financial transactions is rapidly transforming.
With technological innovations and the rising need for seamless payment experiences that become a significant factor, the online payments industry must adapt to meet new expectations.
One key element at the heart of this transformation is the Uniform Resource Identifier or URI.
In the following sections, we explain what URI means, what URI Scheme is, how to create a URI, and why all of this matters.
TABLE OF CONTENTS
What is URI?
URI stands for Uniform Resource Identifier and represents a character string or sequence designed to identify internet resources and any other logical or physical resource.
There are two types of URI – Uniform Resource Name (URN) and Uniform Resource Locator (URL). We’ll explain what they are in more detail later in this article.
Understanding the URI structure
To fully understand how a URI works, it’s crucial to explore its generic syntax.
In short, it looks like this:
- scheme:[//authority]path[?query][#fragment]
Below, we dive deeper into each component that shapes the URI syntax.
What is a URI Scheme?
URI schemes are the first element of a Uniform Resource Name and take the role of determining the addressing system or assigning identifiers.
While some URI schemes are designed to enable resource access, the protocol may not be specified in other cases.
As an illustration, a scheme is employed in web browsers, where the resource is inherent to the client and lacks association with any particular protocol.
The URI scheme can feature digits, letters, periods, plus signs, hyphens, and colons.
Some of the most popular URI schemes are:
- HTTP (Hypertext Transfer Protocol);
- HTTPS (Hypertext Transfer Protocol Secure);
- FTP;
- Mailto;
- File.
For example, in cases where the URL is file:website.com/pathtofile/intro.pdf, the scheme name is file.
What is an Authority Component?
The Authority Component is a non-mandatory part of the URI syntax initiated by a double slash and concluded by a slash, a question mark, or a hash symbol, implying a hierarchical structure.
To be complete, it must include the following three components:
- Userinfo – It consists of a username and password divided by a colon;
- Host – It can feature a registered name or an IP address;
- Port – It is a web server connection protocol that represents a non-mandatory sub-component succeeding a colon.
Taking the example above, in the case of file:website.com/pathtofile/intro.pdf, the Authority Component is website.com/.
What is Path?
The Path component consists of a series of data sections uncovering the whereabouts of a resource within a directory framework. It may be vacant or divided by a forward slash.
For instance:
URI:telnet://192.0.2.16:80/.
Here, “telnet” represents the Scheme Name, while the numbers following the double slash are the Authority. In this example, there is no data after the slash. It means that the path is empty.
What is a Query Component?
A query is an element within a URI that can hold non-hierarchical data as a query string, typically composed of key=value pairs.
It’s an optional component denoted by a question mark.
For instance, if the URI is https://example.org/test/test1?search=test-question#part2, search=test-question is the Query Component.
What is a Fragment Component
Last but not least, the Fragment Component is an additional element encompassing a fragment identifier that guides a secondary resource, pinpointing a distinct section within the primary resource.
Prefixed by a hash symbol, fragment identifiers conclude at the URI’s end.
For example, for a URI in the form of https://example.org/test/test1?search=test-question#part2, the Fragment Component is part2.
The types of URIs
Earlier, we mentioned that there are two main types of Uniform Resource Identifiers: URNs and URLs.
Although these acronyms (URI, URN, and URL) are often used interchangeably, they represent different things.
Below, we uncover the peculiarities of the two types of Uniform Resource Identifiers.
Uniform Resource Locators (URLs)
In simple terms, the URL is a type of URI that identifies a specific web address online.
The Uniform Resource Locator defines the means to access the physical location by describing the primary access mechanism or network location. The resource identifiers here can be used to locate videos, images, web pages, or any other online publication.
The structure of URLs is slightly more complicated than that of URNs.
They consist of the following elements that shape the URI syntax:
- Authority – The target being accessed, divided into host, userinfo, and port;
- Scheme – The protocols being used to interact;
- Query – The parameters utilised within the web application for various functions and operations;
- Path – The specified resource that the user is requesting on the host;
- Fragment – The fragment component represents the designated destination within a specific web page that users can navigate to directly.
Every URL must abide by the rules of the URI syntax. Here’s an example of a URL syntax:
- https://www.example.com/forum/questions/?tag=networking&order=newest#top
Just like the URI, this internet resource identifier consists of the following:
- URL Schemes;
- URL Authority;
- URL Path;
- URL Query String;
- URL Fragment Identifiers.
Here’s what you need to know about each.
URL Scheme
The URL syntax begins with the Scheme – a protocol designed to find a resource. URL schemes define the application type your device uses to launch a URL.
For instance, FaceTime relies on the URL scheme facetime:// to initiate calls.
Other commonly employed protocols for URL schemes encompass:
- HTTP – A Hypertext Transfer Protocol that enables the use of hypertext links to access web page data;
- HTTPS – Serves to secure data being sent between a website and a browser;
- FTP – Facilitates file transfers across different devices through a network.
But the URL Scheme is just part of the equation. Below, we explore the additional components that are essential for URLs.
URL Authority
URL Authority consists of a domain name (the registered resource name, for example – facebook.com) and a port (the identifier number that represents the web service you’re requesting on a web server).
URL Path
The Path defines the specific web page location, post location, or file location within the domain name.
In addition, this component also includes any asset file extensions, like documents or images.
For example, in the general case of URIs, not all URLs indicate the path component, as it can sometimes be an empty string.
URL Query String
The Query String shows information about the web server’s resources. It comes after a question mark and, in most cases, includes a key and a value pair divided by an ampersand.
Because the HTTP protocol is stateless, the Query String is responsible for recording information. It makes every request autonomous, eliminating the need for any relation to previous requests.
Consequently, if the user request ends or expires, the connection between a web browser and a web server will automatically be closed.
URL Fragment Identifiers
Also known as an Anchor, the Fragment Identifier in the URl syntax comes at the very end of the URL.
It acts as the director of a web browser to a secondary resource and identifies specific sections of a page.
It’s important to note that not all URIs are persistent and independent of location.
While URLs fall under this category, URNs don’t. This is because the URL, as a URI, identifies only the path to the resource. In cases where the location changes, its validity will expire.
Uniform Resource Names (URNs)
A URN is a location-independent identifier with the task of persistently and permanently identifying a resource. Even if the resource’s location changes and the information is transferred elsewhere, URNs will ensure the resource maintains its validity.
To make this possible, the URN relies on a scheme to separate one resource from another.
For instance, a real-life example could be:
- urn:isbn:0405999832
This URN identifies a book using its International Standard Book Number (ISBN). As the explanation above suggests, it provides a persistent and location-independent identifier for the book, regardless of where it is stored or accessed.
To be able to operate properly, URNs require a minimum of three elements:
- A “urn” prefix – All URNs use the “urn” prefix as a scheme description;
- A namespace identifier – The NID namespace identified must be recorded in the IANA (Internet Assigned Numbers Authority) and could consist of digits, letters, hyphens, or colons.
- A namespace-specific string – NSS is a string that reveals internet resources. In addition to ASCII codes, it could also feature punctuation marks, digits, and other special characters.
Overall, the key differentiation between URN and URL is that Unique Resource Names only reveal a resource’s name. On the other hand, Unique Resource Locators require access and protocols to detect the resource location.
Additional aspects of URIs: URI reference and resolution
Now that we’ve laid out the foundations behind URIs, it’s key to dive into more detail into its additional aspects.
URI resolution represents the identification of the appropriate data access method and parameters necessary to detect and recover the asset that the URI represents. This operation is frequently performed on URIs that also act as URLs.
On the other hand, URI references define common usage for a URI. They can either be presented as a full URI, a segment of a complete URI, or an empty string.
While a URI reference can be a URI, it can also represent a relative reference, meaning that the prefix differs from the Scheme’s syntax.
How and where is URI used?
In its essence, a URI is used to identify resources such as web pages, HTML documents, images, files, services, and more on the internet or in any other context.
It enables the creation of standard rules for users operating with the same resource. For example, URIs allow for regulated access, updates, discovery, and downloads of resources.
URIs are mostly used when a resource needs to be identified.
Based on whether you are using a URL or a URN, you can rely on URIs for:
- Redirecting resources – URLs can be used to send old resources to a new location when moving a webpage or migrating entire websites.
- Linking a file within the same domain – URLs are often used to refer to an internal page as they can be presented without a protocol and a domain name – they only show the path. It enables linking a file in the same domain or a relative URL.
- Remote access – Some network protocols like Telnet rely on URIs to delineate access to a distant computer or host online.
- Telephone numbers – URIs can determine a specific resource via a dial string with an NTP (Network Termination Point) that has the necessary data to route the call.
- Payment links – Payment service providers today rely on payment links created via URIs that can help navigate users to payment pages.
- Payment gateways – Thanks to URIs, payment gateways can safely and securely communicate with financial institutions, processors, and other parties. They can be utilised for the exchange of transaction data, the authentication of requests, and more.
The use of URIs stems from the vast range of benefits they offer.
For instance, they have the power to minimise uncertainties by offering unique schemes to help identify resources and separate them on the semantic web.
In addition, URIs provide uniformity by making a resource identified and enabling various resource identifiers to be utilised in the same context, thanks to a shared syntax.
How can you create a URI?
You must follow the URI syntax explained above to create a URI. It’s also essential to include all key components and strictly follow the syntax rules defined in the URI specification to have an operating URI.
First, you’ll need to choose a Scheme based on your goals. Next, determine the Authority. Where necessary, include the Authority Component in the string, providing data like the domain name or IP address for web resources.
Third, you’ll need to define the Path, which states the location of the resource inside the server’s directory structure.
If applicable, include additional optional components, like Query Parameters and Fragment Identifiers.
Finally, all components are combined to form a single string and a complete URI.
Conclusion
Without URIs, the payment industry wouldn’t be the one we know today.
As essential identifiers and communication mechanisms in the payments industry, URIs facilitate reliable and secure transaction processing in the UK and globally.
Frequently Asked Questions
What is URI, in short?
URI or Uniform Resource Identifier is a string of characters used to identify a resource on the internet or another network.
What’s the difference between URI and URL?
A URL is a type of URI. The key difference between the two is that while a URL only offers the location of a resource, a URI can represent a name, a location, or both. In short, a URI simply identifies a resource.
How are URIs used in web development?
URIs play a crucial role in web development for specifying resource locations, creating hyperlinks, handling form submissions, and interacting with web services and APIs.
What is the importance of URIs in the Semantic Web?
In the Semantic Web, URIs are used to uniquely identify resources and enable the exchange and integration of data across different systems and domains.