query-d66f1628fa41d95ba9b21b75e78e6b29

rq turtle/ttl

TODO

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel (sum(?FA) as ?FAsum) (sum(?GA) as ?GAsum) (sum(?score) as ?scoresum)
WHERE 
{
  values ?item {wd:Q51 wd:Q183 wd:Q140 wd:Q544 wd:Q1232 wd:Q764 wd:Q1151 wd:Q556 wd:Q1057 wd:Q1301}
   ?article schema:about ?item .
   ?article  wikibase:badge ?badge .
   bind(if(?badge=wd:Q17437796,1,0) as ?FA)
   bind(if(?badge=wd:Q17437798,1,0) as ?GA)
   bind((?GA + (2*?FA)) as ?score)
   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} group by ?item ?itemLabel order by Desc(?scoresum)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?FA"):::projected v8("?FAsum") v6("?GA"):::projected v9("?GAsum") v3("?article") v4("?badge") v2("?item"):::projected v7("?score"):::projected v10("?scoresum") c4(["bd:serviceParam"]):::iri c6(["#91;AUTO_LANGUAGE#93;,en"]):::literal bind0[/VALUES ?item/] bind0-->v2 bind00(["wd:Q51"]) bind00 --> bind0 bind01(["wd:Q183"]) bind01 --> bind0 bind02(["wd:Q140"]) bind02 --> bind0 bind03(["wd:Q544"]) bind03 --> bind0 bind04(["wd:Q1232"]) bind04 --> bind0 bind05(["wd:Q764"]) bind05 --> bind0 bind06(["wd:Q1151"]) bind06 --> bind0 bind07(["wd:Q556"]) bind07 --> bind0 bind08(["wd:Q1057"]) bind08 --> bind0 bind09(["wd:Q1301"]) bind09 --> bind0 v3 --"schema:about"--> v2 v3 --"wikibase:badge"--> v4 bind1[/"if(?badge = 'wd:Q17437796','1^^xsd:integer','0^^xsd:integer')"/] v4 --o bind1 bind1 --as--o v5 bind2[/"if(?badge = 'wd:Q17437798','1^^xsd:integer','0^^xsd:integer')"/] v4 --o bind2 bind2 --as--o v6 bind3[/"?GA + '2^^xsd:integer' * ?FA"/] v6 --o bind3 v5 --o bind3 bind3 --as--o v7 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c4 --"wikibase:language"--> c6 end bind7[/"sum(?FA)"/] v5 --o bind7 bind7 --as--o v8 bind8[/"sum(?GA)"/] v6 --o bind8 bind8 --as--o v9 bind9[/"sum(?score)"/] v7 --o bind9 bind9 --as--o v10