Shortcut: WD:ID
Wikidata:Identifiers
Wikidata makes use of identifiers for both internal organization of the knowledge base and for its connection to other databases. This page gives an overview about identifiers in Wikidata.
Identifier types
[edit]Wikidata identifiers
[edit]Each Wikidata entity is identified by an entity ID, which is a number prefixed by a letter.
- items, also known as Q-items, are prefixed with
Q
(e.g.Q12345
), - properties are prefixed by
P
(e.g.P569
) and - lexemes are prefixed by
L
(e.g.L1
).
Entity IDs can also be used as globally unique URIs that follow the pattern http://www.wikidata.org/entity/ID
where ID
is an entity ID.
External identifiers
[edit]External identifiers can have
- an item about their system
- a property for storing their value and additional information
Properties to store external identifiers
[edit]Some properties have values that are external identifiers pointing to authority control systems or databases. Examples include an ISBN for a book (ISBN-13 (P212), ISBN-10 (P957)) and the identifier of a movie or an actor in the Internet Movie Database (IMDb ID (P345)). Most of these identifier properties have datatype external identifier (external-id
). All properties with datatype external identifier are listed here and here.
A special subset of identifier properties are used to map Wikidata items to corresponding entities in other databases. These properties should be organized as instances of Wikidata property for authority control (Q18614948) in particular and Wikidata property for an identifier (Q19847637) with its subclasses in general.
A SPARQL query gives all identifier properties with their datatype and class.
Some special identifers properties exist to map Wikidata entities to multiple different external identifier systems or databases:
- instances of Wikidata property for a multi-source identifier (Q21264328) such as house number (P670) and catalog code (P528) only make sense in a given context (expressed via qualifiers).
- instances of Wikidata property for ontology mapping (Q30249126) such as equivalent class (P1709) and external subproperty (P2236) are globally unique but refer to multiple external ontologies.
- What to do when the original source goes offline / the identifier system is retired?
- The standard procedure on Wikidata is to keep old identifiers even when a website goes offline. You may tag it with Wikidata property for a discontinued website (Q60457486), and if applicable update the formatter URL (P1630) to use the Wayback Machine (Q648266)
Items about identifiers
[edit]Identifier items in Wikidata are disputed so there is no best practice right now!
Wikidata contains several items about identifiers from general (unique identifier (Q6545185), code (Q188889), biometric identifier (Q11854279), ...) to specific (...). Most of these items are connected via properties such as instance of (P31), subclass of (P279), and part of (P361) but there is no consensus because definitions of identifiers differ with context and language. An attempt to differentiate identifier items gives three types of items:
- classes of identifiers such as organization identifier (Q11378663), postal code (Q37447), and name (Q82799)
- identifier systems such as International Standard Book Number (Q33057), ISO 3166-2 (Q19832961), ICAO airport code (Q207529), and ORCID iD (Q51044)
- individual identifiers such as 10048 (Q4546087) refer to a specific number, code or unique name. Items about individual identifiers are exceptions and should not be created massively.
Most identifier systems belong to an organization, database, and/or knowledge organization system (Q6423319) so there is not always an independent Wikidata item for the identifier but sometimes only for the system or organization which identifiers belong to.
Identifier items and identifier properties can be connected via Wikidata property (P1687) and Wikidata item of this property (P1629).
Identifier values
[edit]Identifier values include all statements with identifier properties and some individual identifer items. If an identifier property has a statement with formatter URI for RDF resource (P1921), the identifier value in RDF can be constructed with this URI template.
Wikidata items having a given identifier as value with some given identifier property can be queried via SPARQL query service, Linked Data Fragments, and additional tools such as Wikidata resolver. To find a match you must use the full exact string form of the identifier. Finding a match based on just part of an identifier requires a significantly more complex SPARQL query.
Identifier lookup
[edit]List all identifiers of a given property that are stored in Wikidata
[edit]SELECT ?item ?itemLabel ?id WHERE {
?item wdt:P4466 ?id
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
wdmapper command line tool
$ wdmapper -g en get P4466
See also
[edit]- Wikidata:Identifier migration contains background and discussion about migration of properties with datatype string to datatype external identifier when the latter was introduced.
- Help:Authority control describes how to migrate existing identifiers from Wikipedia to Wikidata.
- Help:Properties
- Wikidata:WikiProject Properties
- Wikidata:WikiProject Biographical Identifiers