Wikidata has an item called smartphone model.
I want to get all instances of it.
QUESTION: How to get the identifiers of the instances programmatically, using the live server?
Preferably not including false positives that show up in WhatLinksHere but are in the "Wikidata:" namespace rather than the main namespace.
In the query.wikidata.org query editor, you can press Ctrl + Space (or Alt + Enter or Ctrl + Alt + Enter ) at any point in the query and get suggestions for code that might be appropriate; select the right suggestion with the up / down arrow keys, and press Enter to select it.
In Wikidata, items are used to represent all the things in human knowledge, including topics, concepts, and objects. For example, the "1988 Summer Olympics", "love", "Elvis Presley", and "gorilla" are all items in Wikidata.
Is Wikidata Reliable? Wikidata has a number of measures to ensure that its data are reliable. There is the option to add a reference to any entry on Wikidata, and users are encouraged to do so for the integrity of the website. In addition, institutions are supporting the reliability of Wikidata.
Wikidata is the centralized, linked data repository for all Wikimedia projects. This means that all Wikimedia projects (Commons and Wikipedia for instance) can pull the information from the same central place. This also means that all 300+ language versions of Wikipedia can pull data from Wikidata as well.
Your question specifies the "Mediawiki API" but this is not possible.
Wikidata has a SPARQL query service at https://query.wikidata.org
The query that you want is:
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
SELECT DISTINCT ?item
WHERE {
?item wdt:P31/wdt:P279* wd:Q19723451
}
This will list the Items that are an 'instance of'(P31) 'smartphone model'(Q19723451) or an 'instance of' a 'subclass of'(P279) 'smartphone model'(Q19723451).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With