sparql-examples

A set of SPARQL examples

View the Project on GitHub Adafede/sparql-examples

wd_chemicals_classes

rq turtle/ttl

Chemicals classes.

Use at


PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX hint: <http://www.bigdata.com/queryHints#>
#title: Chemicals subclass of chemical class
SELECT * WHERE {
    VALUES ?instance {
        wd:Q15711994 # group of isomeric entities
        wd:Q17339814 # group or class of chemical substances
        wd:Q47154513 # structural class of chemical entities
        wd:Q55640599 # group of chemical entities
        wd:Q56256173 # class of chemical entities with similar applications or functions
        wd:Q56256178 # class of chemical entities with similar source or occurrence
        wd:Q55662456 # group of ortho, meta, para isomers
        wd:Q59199015 # group of stereoisomers
        wd:Q72070508 # group or class of chemical entities
        wd:Q74892521 # imprecise class of chemical entities
    }
    ?class wdt:P31 ?instance. hint:Prior hint:runFirst true.
    ?structure wdt:P279 ?class. hint:Prior hint:rangeSafe true.
}

graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v2("?class"):::projected 
  v1("?instance"):::projected 
  v3("?structure"):::projected 
  c2([http://www.bigdata.com/queryHints#Prior]):::iri 
  c4(["true^^xsd:boolean"]):::literal 
  bind0[/VALUES ?instance/]
  bind0-->v1
  bind00(["wd:Q15711994"])
  bind00 --> bind0
  bind01(["wd:Q17339814"])
  bind01 --> bind0
  bind02(["wd:Q47154513"])
  bind02 --> bind0
  bind03(["wd:Q55640599"])
  bind03 --> bind0
  bind04(["wd:Q56256173"])
  bind04 --> bind0
  bind05(["wd:Q56256178"])
  bind05 --> bind0
  bind06(["wd:Q55662456"])
  bind06 --> bind0
  bind07(["wd:Q59199015"])
  bind07 --> bind0
  bind08(["wd:Q72070508"])
  bind08 --> bind0
  bind09(["wd:Q74892521"])
  bind09 --> bind0
  v2 --"wdt:P31"-->  v1
  c2 --http://www.bigdata.com/queryHints#runFirst-->  c4
  v3 --"wdt:P279"-->  v2
  c2 --http://www.bigdata.com/queryHints#rangeSafe-->  c4