sparql-examples

A set of SPARQL examples

View the Project on GitHub Adafede/sparql-examples

wd_chemicals_stereosiomers

rq turtle/ttl

Which compounds have more than 30 stereoisomers?

Use at


PREFIX wdt: <http://www.wikidata.org/prop/direct/>
#title: Which compounds have more than 30 stereoisomers?
SELECT ?s (COUNT(?o) AS ?count) WHERE { ?s wdt:P3364 ?o. }
GROUP BY ?s
HAVING (?count > 30)
ORDER BY DESC(?count)

graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v4("?count")
  v3("?o"):::projected 
  v2("?s"):::projected 
  f0[["?count > '30^^xsd:integer'"]]
  f0 --> v4
  v2 --"wdt:P3364"-->  v3
  bind2[/"count(?o)"/]
  v3 --o bind2
  bind2 --as--o v4