query-d52b252ba78e472142012e58d84c6eef

rq turtle/ttl

TODO

Use at

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#>
#defaultView:LineChart
SELECT ?decile (COUNT(?annotation) AS ?count)
WHERE
{
    ?annotation wdt:P3 wd:Q5 ;
                wdt:P19 ?anchor;
                wdt:P16 "infectiousdiseasesdrugs".
    ?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(10*?charnumber/?length) AS ?decile)

  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  }
 GROUP BY ?decile

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?anchor") v5("?anchorZ") v1("?annotation"):::projected v4("?annotationZ") v3("?charnumber") v8("?count") v7("?decile"):::projected v6("?length") c5(["infectiousdiseasesdrugs"]):::literal c12(["bd:serviceParam"]):::iri c2(["wd:Q5"]):::iri c10(["wd:Q6"]):::iri c14(["#91;AUTO_LANGUAGE#93;,en"]):::literal c7(["wd:Q6679"]):::iri v1 --"wdt:P3"--> c2 v1 --"wdt:P19"--> v2 v1 --"wdt:P16"--> c5 v2 --"wdt:P12"--> c7 v2 --"wdt:P10"--> v3 v4 --"wdt:P19"--> v5 v5 --"wdt:P7"--> c10 v5 --"wdt:P12"--> c7 v5 --"wdt:P10"--> v6 bind0[/"numeric-floor('10^^xsd:integer' * ?charnumber / ?length)"/] v3 --o bind0 v6 --o bind0 bind0 --as--o v7 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c12 --"wikibase:language"--> c14 end bind2[/"count(?annotation)"/] v1 --o bind2 bind2 --as--o v8