query-b87ab00d548c525756e20cfbceda07b0

rq turtle/ttl

Examples from workshop 2018Mayors that are either a dog, a cat or a chicken (and that contains an image) Examples from workshop 2018Mayors that are either a dog, a cat or a chicken (and that contains an image) Examples from workshop 2018Mayors that are either a dog, a cat or a chicken (and that contains an image)

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?image ?speciesLabel ?mayorLabel ?placeLabel WHERE {

 VALUES ?species {wd:Q144 wd:Q146 wd:Q780}
 ?mayor wdt:P31 ?species .
 ?mayor p:P39 ?node .
 ?node ps:P39 wd:Q30185 .
 ?node pq:P642 ?place .
 ?mayor wdt:P18 ?image
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?image"):::projected v2("?mayor") v3("?node") v4("?place") v1("?species") c8(["bd:serviceParam"]):::iri c4(["wd:Q30185"]):::iri c10(["#91;AUTO_LANGUAGE#93;,en"]):::literal bind0[/VALUES ?species/] bind0-->v1 bind00(["wd:Q144"]) bind00 --> bind0 bind01(["wd:Q146"]) bind01 --> bind0 bind02(["wd:Q780"]) bind02 --> bind0 v2 --"p:direct/P31"--> v1 v2 --"p:P39"--> v3 v3 --"p:statement/P39"--> c4 v3 --"p:qualifier/P642"--> v4 v2 --"p:direct/P18"--> v5 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c8 --"wikibase:language"--> c10 end