
URI
A uniform resource identifier, or URI, is a global system of addresses that can be used to give entities unique ids.The specification of URI allows for globally unique ids to be managed by different authorities such as governments, organizations and individuals.
URI = scheme:[//authority]path[?query][#fragment]
In many cases, a URI doesn't use all the elements above. For example, a phone number can be viewed as a URI that only uses a path.
+1-816-555-1212
URI = scheme:[//authority]path[?query][#fragment]
In many cases, a URI doesn't use all the elements above. For example, a phone number can be viewed as a URI that only uses a path.
+1-816-555-1212
ISBN
ISBN, or International Standard Book Number, is a type of URI that gives almost every book a unique id. This can be used on a global basis and is organized such that countries and publishers are allocated ISBN prefixes that they can self-manage.ISBN 978-0395489321 is an identifier for The Lord of the Rings by J. R. R. Tolkien and illustrated by Alan Lee.
URL
A URI is often just an ID that gives no information on where to find an entity. A URL, or universal resource locator, is a type of URI that tells you how to access an entity.The URL of this article is https://simplicable.com/new/namespace
Hierarchical Namespaces
It is common for namespaces to be hierarchical.A URL contains:
Protocol: https
Hostname: simplicable.com
Path: /new/
File name: "namespace"
This is extremely functional as it allows the management of namespaces to be distributed on a global basis such as a webmaster who can create as many URLs as they want under a hostname that they control.Protocol: https
Hostname: simplicable.com
Path: /new/
File name: "namespace"
Packages
Java packages are a way of organizing code in the Java programming language by placing all classes into a global hierarchical structure. This often begins with "com" for "commercial" followed by the name of the organization that produced the code. The organization can add a hierarchy of any length under this path. For example:com.simplicable.mobile.android.utils.EventLog
In this example, "EventLog" is an extremely common class name. However the path of "com.simplicable.mobile.android.utils." makes it specific to an organization and a detailed context.Name Collisions
Name collisions occur when two things have the same name such that there is ambiguity. Namespaces allow things to be distinguishable even if they have the same name. For example, there may be many people named Mary Smith such that an email address called "Mary Smith" wouldn't be addressable. Email addresses use a hostname as a namespace to reduce name collisions.mary.smith@someorganization.com
Name collisions can still occur, particularly for email services that have a large number of users. This requires users to pick obscure addresses such as mary.smith27@someorganization.com.File Systems
File systems are a type of hierarchical namespace whereby a file path serves as a unique container for files. This allows files to have the same name while avoiding name collisions./home/sarah/media/2020/pauls-birthday/image1.jpg
/home/paul/media/2020/sarahs-birthday/image1.jpg
/home/paul/media/2020/sarahs-birthday/image1.jpg
Permalink
A permalink is a URL that is intended to remain stable such that it points to the same resource for many years. These are often designed to be human readable and simple to build trust that they will not change. It is a best practice to create redirects when a URL does change so that links to a resource still work.Unique Key
A unique key is the minimum set of attributes in a database table that are guaranteed not to be duplicated such that at most one row exists for each combination. For example, a first name combined with a phone number may be constrained to be unique in a customer table. This prevents you from putting two customers with the same name and phone number into the table. A unique key is essentially a namespace for a database table.CREATE TABLE CUSTOMER (
LAST_NAME varchar(255) NOT NULL,
FIRST_NAME varchar(255) NOT NULL,
PHONE_NUMBER varchar(55) NOT NULL,
CONSTRAINT CUSTOMER UNIQUE (FIRST_NAME,PHONE_NUMBER)
);
This represents a namespace for customers of first_name.phone_number
LAST_NAME varchar(255) NOT NULL,
FIRST_NAME varchar(255) NOT NULL,
PHONE_NUMBER varchar(55) NOT NULL,
CONSTRAINT CUSTOMER UNIQUE (FIRST_NAME,PHONE_NUMBER)
);
This represents a namespace for customers of first_name.phone_number
Overview: Namespace | ||
Type | ||
Definition (1) | An address that is given to an entity. | |
Definition (2) | Systems for creating addresses to compliment names for entities that help to prevent name collision. | |
Related Concepts |