Using Wikidata Query Service - lmmx/devnotes GitHub Wiki
Wikidata has a query service with examples like cats, with pictures
#Cats, with pictures
#defaultView:ImageGrid
SELECT ?item ?itemLabel ?pic
WHERE
{
?item wdt:P31 wd:Q146 .
?item wdt:P18 ?pic
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
}
The first line is read as 4 components:
?item
meanswdt:P31
means “instance of”wd:Q146 .
meanswdt:P18
means
The first step to finding images I want is to go backwards and inspect the properties of an image found already (from the Commons: Featured pictures link above)
- An example of such a picture is Scheme of a submarine eruption
- This is a SVG but every SVG has a PNG (e.g. here it's this 1080x1080px PNG)
- Clicking "More details" gives the details page
- The property for a Wikimedia Commons featured picture is
Q63348049