query-113922b6710e2ac8f2e9e8d17f9df9f0
2014 FIFA World Cup matches
Use at
- https://query.wikidata.org/sparql
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#>
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:P31 wd:Q16466010 .
?match wdt:P361 ?partof . ?partof rdfs:label ?stage . FILTER(lang(?stage) = "en")
{?partof wdt:P361 wd:Q189571} UNION {?partof wdt:P31 wd:Q24198315} .
?match wdt:P1545 ?matchNR .
OPTIONAL{?match wdt:P585 ?pit}
OPTIONAL{?match wdt:P1346 ?winner . ?winner wdt:P17 ?country . ?country rdfs:label ?winnerName . FILTER(lang(?winnerName) = "en")}
OPTIONAL{?match wdt:P710 ?team . ?team wdt:P17 ?country . ?country 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;
v9("?country")
v11("?day")
v5("?match"):::projected
v11("?matchNR"):::projected
v6("?partof")
v7("?pit"):::projected
v13("?stage")
v10("?team")
v2("?teamName"):::projected
v12("?teams")
v13("?winner")
v3("?winnerName"):::projected
c7(["wd:Q24198315"]):::iri
c16(["en,de"]):::literal
c14(["bd:serviceParam"]):::iri
c6(["wd:Q189571"]):::iri
c3(["wd:Q16466010"]):::iri
f0[["?stage = 'en'"]]
f0 --> v13
v5 --"wdt:P31"--> c3
v5 --"wdt:P361"--> v6
v6 --"rdfs:label"--> v13
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v6 --"wdt:P31"--> c7
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v6 --"wdt:P361"--> c6
end
union0r <== or ==> union0l
end
v5 --"wdt:P1545"--> v11
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v5 -."wdt:P585".-> v7
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v5 -."wdt:P1346".-> v13
v13 --"wdt:P17"--> v9
v9 --"rdfs:label"--> v3
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v5 -."wdt:P710".-> v10
v10 --"wdt:P17"--> v9
v9 --"rdfs:label"--> v2
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c14 --"wikibase:language"--> c16
end
bind6[/"sample(?matchNR)"/]
v11 --o bind6
bind6 --as--o v11
bind7[/"sample(?pit)"/]
v7 --o bind7
bind7 --as--o v11
bind8[/"?teamName"/]
v2 --o bind8
bind8 --as--o v12
bind9[/"substring(,'16^^xsd:integer','100^^xsd:integer')"/]
null --o bind9
bind9 --as--o v13
bind10[/"sample(?winnerName)"/]
v3 --o bind10
bind10 --as--o v13