WikidataData
✖
WikidataData
Details and Options




- WikidataData retrieves data from Wikidata's SPARQL endpoint.
- Each item and property can be specified as an ExternalIdentifier object, a URL or a raw Wikidata identifier like "Q15241057" or "P31".
- Raw Wikidata identifiers are conventionally of the form "Qnnn" for items and "Pnnn" for properties.
- The following properties are also supported:
-
"Label" the label of the item "Description" the description of the item "AlternativeLabels" alternate labels of the item "WikidataID" the ExternalIdentifier["WikidataID",…] object corresponding to the item "Entity" entities corresponding to the item - Any type from $ExternalIdentifierTypes can be used as a property to request an ExternalIdentifier object of the specified type.
- WikidataData[item,"Properties"] gives a list of all available properties for the specified item. Named subsets of available properties can be obtained with WikidataData[item,"sname"]. Possible values for "sname" include:
-
"IdentifierProperties" external identifier properties "NonIdentifierProperties" all properties excluding external identifier properties - An item can also be specified as Entity[…].
- An implicit list of items can be specified as EntityClass[type,{prop1vspec1,…}], where type is an entity type or an ExternalIdentifier object, the propi are EntityProperty or ExternalIdentifier objects, and the vspeci are values or Boolean operators.
- Supported Boolean operators include:
-
EqualTo[x] the value is equal to x UnequalTo[x] the value is unequal to x GreaterThan[x] the value is greater than x GreaterEqualThan[x] the value is greater than or equal to x LessThan[x] the value is less than x LessEqualThan[x] the value is less than or equal to x Between[{min,max}] the value is between min and max MissingQ there is no value for this property Not@*MissingQ there is a value for this property - EntityClass[type,rules] containing a single rule of the form propTakeLargest[n] or propTakeSmallest[n] is also supported.
- WikidataData[itemspec,propspec] returns lists for each value, one additional level if itemspec is a list or is list-like and one additional level if propspec is a list or is list-like.
- WikidataData[itemspec,propspec,"format"] can be used to modify the result format. Possible values for "format" include:
-
"Dataset" a Dataset in which the lowest level keys are the specified items and the second-lowest level keys are the specified properties "Association" a nested association in which the lowest level keys are the specified items and the selcond-lowest level keys are the specified properties - WikidataData[itemspec,pclass,"format"] includes all available properties from the specified property class pclass for each specified item. Possible value for pclass include:
-
All all properties "IdentifierProperties" external identifier properties "NonIdentifierProperties" all properties excluding external identifier properties - The short form WikidataData[itemspec,"format"] is equivalent to WikidataData[itemspec,All,"format"].
- The following options can be given:
-
Language $Language what language to use Method Automatic which statements to select and which information to include in each statement - The setting for Language affects the "Label" and "Description" values of returned ExternalIdentifier objects.
- In Method{opt1val1,…}, the following suboptions opti can be given:
-
"StatementFormat" "Value" what infromation to include for each statement "StatementRank" "Best" which statements to include - Settings for "StatementFormat" include:
-
"Value" the value (default) "Association" an association including the value, qualifiers and references "Dataset" a Dataset including the value, qualifiers and references {"format","opt1"val1,…} suboptions controlling what to include in an association or a dataset All an association including the value, qualifiers and references - The following suboptions can be given:
-
"IncludeQualifiers" Automatic whether to include qualifiers "IncludeReferences" Automatic whether to include references - Settings for "StatementRank" include:
-
"Best" either normal-rank statements, if no preferred statement is available, or preferred statements otherwise (default) "Preferred" preferred statements "Normal" normal-rank statements "Deprecated" deprecated statements "NonDeprecated" normal-rank or preferred statements All all statements
Examples
open allclose allBasic Examples (3)Summary of the most common use cases
Look up the mass of the Moon according to Wikidata:

https://wolfram.com/xid/08vgi1xvuzd639u-jfhkhx

Look up properties available for an item:

https://wolfram.com/xid/08vgi1xvuzd639u-v0j726

Retrieve values for multiple properties:

https://wolfram.com/xid/08vgi1xvuzd639u-sohr43

Retrieve all data available for an Entity and make a Dataset:

https://wolfram.com/xid/08vgi1xvuzd639u-ztr5u6

Scope (2)Survey of the scope of standard use cases
Look up data about a book specified by an ISBN:

https://wolfram.com/xid/08vgi1xvuzd639u-rago4d

Specify a class of lakes using an implicit EntityClass:

https://wolfram.com/xid/08vgi1xvuzd639u-wa1cav
Retrieve the surface area for each lake:

https://wolfram.com/xid/08vgi1xvuzd639u-89zq7e

Options (3)Common values & functionality for each option
Language (1)
Look up the label and description of a Wikidata item in the default language:

https://wolfram.com/xid/08vgi1xvuzd639u-pgixyj

The default language is given by $Language:

https://wolfram.com/xid/08vgi1xvuzd639u-p4zj1w

Look up the label and description in Spanish:

https://wolfram.com/xid/08vgi1xvuzd639u-lbjzkk

Method (2)
Look up the visitors per year of the Smithsonian:

https://wolfram.com/xid/08vgi1xvuzd639u-tjl3py

Return an association including qualifiers and excluding references:

https://wolfram.com/xid/08vgi1xvuzd639u-cdk3ox

By default, only values of best rank are returned:

https://wolfram.com/xid/08vgi1xvuzd639u-dsd0qg

Include any non-deprecated value:

https://wolfram.com/xid/08vgi1xvuzd639u-vpj2xe

Include all values, including deprecated ones:

https://wolfram.com/xid/08vgi1xvuzd639u-tris9c

Applications (1)Sample problems that can be solved with this function
Retrieve life expectancy data, including references and date qualifiers:

https://wolfram.com/xid/08vgi1xvuzd639u-3phopj
Create TimeSeries objects for values claimed by UNESCO:

https://wolfram.com/xid/08vgi1xvuzd639u-ymuvd4


https://wolfram.com/xid/08vgi1xvuzd639u-lam75

Wolfram Research (2020), WikidataData, Wolfram Language function, https://reference.wolfram.com/language/ref/WikidataData.html.
Text
Wolfram Research (2020), WikidataData, Wolfram Language function, https://reference.wolfram.com/language/ref/WikidataData.html.
Wolfram Research (2020), WikidataData, Wolfram Language function, https://reference.wolfram.com/language/ref/WikidataData.html.
CMS
Wolfram Language. 2020. "WikidataData." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/WikidataData.html.
Wolfram Language. 2020. "WikidataData." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/WikidataData.html.
APA
Wolfram Language. (2020). WikidataData. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/WikidataData.html
Wolfram Language. (2020). WikidataData. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/WikidataData.html
BibTeX
@misc{reference.wolfram_2025_wikidatadata, author="Wolfram Research", title="{WikidataData}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/WikidataData.html}", note=[Accessed: 29-May-2025
]}
BibLaTeX
@online{reference.wolfram_2025_wikidatadata, organization={Wolfram Research}, title={WikidataData}, year={2020}, url={https://reference.wolfram.com/language/ref/WikidataData.html}, note=[Accessed: 29-May-2025
]}