SPARQL/Wikimedia Commons Query Service

From Wikibooks, open books for an open world
Jump to navigation Jump to search
WIKIDATA Lexicographical data SPARQL
Wikimedia Commons Query Service
Views

Wikimedia Comnmons images use structured data too (Structured Data on Commons (SDoC). With Wikimedia Commons Query Service (WCQS) the data can be queried. This is availabe in beta phase at https://wcqs-beta.wmflabs.org/.

Find below an example of Depictions of Douglas Adams shown as image grid.

#workaround to show the images in an image grid
#defaultView:ImageGrid
SELECT ?file ?image WHERE {
  ?file wdt:P180 wd:Q42 .
  ?file schema:contentUrl ?url .
  bind(iri(concat("http://commons.wikimedia.org/wiki/Special:FilePath/", replace(substr(str(?url),53),"_","%20"))) AS ?image)
}

Try it!

Mind: use |project=sdc where sdc =Structured Data on Commons, the default is |project=wd for Wikidata.

See more examples on WCQS itself.

References[edit | edit source]


WIKIDATA Lexicographical data SPARQL
Wikimedia Commons Query Service
Views