query-b24feb962201049d8aefefe9bf2eeae4
average number of references on “date of death” statements
(note: number of references, not reference snaks; arithmetic mean, not median)
SELECT (AVG(?count) AS ?avgCount) WHERE { { SELECT (COUNT(?reference) AS ?count) WHERE { [] p:P570 ?statement. OPTIONAL { ?statement prov:wasDerivedFrom ?reference. } } GROUP BY ?statement } }
Use at
- https://query.wikidata.org/sparql
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX p: <http://www.wikidata.org/prop/>
# average number of references on “date of death” statements
# (note: number of references, not reference snaks; arithmetic mean, not median)
SELECT (AVG(?count) AS ?avgCount) WHERE {
{
SELECT (COUNT(?reference) AS ?count) WHERE {
[] p:P570 ?statement.
OPTIONAL { ?statement prov:wasDerivedFrom ?reference. }
}
GROUP BY ?statement
}
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?avgCount")
v3("?count"):::projected
v2("?reference")
v1("?statement")
a1((" "))
a1 --"p:P570"--> v1
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."prov:wasDerivedFrom".-> v2
end
bind1[/"count(?reference)"/]
v2 --o bind1
bind1 --as--o v3
bind3[/"average(?count)"/]
v3 --o bind3
bind3 --as--o v4