User:Stefan Kühn/SDC

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Notizen zu SDC

Allgemeines[edit]

Statistik[edit]

Bilder mit Motiv Dresden[edit]

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

Try it!

Bilder mit Motiv Dresden und Koordinate des Aufnahmestandortes[edit]

#defaultView:Map, Table;ImageGrid
SELECT ?file ?image ?coordinate WHERE {
  ?file wdt:P180 wd:Q1731 .       # Motiv = Dresden
  ?file wdt:P1259 ?coordinate .   # Koordinate des Aufnahmestandortes
  ?file schema:contentUrl ?url .
  bind(iri(concat("http://commons.wikimedia.org/wiki/Special:FilePath/", replace(substr(str(?url),53),"_","%20"))) AS ?image)
}

Try it!

Bilder im Umkreis einer Koordinate (z.B. Altmarkt, Dresden)[edit]

#defaultView:Map{"hide":["?coor"]}
# query by Jura1, 2020-11-12
SELECT ?fileLabel ?fileDescription ?image ?coor
WHERE 
{
  hint:Query hint:optimizer "None".
  SERVICE <https://query.wikidata.org/sparql> { wd:Q1731 wdt:P625 ?center }  
  SERVICE wikibase:around {
      ?file wdt:P1259 ?coor.
      bd:serviceParam wikibase:center ?center .
      bd:serviceParam wikibase:radius "1". # 1 kilometer around
  }  
  ?file schema:contentUrl ?url .
  bind(iri(concat("http://commons.wikimedia.org/wiki/Special:FilePath/", wikibase:decodeUri(substr(str(?url),53)))) AS ?image)  
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,de". }
}

Try it!

Bilder ohne Motive im Umkreis einer Koordinate[edit]

#defaultView:Map, Table;ImageGrid
SELECT * WHERE 
{
  #?file wdt:P180 ?motiv.
  
  ?file schema:contentUrl ?url .
  bind(iri(concat("http://commons.wikimedia.org/wiki/Special:FilePath/", replace(substr(str(?url),53),"_","%20"))) AS ?image)

  SERVICE wikibase:around {
      ?file wdt:P1259 ?coordinate.
      bd:serviceParam wikibase:center "Point(13.738361 51.049258)"^^geo:wktLiteral.
      bd:serviceParam wikibase:radius "1". # 10 Kilometer around
  } 
  MINUS {?file p:P180 [] }
}

Try it!

Bilder eine Nutzers auf Karte[edit]

# Map of files authored by a Wikimedia Commons user
#TEMPLATE={"template":"Map of files authored by ?username","variables":{"?username":{"query":" SELECT DISTINCT ?username WHERE { [] p:P170/pq:P4174 ?username .} LIMIT 100"} } }
#defaultView:Map
SELECT ?file ?image ?coordinates (?date AS ?layer)  (wikibase:decodeUri(CONCAT("File:", substr(str(?url),53))) AS ?filename)
WHERE {
  BIND("Stefan Kühn" AS ?username)
  ?file (p:P170/pq:P4174) ?username;
  OPTIONAL {?file  wdt:P625|wdt:P1259 ?coordinates. }
  OPTIONAL { ?file wdt:P571 ?date. }
  # convert file into image
  ?file schema:contentUrl ?url .
  bind(iri(concat("http://commons.wikimedia.org/wiki/Special:FilePath/", wikibase:decodeUri(substr(str(?url),53)))) AS ?image)
}
LIMIT 5000

Try it!