query-1b15c22c2ec7a93eaeb5b1fcc7dce3ae

rq turtle/ttl

UEFA Euro 2024 teams

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
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 bd: <http://www.bigdata.com/rdf#>
PREFIX v: <http://www.wikidata.org/prop/statement/>
SELECT ?team ?teamLabel (SAMPLE(?countryName) AS ?country) (COUNT(?player) AS ?playerCount) (GROUP_CONCAT(DISTINCT(?playerName);separator=", ") AS ?players) WHERE {
  ?team wdt:P31 wd:Q123856553 .
  OPTIONAL{?team wdt:P31 ?nationalTeam . ?nationalTeam wdt:P31 wd:Q6979593 . ?nationalTeam wdt:P1532 ?country . ?country rdfs:label ?countryName . FILTER(lang(?countryName) = "en")}
  OPTIONAL{?team wdt:P710 ?player . ?player rdfs:label ?playerName . FILTER(lang(?playerName) = "en")}
  SERVICE wikibase:label{bd:serviceParam wikibase:language "en,de"}
}
GROUP BY ?team ?teamLabel
ORDER BY ?playerCount ?teamLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v9("?country") v4("?countryName"):::projected v6("?nationalTeam") v8("?player"):::projected v9("?playerCount") v3("?playerName"):::projected v9("?players") v5("?team"):::projected v2("?teamLabel"):::projected c4(["wd:Q6979593"]):::iri c9(["bd:serviceParam"]):::iri c3(["wd:Q123856553"]):::iri c11(["en,de"]):::literal v5 --"wdt:P31"--> c3 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v5 -."wdt:P31".-> v6 v6 --"wdt:P31"--> c4 v6 --"wdt:P1532"--> v9 v9 --"rdfs:label"--> v4 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v5 -."wdt:P710".-> v8 v8 --"rdfs:label"--> v3 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c9 --"wikibase:language"--> c11 end bind3[/"sample(?countryName)"/] v4 --o bind3 bind3 --as--o v9 bind4[/"count(?player)"/] v8 --o bind4 bind4 --as--o v9 bind5[/"?playerName"/] v3 --o bind5 bind5 --as--o v9