Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Namespace
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Naming system== A name in a namespace consists of a namespace name and a local name.<ref>{{cite web | url=http://www.w3.org/TR/REC-xml-names/ | title= Namespaces in XML 1.0 (Third Edition) | author=XML Core Working Group | work=W3C |date=8 December 2009 |access-date=2012-03-30}}</ref><ref>{{cite IETF |title=URN Syntax |rfc=2141 |sectionname=Syntax |section=2 |page=1 |last= Moats |first= Ryan |date=May 1997 |publisher=[[Internet Engineering Task Force|IETF]] |access-date= 2012-03-30}}</ref> The namespace name is usually applied as a [[Prefix (computer science)|prefix]] to the local name. In [[augmented Backus–Naur form]]: <syntaxhighlight lang=abnf> name = <namespace name> separator <local name> </syntaxhighlight> When local names are used by themselves, [[Name resolution (programming languages)|name resolution]] is used to decide which (if any) particular name is alluded to by some particular local name. ===Examples=== {| class=wikitable |+ Examples of names in a namespace |- ! Context !! Name !! Namespace name !! Local name |- | [[Path (computing)|Path]] || /home/user/readme.txt || /home/user (directory)|| readme.txt (file name) |- | [[Domain name]] || www.example.com || example.com (domain name)|| www (leaf domain name) |- | [[#Use in common languages|C++]] || std::array || std (C++ namespace)|| array (struct) |- | [[UN/LOCODE]] || US NYC || US (country or territory)|| NYC (locality) |- | [[XML namespace|XML]] || xmlns:xhtml="http://www.w3.org/1999/xhtml" <br /> <xhtml:body> || xhtml (previously declared XML namespace xhtml="http://www.w3.org/1999/xhtml")|| body (element) |- | [[Perl module#Perl packages and namespaces|Perl]] || $DBI::errstr || $DBI (Perl module)|| errstr (variable) |- | [[Java package|Java]] || java.util.Date || java.util (Java namespace)|| Date (class) |- | [[Uniform Resource Name]] (URN) || urn:nbn:fi-fe19991055 || urn:nbn (National Bibliography Numbers) || fi-fe19991055 |- | [[Handle System]] || 10.1000/182 || 10 (handle naming authority) || 1000/182 (handle local name) |- | [[Digital object identifier]] || 10.1000/182 || 10.1000 (publisher) || 182 (publication) |- | [[MAC address]] || 01-23-45-67-89-ab || 01-23-45 ([[organizationally unique identifier]]) || 67-89-ab (NIC specific) |- | [[PCI ID]] || 1234 abcd || 1234 (vendor ID) || abcd (device ID) |- | [[USB Implementers Forum#Obtaining a vendor ID|USB VID/PID]] || 2341 003f<ref> Stephen J. Gowdy. [http://www.linux-usb.org/usb.ids "List of USB ID's"]. 2013. </ref> || 2341 (vendor ID) || 003f (product ID) |- | [[SPARQL]] || dbr:Sydney || dbr (previously declared ontology, e.g. by specifying @prefix dbr: <http://dbpedia.org/resource/>) || Sydney |} ===Delegation=== Delegation of responsibilities between parties is important in real-world applications, such as the structure of the World Wide Web. Namespaces allow delegation of identifier assignment to multiple name issuing organisations whilst retaining global uniqueness.<ref>{{cite IETF |title= Functional Requirements for Uniform Resource Names |rfc=1731 |sectionname=Requirements for functional capabilities |section=2 |page=3 |last= Sollins & Masinter |date=December 1994 |publisher=[[Internet Engineering Task Force|IETF]] |access-date= 2012-03-30}}</ref> A central [[Registration authority]] registers the [[National Internet registry|assigned namespace names allocated]]. Each namespace name is allocated to an organisation which is subsequently responsible for the assignment of names in their allocated namespace. This organisation may be a name issuing organisation that [[Metadata registry|assign the names]] themselves, or another [[Registration authority]] which further delegates parts of their namespace to different organisations. ===Hierarchy{{anchor|hierarchical namespace}}=== A naming scheme that allows subdelegation of namespaces to third parties is a '''hierarchical namespace'''. A hierarchy is recursive if the syntax for the namespace names is the same for each subdelegation. An example of a recursive hierarchy is the [[Domain name|Domain name system]]. An example of a non-recursive hierarchy are [[Uniform Resource Name]] representing an [[Internet Assigned Numbers Authority]] (IANA) number. {| class=wikitable |+ Hierarchical namespace breakdown for urn:isbn:978-3-16-148410-0, an identifier for the book The Logic of Scientific Discovery by Karl Popper, 10th edition. |- ! Registry !! Registrar !! Example Identifier !! Namespace name !! Namespace |- | [[Uniform Resource Name]] (URN) || [[Internet Assigned Numbers Authority]] || urn:isbn:978-3-16-148410-0 || urn || [https://www.iana.org/assignments/urn-namespaces/urn-namespaces.xml Formal URN namespace] |- | [[Uniform resource name|Formal URN namespace]] || [[Internet Assigned Numbers Authority]] || urn:isbn:978-3-16-148410-0 || ISBN || [http://tools.ietf.org/html/rfc3187 International Standard Book Numbers as Uniform Resource Names] |- | [[International Article Number (EAN)]] || [[GS1]] || 978-3-16-148410-0 || 978 || [[List of GS1 country codes|Bookland]] |- | [[International Standard Book Number]] (ISBN) || [[International ISBN Agency]] || 3-16-148410-X || 3 || [[German-speaking countries]] |- | [[International Standard Book Number#Publisher code|German publisher code]] || [http://www.german-isbn.de/ Agentur für Buchmarktstandards] || {{ISBNT|3-16-148410-X}} || 16 || [[Mohr Siebeck]] |} ===Namespace versus scope=== A namespace name may provide context ([[Scope (computer science)|scope]] in computer science) to a name, and the terms are sometimes used interchangeably. However, the context of a name may also be provided by other factors, such as the location where it occurs or the syntax of the name. {| class=wikitable |+Examples of naming systems with local and global scope, and with and without namespaces ! !! Without a namespace !! With a namespace |- | ''Local scope'' || [[Vehicle registration plate]] || [[Filesystem Hierarchy Standard]] |- | ''Global scope'' || [[Universally unique identifier]] || [[Domain Name System]] |}
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)