query-f49ea67b6142e65b26b0b353e20e7978

rq turtle/ttl

Karte

Use at

PREFIX mwapi: <http://wikiba.se/ontology#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX schema: <http://schema.org/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?file ?title ?image ?coords 
WHERE
{

{
  SELECT ?file ?title
  WHERE
  {
    SERVICE wikibase:mwapi
    {
      bd:serviceParam wikibase:api "Generator" .
      bd:serviceParam wikibase:endpoint "commons.wikimedia.org" .
      bd:serviceParam mwapi:gcmtitle "Category:Winners of Wiki Loves Monuments 2021 in Germany" .
      bd:serviceParam mwapi:generator "categorymembers" .
      bd:serviceParam mwapi:gcmtype "file" .
      bd:serviceParam mwapi:gcmlimit "max" .
      ?title wikibase:apiOutput mwapi:title .
      ?pageid wikibase:apiOutput "@pageid" .
    }
    BIND (URI(CONCAT('https://commons.wikimedia.org/entity/M', ?pageid)) AS ?file)
  }
}  OPTIONAL {?file wdt:P1259 ?coords} .  # coords of POV      
  OPTIONAL {?file wdt:P9149 ?coords} .  # fallback: coords of depicted place
  FILTER(bound(?coords)) .
  ?file schema:url ?image.
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?coords"):::projected v4("?file"):::projected v5("?image"):::projected v3("?pageid") v2("?title"):::projected c14(["max"]):::literal c8(["Category:Winners of Wiki Loves Monuments 2021 in Germany"]):::literal c10(["categorymembers"]):::literal c2(["bd:serviceParam"]):::iri c12(["file"]):::literal c16(["mwapi:title"]):::iri c6(["commons.wikimedia.org"]):::literal c17(["@pageid"]):::literal c4(["Generator"]):::literal f0[["bound(?coords)"]] f0 --> v1 subgraph s1["http://wikiba.se/ontology#mwapi"] style s1 stroke-width:4px; c2 --"mwapi:api"--> c4 c2 --"mwapi:endpoint"--> c6 c2 --"mwapi:gcmtitle"--> c8 c2 --"mwapi:generator"--> c10 c2 --"mwapi:gcmtype"--> c12 c2 --"mwapi:gcmlimit"--> c14 v2 --"mwapi:apiOutput"--> c16 v3 --"mwapi:apiOutput"--> c17 end bind1[/"concat('https://commons.wikimedia.org/entity/M',?pageid)"/] v3 --o bind1 bind1 --as--o v4 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v4 -."wdt:P1259".-> v1 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v4 -."wdt:P9149".-> v1 end v4 --"schema:url"--> v5