query-5297d3606c14abd007296158142442db

rq turtle/ttl

Propertiesinstance of (P31)natural product of taxon (P1582)stated in (P248) Propertiesinstance of (P31)natural product of taxon (P1582)stated in (P248) Propertiesinstance of (P31)natural product of taxon (P1582)stated in (P248) Propertiesinstance of (P31)natural product of taxon (P1582)stated in (P248) Propertiesinstance of (P31)natural product of taxon (P1582)stated in (P248) Propertiesinstance of (P31)natural product of taxon (P1582)stated in (P248)

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX pr: <http://www.wikidata.org/prop/reference/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?taxonLabel ?artLabel WHERE {
  VALUES ?classes {
    wd:Q113145171 # type of a chemical entity
    wd:Q59199015 # group of stereoisomers
  }
  ?item wdt:P31 ?classes. # instance of
  {
    ?item p:P1582 ?stmt. # natural product of taxon
    ?stmt ps:P1582 ?taxon. # natural product of taxon
    OPTIONAL {
      ?stmt prov:wasDerivedFrom ?ref. 
      ?ref pr:P248 ?art. # stated in
    }
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
LIMIT 10000

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v6("?art") v1("?classes") v2("?item"):::projected v5("?ref") v3("?stmt") v4("?taxon") c7(["bd:serviceParam"]):::iri c9(["#91;AUTO_LANGUAGE#93;,en"]):::literal bind0[/VALUES ?classes/] bind0-->v1 bind00(["wd:Q113145171"]) bind00 --> bind0 bind01(["wd:Q59199015"]) bind01 --> bind0 v2 --"p:direct/P31"--> v1 v2 --"p:P1582"--> v3 v3 --"p:statement/P1582"--> v4 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v3 -."prov:wasDerivedFrom".-> v5 v5 --"p:reference/P248"--> v6 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c7 --"wikibase:language"--> c9 end