query-b0787decb4c6056300565195ea6c9537
COVID-19 positive Olympians
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 rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT
?item
?itemLabel
(GROUP_CONCAT(DISTINCT ?citizenship; SEPARATOR=', ') AS ?citizenships)
(GROUP_CONCAT(DISTINCT ?occupation; SEPARATOR=', ') AS ?occupations)
?startTime
(COUNT(?refHandle) AS ?cnt_refs)
?sr_url
WHERE {
?item wdt:P1447 ?sr; p:P1050 ?s .
BIND(IRI(CONCAT('https://www.sports-reference.com/olympics/athletes/', ?sr, '.html')) AS ?sr_url)
OPTIONAL { ?item wdt:P27/rdfs:label ?citizenship . FILTER(LANG(?citizenship) = 'en') }
OPTIONAL { ?item wdt:P106/rdfs:label ?occupation . FILTER(LANG(?occupation) = 'en') }
?s ps:P1050 wd:Q84263196 .
OPTIONAL { ?s pq:P580 ?startTime }
OPTIONAL { ?s prov:wasDerivedFrom ?refHandle }
SERVICE wikibase:label { bd:serviceParam wikibase:language 'en' }
} GROUP BY ?item ?itemLabel ?startTime ?sr_url
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?citizenship"):::projected
v9("?citizenships")
v11("?cnt_refs")
v3("?item"):::projected
v1("?occupation"):::projected
v10("?occupations")
v8("?refHandle"):::projected
v5("?s")
v4("?sr")
v6("?sr_url"):::projected
v7("?startTime"):::projected
a1((" "))
a2((" "))
c8(["wd:Q84263196"]):::iri
c1(["en"]):::literal
c12(["bd:serviceParam"]):::iri
v3 --"p:direct/P1447"--> v4
v3 --"p:P1050"--> v5
bind0[/"concat('https://www.sports-reference.com/olympics/athletes/',?sr,'.html')"/]
v4 --o bind0
bind0 --as--o v6
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."p:direct/P27".-> a1
a1 --"rdfs:label"--> v2
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v3 -."p:direct/P106".-> a2
a2 --"rdfs:label"--> v1
end
v5 --"p:statement/P1050"--> c8
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v5 -."p:qualifier/P580".-> v7
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v5 -."prov:wasDerivedFrom".-> v8
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c12 --"wikibase:language"--> c1
end
bind4[/"?citizenship"/]
v2 --o bind4
bind4 --as--o v9
bind5[/"?occupation"/]
v1 --o bind5
bind5 --as--o v10
bind6[/"count(?refHandle)"/]
v8 --o bind6
bind6 --as--o v11