query-42f77ae91a1bc764016f8319d6a530ae
For article Q6679
Two columns of data, breakdown of paper 2% at a time
SELECT ?quantile (COUNT(?hybrid1) AS ?count1) (COUNT(?hybrid2) AS ?count2)
WHERE {
?annotation wdt:P3 wd:Q5 ;
wdt:P19 ?anchor;
wdt:P16 ?dic0.
VALUES ?dic { wd:Q6803 wd:Q6793 }.
?dic wdt:P16 ?dic0.
BIND((IF (?dic=wd:Q6803, "Q6803",1/0)) AS ?hybrid1)
BIND((IF (?dic=wd:Q6793, "Q6793",1/0)) AS ?hybrid2)
BIND(COALESCE(?hybrid1,?hybrid2) AS ?hybrid)
BIND(COALESCE(?hybrid1Label,?hybrid2Label) AS ?hl)
?anchor wdt:P12 wd:Q6679.
?anchor wdt:P10 ?charnumber.
?annotationZ wdt:P19 ?anchorZ.
?anchorZ wdt:P7 wd:Q6;
wdt:P12 wd:Q6679;
wdt:P10 ?length.
BIND (floor(50*?charnumber/?length) AS ?quantile)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
GROUP BY ?quantile
ORDER BY ASC(?quantile)
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 bd: <http://www.bigdata.com/rdf#>
#For article Q6679
#Two columns of data, breakdown of paper 2% at a time
SELECT ?quantile (COUNT(?hybrid1) AS ?count1) (COUNT(?hybrid2) AS ?count2)
WHERE {
?annotation wdt:P3 wd:Q5 ;
wdt:P19 ?anchor;
wdt:P16 ?dic0.
VALUES ?dic { wd:Q6803 wd:Q6793 }.
?dic wdt:P16 ?dic0.
BIND((IF (?dic=wd:Q6803, "Q6803",1/0)) AS ?hybrid1)
BIND((IF (?dic=wd:Q6793, "Q6793",1/0)) AS ?hybrid2)
BIND(COALESCE(?hybrid1,?hybrid2) AS ?hybrid)
BIND(COALESCE(?hybrid1Label,?hybrid2Label) AS ?hl)
?anchor wdt:P12 wd:Q6679.
?anchor wdt:P10 ?charnumber.
?annotationZ wdt:P19 ?anchorZ.
?anchorZ wdt:P7 wd:Q6;
wdt:P12 wd:Q6679;
wdt:P10 ?length.
BIND (floor(50*?charnumber/?length) AS ?quantile)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
GROUP BY ?quantile
ORDER BY ASC(?quantile)