User:Stefan Kühn/SDC
Jump to navigation
Jump to search
Notizen zu SDC
Allgemeines[edit]
- Projektbeschreibung Strukturierte Daten
- Forum d:Wikidata:Request a query
- Abfragen
Statistik[edit]
- Bilder mit Angabe von Motiv = 2.906.778 am 2020-11-07
- Bilder ohne Angabe von Motiv = 62.563.589 am 2020-11-07
- Bilder mit Angabe von Motiv in Dresden = 10.851 am 2020-11-07
- Bilder ohne Angabe von Motiv in Dresden = 279.963 am 2020-11-07
- Wikimedia Commons Query Service
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)
}
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)
}
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". }
}
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 [] }
}
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