query-55f288a0f6c958e446ab695f1f579a41

rq turtle/ttl

title: All national pre-selections for Eurovision SELECT ?item ?itemLabel ?partOf ?partOfLabel ?year WHERE { ?item wdt:P31|wdt:P179 ?partOf. ?partOf wdt:P31 wd:Q62584801. OPTIONAL {?item wdt:P585 ?year} SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } ORDER BY ?year

Use at

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#>
#title: All national pre-selections for Eurovision
SELECT ?item ?itemLabel ?partOf ?partOfLabel ?year WHERE {
  ?item wdt:P31|wdt:P179 ?partOf.
  ?partOf wdt:P31 wd:Q62584801.
  OPTIONAL {?item wdt:P585 ?year}
    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY ?year

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?item"):::projected v3("?partOf"):::projected v1("?year"):::projected c6(["bd:serviceParam"]):::iri c8(["#91;AUTO_LANGUAGE#93;,en"]):::literal c3(["wd:Q62584801"]):::iri subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P179"--> v3 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P31"--> v3 end union0r <== or ==> union0l end v3 --"wdt:P31"--> c3 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P585".-> v1 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c6 --"wikibase:language"--> c8 end