query-80de5042496345ab8352dc79f019e7a1

rq turtle/ttl

Windmils in commons pictues query Wikimedia Commons Query Service Exemples query. Quering images dipicting windmils, and bringing along coordinates when they exist. For more http://wcqs-beta.wmflabs.orgA

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
#defaultView:ImageGrid
SELECT ?file ?image ?geo WHERE {
  ?file wdt:P180 wd:Q38720;
    schema:contentUrl ?url.
   OPTIONAL{ ?file wdt:P1259 ?geo.} #location on the point ov vieuw
   OPTIONAL{ ?file wdt:P625 ?geo2.} #location
  BIND(IRI(CONCAT("http://commons.wikimedia.org/wiki/Special:FilePath/", wikibase:decodeUri(SUBSTR(STR(?url), 53 )))) AS ?image)
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?file"):::projected v3("?geo"):::projected v4("?geo2") v5("?image"):::projected v2("?url") c2(["wd:Q38720"]):::iri v1 --"wdt:P180"--> c2 v1 --"schema:contentUrl"--> v2 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P1259".-> v3 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P625".-> v4 end bind0[/"concat('http://commons.wikimedia.org/wiki/Special:FilePath/',http://wikiba.se/ontology#decodeUri(substring(str(?url),'53^^xsd:integer')))"/] v2 --o bind0 bind0 --as--o v5