query-c9582de544d890d94a8c80166fc07fd0
title:Outdoor gyms in Sweden most viewed youtube video SELECT ?nrviews (SAMPLE(?item) AS ?WD) (SAMPLE(?OutdoorGym) AS ?OutdoorGym) ?youtube (SAMPLE(?admin) AS ?admin) (SAMPLE(?title) AS ?title) WHERE { ?item wdt:P6104 wd:Q107186275; wdt:P17 wd:Q34. OPTIONAL { ?item rdfs:label ?OutdoorGym. FILTER((LANG(?OutdoorGym)) = "sv") } OPTIONAL { ?item wdt:P18 ?img. } OPTIONAL { ?item wdt:P131 ?adminId. ?adminId rdfs:label ?admin. FILTER((LANG(?admin)) = "sv") } OPTIONAL { ?item wdt:P856 ?www. } { ?item wdt:P1651 ?youtubev. {?item p:P1651 ?Pyoutubev. OPTIONAL { ?Pyoutubev pq:P1810 ?title. } OPTIONAL { ?Pyoutubev pq:P407 ?language. } OPTIONAL { ?Pyoutubev pq:P5436 ?nrviews. } OPTIONAL { ?Pyoutubev pq:P2047 ?length. } } } BIND(URI(CONCAT("https://www.youtube.com/watch?v=", ?youtubev)) AS ?youtube) OPTIONAL { ?item wdt:P625 ?coord. } } GROUP BY ?youtube ?nrviews ORDER BY DESC (?nrviews)
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
#title:Outdoor gyms in Sweden most viewed youtube video
SELECT ?nrviews (SAMPLE(?item) AS ?WD) (SAMPLE(?OutdoorGym) AS ?OutdoorGym) ?youtube (SAMPLE(?admin) AS ?admin) (SAMPLE(?title) AS ?title) WHERE {
?item wdt:P6104 wd:Q107186275;
wdt:P17 wd:Q34.
OPTIONAL {
?item rdfs:label ?OutdoorGym.
FILTER((LANG(?OutdoorGym)) = "sv")
}
OPTIONAL { ?item wdt:P18 ?img. }
OPTIONAL {
?item wdt:P131 ?adminId.
?adminId rdfs:label ?admin.
FILTER((LANG(?admin)) = "sv")
}
OPTIONAL { ?item wdt:P856 ?www. }
{
?item wdt:P1651 ?youtubev.
{?item p:P1651 ?Pyoutubev.
OPTIONAL { ?Pyoutubev pq:P1810 ?title. }
OPTIONAL { ?Pyoutubev pq:P407 ?language. }
OPTIONAL { ?Pyoutubev pq:P5436 ?nrviews. }
OPTIONAL { ?Pyoutubev pq:P2047 ?length. }
}
}
BIND(URI(CONCAT("https://www.youtube.com/watch?v=", ?youtubev)) AS ?youtube)
OPTIONAL { ?item wdt:P625 ?coord. }
}
GROUP BY ?youtube ?nrviews
ORDER BY DESC (?nrviews)