query-13c3f5d6bb93b541788c62a34ca05c61
Count of epithets
Use at
- https://query.wikidata.org/sparql
PREFIX gas: <http://www.bigdata.com/rdf/gas#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT DISTINCT ?epithet (COUNT(?epithet) AS ?countOfEpithet) WHERE {
SERVICE gas:service {
gas:program gas:gasClass "com.bigdata.rdf.graph.analytics.BFS" .
gas:program gas:in wd:Q14560 . # Plantae - times out
gas:program gas:out ?item .
gas:program gas:maxIterations 20 .
gas:program gas:maxVisited 2700000 .
gas:program gas:linkType wdt:P171 .
gas:program gas:traversalDirection "Reverse" .
}
?item wdt:P105 wd:Q7432 .
?item wdt:P225 ?taxonName .
BIND(strbefore(?taxonName, " ") as ?genus)
BIND(strafter(?taxonName, " ") as ?epithet)
}
GROUP BY ?epithet
ORDER BY DESC(?countOfEpithet) ASC(?epithet)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?countOfEpithet")
v6("?epithet"):::projected
v5("?genus")
v3("?item")
v4("?taxonName")
c2(["gas:program"]):::iri
c15(["Reverse"]):::literal
c11(["2700000^^xsd:integer"]):::literal
c4(["com.bigdata.rdf.graph.analytics.BFS"]):::literal
c17(["wd:Q7432"]):::iri
c13(["wdt:P171"]):::iri
c6(["wd:Q14560"]):::iri
c9(["20^^xsd:integer"]):::literal
subgraph s1["http://www.bigdata.com/rdf/gas#service"]
style s1 stroke-width:4px;
c2 --"gas:gasClass"--> c4
c2 --"gas:in"--> c6
c2 --"gas:out"--> v3
c2 --"gas:maxIterations"--> c9
c2 --"gas:maxVisited"--> c11
c2 --"gas:linkType"--> c13
c2 --"gas:traversalDirection"--> c15
end
v3 --"wdt:P105"--> c17
v3 --"wdt:P225"--> v4
bind0[/"substring-before(?taxonName,' ')"/]
v4 --o bind0
bind0 --as--o v5
bind1[/"substring-after(?taxonName,' ')"/]
v4 --o bind1
bind1 --as--o v6
bind3[/"count(?epithet)"/]
v6 --o bind3
bind3 --as--o v6