Deprecated: Use of wfGetDB was deprecated in MediaWiki 1.39. [Called from EDConnectorHttp::setupCache in /home/ngrandy/public_html/w/extensions/ExternalData/includes/connectors/traits/EDConnectorCached.php at line 50] in /home/ngrandy/public_html/w/includes/debug/MWDebug.php on line 385
Wikidata querying demo - Discourse DB Jump to content

Wikidata querying demo

From Discourse DB

The following are demonstrations of how Wikidata can be queried using the External Data extension.

Individual entry

SPARQL query:

SELECT ?item ?itemLabel ?symbol ?atomicNumber ( YEAR( ?discoveryDate ) AS ?discoveryYear ) ?discoverer ?discovererLabel
WHERE {
  VALUES ?item { wd:Q654 } .
  ?item wdt:P246 ?symbol .
  ?item wdt:P1086 ?atomicNumber .
  ?item wdt:P575 ?discoveryDate .
  ?item wdt:P61 ?discoverer
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}

Info for Q654:

Full query

All paintings that depict a squirrel.

SPARQL query:

SELECT DISTINCT ?painting ?paintingLabel ?creator ?creatorLabel ( YEAR( ?inception ) as ?year ) ?genre ?genreLabel ( SUBSTR( ?str_image, 52 ) AS ?fileName )
WHERE
{
  ?painting wdt:P180 wd:Q9482 .
  ?painting wdt:P170 ?creator .
  ?painting wdt:P571 ?inception .
  ?painting wdt:P136 ?genre .
  ?painting wdt:P18 ?image .
  BIND (STR(?image) AS ?str_image)
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
ORDER BY ?paintingLabel


Name Artist Year Genre Image
Q111135100 Willy Blees 1967 public art
Animals. Ernst Wilhelm Bernhardi 1708 animal art
Basket and bowls of fruit with two monkeys. a squirrel, a macaw and two guinea-pigs Jan van Kessel the Younger 1500 still life
Basket and bowls of fruit with two monkeys. a squirrel, a macaw and two guinea-pigs Jan van Kessel the Younger 1500 animal art
Basket of red and green grapes with fruits of the hunt, including a goldfinch Clara Peeters 1640 still life
Forest still life with squirrel Anna Ruysch 1685 still life
Forest still life with squirrel Anna Ruysch 1685 still life
Fruit bowl, basket, vegetables and a squirrel Gommaert van der Gracht 1645 still life
Fruit bowl, basket, vegetables and a squirrel Gommaert van der Gracht 1645 landscape painting
Fruit still life with goldfinch and squirrel Abraham Mignon 1668 still life
Fruits, Carnation and Squirrel Frans Snyders 1611 still life
Genoveva-Brunnen Hermann Hosaeus 1928 public art
Order of the Cub Scout Tom Frantzen 1994 public art
Peter Pan George Frampton 1924 public art
Pomona in a fruit garland and surrounded by animals Gommaert van der Gracht 1645 still life
Squirrels with Stag Horn Therese Richter 1809 still life
Squirrels with Stag Horn Therese Richter 1809 animal art
Still Life of Fruit, a Lobster, Cheeses and Drinking Vessels with a Parrot and a Squirrel on a Table Artus Claessens 1650 still life
Still Life with Fruit and a Squirrel Catharina Treu 1780 still life
Still life with a basket of fruit, vegetables and a squirrel Abraham Gibbens 1635 still life
Still-Life with a Basket of Fruit, a Squirrel, and a Cat Frans Snyders 1639 still life
Two Squirrels Albrecht Dürer 1512 animal art
portal of the Haus Burchardt John Martens 1914 public art
portal of the Haus Burchardt John Martens 1914 architectural sculpture

Map display

Map of all buildings in Spain with Baroque architecture.

SPARQL query:

SELECT ?item ?itemLabel ?lon ?lat
WHERE
{
 ?item wdt:P31 wd:Q41176. # type = building
 ?item wdt:P17 wd:Q29. # country = Spain
 ?item wdt:P149 wd:Q37853. # architecture = Baroque
 ?item p:P625 ?coordinate.
 ?coordinate psv:P625 ?coordinate_node.
 ?coordinate_node wikibase:geoLongitude ?lon.
 ?coordinate_node wikibase:geoLatitude ?lat.  
 SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } 
}