query-ef11101b4411ceea5816bce5f7433d47
taxa with author, but no Wikispecies sitelink
by Jura1, August 28, 2020
SELECT ?author ?authorLabel ?taxa ?count WITH { SELECT ?author (GROUP_CONCAT(DISTINCT ?taxon; separator=", ") as ?taxa) (COUNT(?taxon) as ?count) WHERE { ?st pq:P405 ?author . FILTER NOT EXISTS { [] schema:about ?author ; schema:isPartOf https://species.wikimedia.org/ } ?st ps:P225 ?taxon . } GROUP BY ?author } as %new WHERE { INCLUDE %new SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } ORDER BY DESC(?count) LIMIT 100
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX schema: <http://schema.org/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#taxa with author, but no Wikispecies sitelink
#by Jura1, August 28, 2020
SELECT ?author ?authorLabel ?taxa ?count
WHERE
{
{
SELECT ?author
(GROUP_CONCAT(DISTINCT ?taxon; separator=", ") as ?taxa)
(COUNT(?taxon) as ?count)
WHERE
{
?st pq:P405 ?author .
FILTER NOT EXISTS { [] schema:about ?author ; schema:isPartOf <https://species.wikimedia.org/> }
?st ps:P225 ?taxon .
}
GROUP BY ?author
} SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY DESC(?count)
LIMIT 100
Query found at
- https://www.wikidata.org/wiki/User:Korg/queries
- https://www.wikidata.org/wiki/Wikidata:Request_a_query/Archive/2020/08
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?author"):::projected
v6("?count"):::projected
v3("?st")
v5("?taxa"):::projected
v4("?taxon")
a1((" "))
c3([https://species.wikimedia.org/]):::iri
c7(["bd:serviceParam"]):::iri
c9(["#91;AUTO_LANGUAGE#93;,en"]):::literal
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0a1 --"schema:about"--> e0v1
e0a1 --"schema:isPartOf"--> e0c3
e0v1("?author"):::projected
e0a1((" ")):::projected
e0c3([https://species.wikimedia.org/]):::iri
end
f0--EXISTS--> f0e0
f0 --> a1
f0 --> c1
f0 --> v2
f0 --> c2
f0 --> c3
a1 --"schema:about"--> v2
a1 --"schema:isPartOf"--> c3
v3 --"pq:P405"--> v2
v3 --"ps:P225"--> v4
bind3[/"?taxon"/]
v4 --o bind3
bind3 --as--o v5
bind4[/"count(?taxon)"/]
v4 --o bind4
bind4 --as--o v6
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c7 --"wikibase:language"--> c9
end