query-93ee337ce89ad28721203eb80656e35d
using metadata from Youtube - mapborked-bot/issues/4Feature request to also get the youtube name and maybe match it to Wikidata see moves metadata from Youtube to Wikidata weekly User:BorkedBot
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#>
#defaultView:Map{"hide":["?coord"], "layer": "?languageLabel"}
#title:Outdoor Swedish gyms with a youtube video and metadata from Youtube
SELECT ?item ?itemLabel ?img ?coord ?www ?youtube ?adminLabel ?title ?languageLabel ?nrviews ?length WHERE {
?item wdt:P6104 wd:Q107186275;
wdt:P17 wd:Q34.
SERVICE wikibase:label {
bd:serviceParam wikibase:language "sv,en,de" .
}
OPTIONAL { ?item wdt:P18 ?img. }
OPTIONAL { ?item wdt:P131 ?admin. }
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. }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?Pyoutubev")
v3("?admin")
v12("?coord"):::projected
v2("?img"):::projected
v1("?item"):::projected
v8("?language")
v10("?length"):::projected
v9("?nrviews"):::projected
v7("?title"):::projected
v4("?www"):::projected
v11("?youtube"):::projected
v5("?youtubev")
c8(["sv,en,de"]):::literal
c4(["wd:Q34"]):::iri
c6(["bd:serviceParam"]):::iri
c2(["wd:Q107186275"]):::iri
v1 --"p:direct/P6104"--> c2
v1 --"p:direct/P17"--> c4
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c6 --"wikibase:language"--> c8
end
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:direct/P18".-> v2
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:direct/P131".-> v3
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:direct/P856".-> v4
end
v1 --"p:direct/P1651"--> v5
v1 --"p:P1651"--> v6
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v6 -."p:qualifier/P1810".-> v7
end
subgraph optional4["(optional)"]
style optional4 fill:#bbf,stroke-dasharray: 5 5;
v6 -."p:qualifier/P407".-> v8
end
subgraph optional5["(optional)"]
style optional5 fill:#bbf,stroke-dasharray: 5 5;
v6 -."p:qualifier/P5436".-> v9
end
subgraph optional6["(optional)"]
style optional6 fill:#bbf,stroke-dasharray: 5 5;
v6 -."p:qualifier/P2047".-> v10
end
bind0[/"concat('https://www.youtube.com/watch?v=',?youtubev)"/]
v5 --o bind0
bind0 --as--o v11
subgraph optional7["(optional)"]
style optional7 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:direct/P625".-> v12
end