query-d2e27b9edb78277367063183b7edb541
TODO
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 ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?WikiJournal ?WikiJournalLabel (sum(?anon) as ?anoncount) (sum(?named) as ?namedcount) (floor(?anoncount / (?anoncount + ?namedcount)*100)/100 as ?ratio) WHERE {
# Fetch data
?WikiJournal wdt:P123 wd:Q28953974 . # journals in WJ user group
?article wdt:P1433 ?WikiJournal. # articles in journal
?article p:P4032 [ps:P4032 ?reviewer]. # reviewers for each article
bind(if(?reviewer=wd:Q4233718,1,0) as ?anon)
bind(if(?reviewer=wd:Q4233718,0,1) as ?named)
SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }
}
GROUP BY ?WikiJournal ?WikiJournalLabel
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?WikiJournal"):::projected
v4("?anon"):::projected
v6("?anoncount"):::projected
v2("?article")
v5("?named"):::projected
v7("?namedcount"):::projected
v8("?ratio")
v3("?reviewer")
a1((" "))
c7(["bd:serviceParam"]):::iri
c9(["en"]):::literal
c2(["wd:Q28953974"]):::iri
v1 --"p:direct/P123"--> c2
v2 --"p:direct/P1433"--> v1
a1 --"p:statement/P4032"--> v3
v2 --"p:P4032"--> a1
bind0[/"if(?reviewer = 'wd:Q4233718','1^^xsd:integer','0^^xsd:integer')"/]
v3 --o bind0
bind0 --as--o v4
bind1[/"if(?reviewer = 'wd:Q4233718','0^^xsd:integer','1^^xsd:integer')"/]
v3 --o bind1
bind1 --as--o v5
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c7 --"wikibase:language"--> c9
end
bind4[/"sum(?anon)"/]
v4 --o bind4
bind4 --as--o v6
bind5[/"sum(?named)"/]
v5 --o bind5
bind5 --as--o v7
bind6[/"numeric-floor(?anoncount / ?anoncount + ?namedcount * '100^^xsd:integer') / '100^^xsd:integer'"/]
v6 --o bind6
v7 --o bind6
bind6 --as--o v8