A set of SPARQL examples that are used in LOTUS
Compounds found in Arabidopsis thaliana (Q158695) and Celastrus (Q811662) or children taxa.
PREFIX bd: <http://www.bigdata.com/rdf#>
PREFIX hint: <http://www.bigdata.com/queryHints#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wikibase: <http://wikiba.se/ontology#>
#title: Compounds found in Arabidopsis thaliana (Q158695) and Celastrus (Q811662) or children taxa.
SELECT DISTINCT ?compound ?compoundLabel ?compound_inchikey ?childLabel WHERE {
{
SELECT ?child WHERE {
{ ?child (wdt:P171*) wd:Q158695. }
UNION
{ ?child (wdt:P171*) wd:Q811662. }
}
}
hint:Prior hint:runFirst true.
?compound wdt:P235 ?compound_inchikey;
wdt:P703 ?child.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". }
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?child")
v2("?compound"):::projected
v3("?compound_inchikey"):::projected
c4([http://www.bigdata.com/queryHints#Prior]):::iri
c10([http://www.bigdata.com/rdf#serviceParam]):::iri
c6(["true^^xsd:boolean"]):::literal
c2(["wd:Q158695"]):::iri
c12(["#91;AUTO_LANGUAGE#93;,mul,en"]):::literal
c3(["wd:Q811662"]):::iri
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P171"--> c3
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P171"--> c2
end
union0r <== or ==> union0l
end
c4 --http://www.bigdata.com/queryHints#runFirst--> c6
v2 --"wdt:P235"--> v3
v2 --"wdt:P703"--> v1
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
end