query-00b50a9b97bd9ad65a244af57c9ed630

rq turtle/ttl

title: Which Zephyranthes (Q191364) spp. lack compounds known from at least two species in the genus? PREFIX target: http://www.wikidata.org/entity/Q191364 # Zephyranthes SELECT DISTINCT ?compound ?compoundLabel ?taxon_with_compound ?another_taxon_with_compound ?taxon_without_compound WITH { SELECT DISTINCT ?compound ?taxon_YES_1 ?taxon_YES_2 WHERE { ?compound wdt:P703 ?taxon_YES_1 . ?compound wdt:P703 ?taxon_YES_2 . ?taxon_YES_1 wdt:P171 target: . ?taxon_YES_2 wdt:P171 target: . FILTER (?taxon_YES_2 != ?taxon_YES_1) } } AS %taxa_with_compound WITH { SELECT DISTINCT ?taxon_NO ?compound WHERE { INCLUDE %taxa_with_compound ?taxon_NO wdt:P171 target: . FILTER (?taxon_YES_1 != ?taxon_NO) } } AS %taxon_without_compond WHERE { INCLUDE %taxa_with_compound INCLUDE %taxon_without_compond FILTER NOT EXISTS { ?compound wdt:P703 ?taxon_NO .} VALUES ?classes { wd:Q113145171 wd:Q59199015 } ?taxon_YES_1 wdt:P225 ?taxon_with_compound . ?taxon_YES_2 wdt:P225 ?another_taxon_with_compound . ?taxon_NO wdt:P225 ?taxon_without_compound . ?compound (wdt:P31/wdt:P279) ?classes . ?compound rdfs:label ?compoundLabel. FILTER(LANG(?compoundLabel) = "en"). } LIMIT 10000 title: Which Zephyranthes (Q191364) spp. lack compounds known from at least two species in the genus? PREFIX target: http://www.wikidata.org/entity/Q191364 # Zephyranthes SELECT DISTINCT ?compound ?compoundLabel ?taxon_with_compound ?another_taxon_with_compound ?taxon_without_compound WITH { SELECT DISTINCT ?compound ?taxon_YES_1 ?taxon_YES_2 WHERE { ?compound wdt:P703 ?taxon_YES_1 . ?compound wdt:P703 ?taxon_YES_2 . ?taxon_YES_1 wdt:P171 target: . ?taxon_YES_2 wdt:P171 target: . FILTER (?taxon_YES_2 != ?taxon_YES_1) } } AS %taxa_with_compound WITH { SELECT DISTINCT ?taxon_NO ?compound WHERE { INCLUDE %taxa_with_compound ?taxon_NO wdt:P171 target: . FILTER (?taxon_YES_1 != ?taxon_NO) } } AS %taxon_without_compond WHERE { INCLUDE %taxa_with_compound INCLUDE %taxon_without_compond FILTER NOT EXISTS { ?compound wdt:P703 ?taxon_NO .} VALUES ?classes { wd:Q113145171 wd:Q59199015 } ?taxon_YES_1 wdt:P225 ?taxon_with_compound . ?taxon_YES_2 wdt:P225 ?another_taxon_with_compound . ?taxon_NO wdt:P225 ?taxon_without_compound . ?compound (wdt:P31/wdt:P279) ?classes . ?compound rdfs:label ?compoundLabel. FILTER(LANG(?compoundLabel) = "en"). } LIMIT 10000 title: Which Zephyranthes (Q191364) spp. lack compounds known from at least two species in the genus? PREFIX target: http://www.wikidata.org/entity/Q191364 # Zephyranthes SELECT DISTINCT ?compound ?compoundLabel ?taxon_with_compound ?another_taxon_with_compound ?taxon_without_compound WITH { SELECT DISTINCT ?compound ?taxon_YES_1 ?taxon_YES_2 WHERE { ?compound wdt:P703 ?taxon_YES_1 . ?compound wdt:P703 ?taxon_YES_2 . ?taxon_YES_1 wdt:P171 target: . ?taxon_YES_2 wdt:P171 target: . FILTER (?taxon_YES_2 != ?taxon_YES_1) } } AS %taxa_with_compound WITH { SELECT DISTINCT ?taxon_NO ?compound WHERE { INCLUDE %taxa_with_compound ?taxon_NO wdt:P171 target: . FILTER (?taxon_YES_1 != ?taxon_NO) } } AS %taxon_without_compond WHERE { INCLUDE %taxa_with_compound INCLUDE %taxon_without_compond FILTER NOT EXISTS { ?compound wdt:P703 ?taxon_NO .} VALUES ?classes { wd:Q113145171 wd:Q59199015 } ?taxon_YES_1 wdt:P225 ?taxon_with_compound . ?taxon_YES_2 wdt:P225 ?another_taxon_with_compound . ?taxon_NO wdt:P225 ?taxon_without_compound . ?compound (wdt:P31/wdt:P279) ?classes . ?compound rdfs:label ?compoundLabel. FILTER(LANG(?compoundLabel) = "en"). } LIMIT 10000 title: Which Zephyranthes (Q191364) spp. lack compounds known from at least two species in the genus? PREFIX target: http://www.wikidata.org/entity/Q191364 # Zephyranthes SELECT DISTINCT ?compound ?compoundLabel ?taxon_with_compound ?another_taxon_with_compound ?taxon_without_compound WITH { SELECT DISTINCT ?compound ?taxon_YES_1 ?taxon_YES_2 WHERE { ?compound wdt:P703 ?taxon_YES_1 . ?compound wdt:P703 ?taxon_YES_2 . ?taxon_YES_1 wdt:P171 target: . ?taxon_YES_2 wdt:P171 target: . FILTER (?taxon_YES_2 != ?taxon_YES_1) } } AS %taxa_with_compound WITH { SELECT DISTINCT ?taxon_NO ?compound WHERE { INCLUDE %taxa_with_compound ?taxon_NO wdt:P171 target: . FILTER (?taxon_YES_1 != ?taxon_NO) } } AS %taxon_without_compond WHERE { INCLUDE %taxa_with_compound INCLUDE %taxon_without_compond FILTER NOT EXISTS { ?compound wdt:P703 ?taxon_NO .} VALUES ?classes { wd:Q113145171 wd:Q59199015 } ?taxon_YES_1 wdt:P225 ?taxon_with_compound . ?taxon_YES_2 wdt:P225 ?another_taxon_with_compound . ?taxon_NO wdt:P225 ?taxon_without_compound . ?compound (wdt:P31/wdt:P279) ?classes . ?compound rdfs:label ?compoundLabel. FILTER(LANG(?compoundLabel) = "en"). } LIMIT 10000 title: Which Zephyranthes (Q191364) spp. lack compounds known from at least two species in the genus? PREFIX target: http://www.wikidata.org/entity/Q191364 # Zephyranthes SELECT DISTINCT ?compound ?compoundLabel ?taxon_with_compound ?another_taxon_with_compound ?taxon_without_compound WITH { SELECT DISTINCT ?compound ?taxon_YES_1 ?taxon_YES_2 WHERE { ?compound wdt:P703 ?taxon_YES_1 . ?compound wdt:P703 ?taxon_YES_2 . ?taxon_YES_1 wdt:P171 target: . ?taxon_YES_2 wdt:P171 target: . FILTER (?taxon_YES_2 != ?taxon_YES_1) } } AS %taxa_with_compound WITH { SELECT DISTINCT ?taxon_NO ?compound WHERE { INCLUDE %taxa_with_compound ?taxon_NO wdt:P171 target: . FILTER (?taxon_YES_1 != ?taxon_NO) } } AS %taxon_without_compond WHERE { INCLUDE %taxa_with_compound INCLUDE %taxon_without_compond FILTER NOT EXISTS { ?compound wdt:P703 ?taxon_NO .} VALUES ?classes { wd:Q113145171 wd:Q59199015 } ?taxon_YES_1 wdt:P225 ?taxon_with_compound . ?taxon_YES_2 wdt:P225 ?another_taxon_with_compound . ?taxon_NO wdt:P225 ?taxon_without_compound . ?compound (wdt:P31/wdt:P279) ?classes . ?compound rdfs:label ?compoundLabel. FILTER(LANG(?compoundLabel) = "en"). } LIMIT 10000 title: Which Zephyranthes (Q191364) spp. lack compounds known from at least two species in the genus? PREFIX target: http://www.wikidata.org/entity/Q191364 # Zephyranthes SELECT DISTINCT ?compound ?compoundLabel ?taxon_with_compound ?another_taxon_with_compound ?taxon_without_compound WITH { SELECT DISTINCT ?compound ?taxon_YES_1 ?taxon_YES_2 WHERE { ?compound wdt:P703 ?taxon_YES_1 . ?compound wdt:P703 ?taxon_YES_2 . ?taxon_YES_1 wdt:P171 target: . ?taxon_YES_2 wdt:P171 target: . FILTER (?taxon_YES_2 != ?taxon_YES_1) } } AS %taxa_with_compound WITH { SELECT DISTINCT ?taxon_NO ?compound WHERE { INCLUDE %taxa_with_compound ?taxon_NO wdt:P171 target: . FILTER (?taxon_YES_1 != ?taxon_NO) } } AS %taxon_without_compond WHERE { INCLUDE %taxa_with_compound INCLUDE %taxon_without_compond FILTER NOT EXISTS { ?compound wdt:P703 ?taxon_NO .} VALUES ?classes { wd:Q113145171 wd:Q59199015 } ?taxon_YES_1 wdt:P225 ?taxon_with_compound . ?taxon_YES_2 wdt:P225 ?another_taxon_with_compound . ?taxon_NO wdt:P225 ?taxon_without_compound . ?compound (wdt:P31/wdt:P279) ?classes . ?compound rdfs:label ?compoundLabel. FILTER(LANG(?compoundLabel) = "en"). } LIMIT 10000

Use at

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
#title: Which Zephyranthes (Q191364) spp. lack compounds known from at least two species in the genus?
PREFIX target: <http://www.wikidata.org/entity/Q191364> # Zephyranthes
SELECT DISTINCT ?compound ?compoundLabel ?taxon_with_compound ?another_taxon_with_compound ?taxon_without_compound 

WHERE {
   { 
  SELECT DISTINCT ?compound ?taxon_YES_1 ?taxon_YES_2 
  WHERE {
    ?compound wdt:P703 ?taxon_YES_1 .
    ?compound wdt:P703 ?taxon_YES_2 .
    ?taxon_YES_1 wdt:P171 target: .
    ?taxon_YES_2 wdt:P171 target: .
    FILTER (?taxon_YES_2 != ?taxon_YES_1)
  }
}  
{ 
  SELECT DISTINCT ?taxon_NO ?compound 
  WHERE {
     { 
  SELECT DISTINCT ?compound ?taxon_YES_1 ?taxon_YES_2 
  WHERE {
    ?compound wdt:P703 ?taxon_YES_1 .
    ?compound wdt:P703 ?taxon_YES_2 .
    ?taxon_YES_1 wdt:P171 target: .
    ?taxon_YES_2 wdt:P171 target: .
    FILTER (?taxon_YES_2 != ?taxon_YES_1)
  }
}    ?taxon_NO wdt:P171 target: .
    FILTER (?taxon_YES_1 != ?taxon_NO)
  }
}  FILTER NOT EXISTS { ?compound wdt:P703 ?taxon_NO .}
  VALUES ?classes {
    wd:Q113145171
    wd:Q59199015
  }
  ?taxon_YES_1 wdt:P225 ?taxon_with_compound .
  ?taxon_YES_2 wdt:P225 ?another_taxon_with_compound .
  ?taxon_NO wdt:P225 ?taxon_without_compound .
  ?compound (wdt:P31*/wdt:P279*) ?classes .
  ?compound rdfs:label ?compoundLabel.
  FILTER(LANG(?compoundLabel) = "en").
}
LIMIT 10000

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v8("?another_taxon_with_compound"):::projected v6("?classes") v2("?compound"):::projected v1("?compoundLabel"):::projected v3("?taxon_NO") v5("?taxon_YES_1") v4("?taxon_YES_2") v7("?taxon_with_compound"):::projected v9("?taxon_without_compound"):::projected a1((" ")) c4(["wd:Q191364"]):::iri f0[["?compoundLabel = 'en'"]] f0 --> v1 f1[["not "]] subgraph f1e0["Exists Clause"] e0v1 --"wdt:P703"--> e0v2 e0v1("?compound"):::projected e0v2("?taxon_NO"):::projected end f1--EXISTS--> f1e0 f1 --> v2 f1 --> c2 f1 --> v3 v2 --"wdt:P703"--> v3 f2[["?taxon_YES_2 != ?taxon_YES_1"]] f2 --> v4 f2 --> v5 v2 --"wdt:P703"--> v5 v2 --"wdt:P703"--> v4 v5 --"wdt:P171"--> c4 v4 --"wdt:P171"--> c4 f3[["?taxon_YES_1 != ?taxon_NO"]] f3 --> v5 f3 --> v3 f4[["?taxon_YES_2 != ?taxon_YES_1"]] f4 --> v4 f4 --> v5 v2 --"wdt:P703"--> v5 v2 --"wdt:P703"--> v4 v5 --"wdt:P171"--> c4 v4 --"wdt:P171"--> c4 v3 --"wdt:P171"--> c4 bind5[/VALUES ?classes/] bind5-->v6 bind50(["wd:Q113145171"]) bind50 --> bind5 bind51(["wd:Q59199015"]) bind51 --> bind5 v5 --"wdt:P225"--> v7 v4 --"wdt:P225"--> v8 v3 --"wdt:P225"--> v9 v2 --"wdt:P31"--> a1 a1 --"wdt:P279"--> v6 v2 --"rdfs:label"--> v1