query-a7e00377c334e0368d3aac8507231528
Picture gallery of images depicting a outdoor gym on a map we can easy use SPARQL to query Wikicommons to find all pictures depicting an item in Wikidata that is a outdoor gym in this project.... Wikibase) and has its on video (Structured dataAs Wikicommons now support
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 schema: <http://schema.org/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
#title: Outdoor Gyms with pictures in Wikidata
#defaultView:Map
SELECT DISTINCT ?itemLabel ?image ?www ?coord
WHERE
{
{ SELECT ?item ?itemLabel ?itemDescription ?www ?coord WHERE
{ SERVICE <https://query.wikidata.org/sparql>
{?item wdt:P6104 wd:Q107186275.
OPTIONAL {?item wdt:P856 ?www}
OPTIONAL {?item wdt:P625 ?coord}
SERVICE wikibase:label { bd:serviceParam wikibase:language "en,sv". ?item rdfs:label ?itemLabel .}
}
}
}.
?file wdt:P180 ?item.
?file schema:contentUrl ?url.
bind(iri(concat("http://commons.wikimedia.org/wiki/Special:FilePath/", wikibase:decodeUri(substr(str(?url),53)))) AS ?image)
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?coord"):::projected
v5("?file")
v7("?image"):::projected
v1("?item")
v4("?itemLabel"):::projected
v6("?url")
v2("?www"):::projected
c7(["bd:serviceParam"]):::iri
c9(["en,sv"]):::literal
c3(["wd:Q107186275"]):::iri
subgraph s1["https://query.wikidata.org/sparql"]
style s1 stroke-width:4px;
v1 --"wdt:P6104"--> c3
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P856".-> v2
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P625".-> v3
end
subgraph s2["http://wikiba.se/ontology#label"]
style s2 stroke-width:4px;
c7 --"wikibase:language"--> c9
v1 --"rdfs:label"--> v4
end
end
v5 --"wdt:P180"--> v1
v5 --"schema:contentUrl"--> v6
bind0[/"concat('http://commons.wikimedia.org/wiki/Special:FilePath/',http://wikiba.se/ontology#decodeUri(substring(str(?url),'53^^xsd:integer')))"/]
v6 --o bind0
bind0 --as--o v7