query-7c48d1405a65270a31a0189c52045878
- Count citation for every original work of the author plus cittations of versions
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#>
SELECT ?original_work ?original_workLabel (COUNT(?citingArticles) AS ?count) (GROUP_CONCAT(DISTINCT ?version_name; separator =", ") as ?versions)
WHERE {
?original_work wdt:P50 wd:Q63809637.
FILTER NOT EXISTS { ?original_work wdt:P31 wd:Q3331189.}
OPTIONAL{
{?citingArticles wdt:P2860 ?original_work.}
UNION {
?original_work wdt:P747 ?version.
OPTIONAL{?version wdt:P1476 ?version_name.}
OPTIONAL{?citingArticles wdt:P2860 ?version.}
}
}
SERVICE wikibase:label { bd:serviceParam wikibase:language
"[AUTO_LANGUAGE], en". }
}
GROUP BY ?original_work ?original_workLabel
ORDER BY DESC(?count)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?citingArticles"):::projected
v6("?count")
v2("?original_work"):::projected
v4("?version")
v5("?version_name"):::projected
v6("?versions")
c9(["bd:serviceParam"]):::iri
c4(["wd:Q63809637"]):::iri
c2(["wd:Q3331189"]):::iri
c11(["#91;AUTO_LANGUAGE#93;, en"]):::literal
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0v1 --"wdt:P31"--> e0c2
e0v1("?original_work"):::projected
e0c2(["wd:Q3331189"]):::iri
end
f0--EXISTS--> f0e0
f0 --> v2
f0 --> c1
f0 --> c2
v2 --"wdt:P31"--> c2
v2 --"wdt:P50"--> c4
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v2 -."wdt:P747".-> v4
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v4 -."wdt:P1476".-> v5
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P2860".-> v4
end
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v3 --"wdt:P2860"--> v2
end
union0r <== or ==> union0l
end
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c9 --"wikibase:language"--> c11
end
bind3[/"count(?citingArticles)"/]
v3 --o bind3
bind3 --as--o v6
bind4[/"?version_name"/]
v5 --o bind4
bind4 --as--o v6