query-ddf33a483c31762afa64c6c01003abcd
Andrekotze69
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 bd: <http://www.bigdata.com/rdf#>
SELECT ?band ?bandLabel ?genre ?genreLabel ?location_of_formation ?location_of_formationLabel ?coordinates
(MAX(?release_date) AS ?latest_release)
{
?band wdt:P31 wd:Q215380. # ?band is a band
VALUES ?genre { wd:Q617240 wd:Q720959 wd:Q186170 wd:Q11366 wd:Q49451 }
?band wdt:P136 ?genre. # ?band has one of genres in ?genre
OPTIONAL { ?band wdt:P576 ?dissolved }
FILTER (! BOUND(?dissolved)) # Band has no dissolve date
OPTIONAL {
?band wdt:P740 ?location_of_formation.
OPTIONAL { ?location_of_formation wdt:P625 ?coordinates. }
}
OPTIONAL {
?album wdt:P175 ?band.
?album wdt:P577 ?release_date.
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
GROUP BY ?band ?bandLabel ?genre ?genreLabel ?location_of_formation ?location_of_formationLabel ?coordinates
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?album")
v2("?band"):::projected
v5("?coordinates"):::projected
v1("?dissolved")
v3("?genre"):::projected
v8("?latest_release")
v4("?location_of_formation"):::projected
v7("?release_date"):::projected
c10(["bd:serviceParam"]):::iri
c12(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c2(["wd:Q215380"]):::iri
f0[["not bound(?dissolved)"]]
f0 --> v1
v2 --"wdt:P31"--> c2
bind1[/VALUES ?genre/]
bind1-->v3
bind10(["wd:Q617240"])
bind10 --> bind1
bind11(["wd:Q720959"])
bind11 --> bind1
bind12(["wd:Q186170"])
bind12 --> bind1
bind13(["wd:Q11366"])
bind13 --> bind1
bind14(["wd:Q49451"])
bind14 --> bind1
v2 --"wdt:P136"--> v3
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P576".-> v1
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P740".-> v4
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v4 -."wdt:P625".-> v5
end
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v6 -."wdt:P175".-> v2
v6 --"wdt:P577"--> v7
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
end
bind3[/"max(?release_date)"/]
v7 --o bind3
bind3 --as--o v8