query-feb75e39c1ea4b9e30f013b4b95183bc
Author names needing items, by employer SELECT (COUNT(?paper) AS ?countPapers) ?item ?nameString { ?item wdt:P108 wd:Q1138080; #employer rdfs:label ?name . BIND(STR(?name) AS ?nameString) FILTER(LANG(?name)="en") FILTER NOT EXISTS { ?anotherPerson wdt:P31 wd:Q5; rdfs:label ?name . FILTER(?anotherPerson != ?item) } ?paper wdt:P2093 ?nameString . } GROUP BY ?item ?nameString ORDER BY DESC(?countPapers)
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
#Author names needing items, by employer
SELECT (COUNT(?paper) AS ?countPapers) ?item ?nameString {
?item wdt:P108 wd:Q1138080; #employer
rdfs:label ?name .
BIND(STR(?name) AS ?nameString)
FILTER(LANG(?name)="en")
FILTER NOT EXISTS {
?anotherPerson wdt:P31 wd:Q5;
rdfs:label ?name .
FILTER(?anotherPerson != ?item)
}
?paper wdt:P2093 ?nameString .
}
GROUP BY ?item ?nameString
ORDER BY DESC(?countPapers)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?anotherPerson")
v7("?countPapers")
v3("?item"):::projected
v4("?name")
v5("?nameString"):::projected
v6("?paper"):::projected
c6(["wd:Q1138080"]):::iri
c2(["wd:Q5"]):::iri
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0f0[["?anotherPerson != ?item"]]
e0f0 --> e0v1
e0f0 --> e0v2
e0v1 --"wdt:P31"--> e0c2
e0v1 --"rdfs:label"--> e0v3
e0v1("?anotherPerson"):::projected
e0v2("?item"):::projected
e0v3("?name"):::projected
e0c2(["wd:Q5"]):::iri
end
f0--EXISTS--> f0e0
f0 --> v2
f0 --> v3
f0 --> c1
f0 --> c2
f0 --> c3
f0 --> v4
f1[["?anotherPerson != ?item"]]
f1 --> v2
f1 --> v3
v2 --"wdt:P31"--> c2
v2 --"rdfs:label"--> v4
f2[["?name = 'en'"]]
f2 --> v4
v3 --"wdt:P108"--> c6
v3 --"rdfs:label"--> v4
bind3[/"str(?name)"/]
v4 --o bind3
bind3 --as--o v5
v6 --"wdt:P2093"--> v5
bind5[/"count(?paper)"/]
v6 --o bind5
bind5 --as--o v7