query-4db58a6331ef256de4776593e8f9e8e0
This query finds the most prolific photographers in an area around a Wikidata item (Magnus Manske) SELECT ?creatorName ?creatorUrl (count(?creatorUrl) AS ?pictures_taken) WHERE { BIND ( wd:Q868642 as ?centerItem ) . # CHANGE THIS ITEM TO SET THE NEW CENTER BIND ( "5" as ?km ) . # CHANGE THIS TO SET THE SEARCH RADIUS (IN KM)
hint:Query hint:optimizer "None".
SERVICE https://query.wikidata.org/sparql { ?centerItem wdt:P625 ?center }
SERVICE wikibase:around {
?file wdt:P1259 ?coor.
bd:serviceParam wikibase:center ?center .
bd:serviceParam wikibase:radius ?km.
}
?file p:P170 ?creatorStatement .
?creatorStatement pq:P2699 ?creatorUrl .
?creatorStatement pq:P2093 ?creatorName .
}
GROUP BY ?creatorName ?creatorUrl
ORDER BY DESC(?pictures_taken)
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
# This query finds the most prolific photographers in an area around a Wikidata item (Magnus Manske)
SELECT ?creatorName ?creatorUrl (count(?creatorUrl) AS ?pictures_taken) WHERE {
BIND ( wd:Q868642 as ?centerItem ) . # CHANGE THIS ITEM TO SET THE NEW CENTER
BIND ( "5" as ?km ) . # CHANGE THIS TO SET THE SEARCH RADIUS (IN KM)
SERVICE <https://query.wikidata.org/sparql> { ?centerItem wdt:P625 ?center }
SERVICE wikibase:around {
?file wdt:P1259 ?coor.
bd:serviceParam wikibase:center ?center .
bd:serviceParam wikibase:radius ?km.
}
?file p:P170 ?creatorStatement .
?creatorStatement pq:P2699 ?creatorUrl .
?creatorStatement pq:P2093 ?creatorName .
}
GROUP BY ?creatorName ?creatorUrl
ORDER BY DESC(?pictures_taken)