query-661f15d98b332f0d639072a0085fe9c9

rq turtle/ttl

UEFA Euro 2016 matches

Use at

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
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 p: <http://www.wikidata.org/prop/>
PREFIX v: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>

SELECT (SAMPLE(?matchNR) AS ?matchNR) ?match ?matchLabel (SAMPLE(?pit) AS ?day) (GROUP_CONCAT(DISTINCT(?teamName);separator=" vs. ") AS ?teams) (SUBSTR(SAMPLE(?stage),16,100) AS ?stage) (SAMPLE(?winnerName) AS ?winner) WHERE {
  ?match wdt:P361 ?partof . ?partof rdfs:label ?stage . FILTER(lang(?stage) = "en")
  ?match p:P179 ?matchSeries . ?matchSeries v:P179 wd:Q189571 . ?matchSeries pq:P1545 ?matchNR .
  OPTIONAL{?match wdt:P585 ?pit}
  OPTIONAL{?match wdt:P1346 ?winner . ?winner wdt:P1532 ?wCountry . ?wCountry rdfs:label ?winnerName . FILTER(lang(?winnerName) = "en")}
  OPTIONAL{?match wdt:P710 ?team . ?team wdt:P1532 ?tCountry . ?tCountry rdfs:label ?teamName . FILTER(lang(?teamName) = "en")} .
  SERVICE wikibase:label{bd:serviceParam wikibase:language "en,de"}
}
GROUP BY ?match ?matchLabel
ORDER BY ASC(xsd:integer(?matchNR))

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v13("?day") v5("?match"):::projected v13("?matchNR"):::projected v7("?matchSeries") v6("?partof") v8("?pit"):::projected v15("?stage") v12("?tCountry") v11("?team") v2("?teamName"):::projected v14("?teams") v10("?wCountry") v15("?winner") v3("?winnerName"):::projected c15(["en,de"]):::literal c13(["bd:serviceParam"]):::iri c6(["wd:Q189571"]):::iri f0[["?stage = 'en'"]] f0 --> v15 v5 --"p:direct/P361"--> v6 v6 --"rdfs:label"--> v15 v5 --"p:P179"--> v7 v7 --"p:statement/P179"--> c6 v7 --"p:qualifier/P1545"--> v13 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v5 -."p:direct/P585".-> v8 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v5 -."p:direct/P1346".-> v15 v15 --"p:direct/P1532"--> v10 v10 --"rdfs:label"--> v3 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v5 -."p:direct/P710".-> v11 v11 --"p:direct/P1532"--> v12 v12 --"rdfs:label"--> v2 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c13 --"wikibase:language"--> c15 end bind6[/"sample(?matchNR)"/] v13 --o bind6 bind6 --as--o v13 bind7[/"sample(?pit)"/] v8 --o bind7 bind7 --as--o v13 bind8[/"?teamName"/] v2 --o bind8 bind8 --as--o v14 bind9[/"substring(,'16^^xsd:integer','100^^xsd:integer')"/] null --o bind9 bind9 --as--o v15 bind10[/"sample(?winnerName)"/] v3 --o bind10 bind10 --as--o v15