query-2e6cff5603d73803abc9274df49b8682

rq turtle/ttl

title: Which compounds corresponding to a given mass ± 10ppm are found in which organism(s)? SELECT DISTINCT ?compound ?mf ?inchi (GROUP_CONCAT(?taxon_name; SEPARATOR = ", ") AS ?organism) WITH { SELECT ?compound WHERE { VALUES ?query { "524.1765"^^xsd:decimal } VALUES ?ppm { "10"^^xsd:decimal } ?compound wdt:P2067 ?mass. FILTER((?mass > (?query - ((?ppm * "0.000001"^^xsd:decimal) * ?query))) && (?mass < (?query + ((?ppm * "0.000001"^^xsd:decimal) * ?query)))) } } AS %compounds WHERE { INCLUDE %compounds ?compound (wdt:P703/wdt:P225) ?taxon_name; wdt:P234 ?inchi; wdt:P274 ?mf. } GROUP BY ?compound ?mf ?inchi LIMIT 10000 title: Which compounds corresponding to a given mass ± 10ppm are found in which organism(s)? SELECT DISTINCT ?compound ?mf ?inchi (GROUP_CONCAT(?taxon_name; SEPARATOR = ", ") AS ?organism) WITH { SELECT ?compound WHERE { VALUES ?query { "524.1765"^^xsd:decimal } VALUES ?ppm { "10"^^xsd:decimal } ?compound wdt:P2067 ?mass. FILTER((?mass > (?query - ((?ppm * "0.000001"^^xsd:decimal) * ?query))) && (?mass < (?query + ((?ppm * "0.000001"^^xsd:decimal) * ?query)))) } } AS %compounds WHERE { INCLUDE %compounds ?compound (wdt:P703/wdt:P225) ?taxon_name; wdt:P234 ?inchi; wdt:P274 ?mf. } GROUP BY ?compound ?mf ?inchi LIMIT 10000 title: Which compounds corresponding to a given mass ± 10ppm are found in which organism(s)? SELECT DISTINCT ?compound ?mf ?inchi (GROUP_CONCAT(?taxon_name; SEPARATOR = ", ") AS ?organism) WITH { SELECT ?compound WHERE { VALUES ?query { "524.1765"^^xsd:decimal } VALUES ?ppm { "10"^^xsd:decimal } ?compound wdt:P2067 ?mass. FILTER((?mass > (?query - ((?ppm * "0.000001"^^xsd:decimal) * ?query))) && (?mass < (?query + ((?ppm * "0.000001"^^xsd:decimal) * ?query)))) } } AS %compounds WHERE { INCLUDE %compounds ?compound (wdt:P703/wdt:P225) ?taxon_name; wdt:P234 ?inchi; wdt:P274 ?mf. } GROUP BY ?compound ?mf ?inchi LIMIT 10000 title: Which compounds corresponding to a given mass ± 10ppm are found in which organism(s)? SELECT DISTINCT ?compound ?mf ?inchi (GROUP_CONCAT(?taxon_name; SEPARATOR = ", ") AS ?organism) WITH { SELECT ?compound WHERE { VALUES ?query { "524.1765"^^xsd:decimal } VALUES ?ppm { "10"^^xsd:decimal } ?compound wdt:P2067 ?mass. FILTER((?mass > (?query - ((?ppm * "0.000001"^^xsd:decimal) * ?query))) && (?mass < (?query + ((?ppm * "0.000001"^^xsd:decimal) * ?query)))) } } AS %compounds WHERE { INCLUDE %compounds ?compound (wdt:P703/wdt:P225) ?taxon_name; wdt:P234 ?inchi; wdt:P274 ?mf. } GROUP BY ?compound ?mf ?inchi LIMIT 10000 title: Which compounds corresponding to a given mass ± 10ppm are found in which organism(s)? SELECT DISTINCT ?compound ?mf ?inchi (GROUP_CONCAT(?taxon_name; SEPARATOR = ", ") AS ?organism) WITH { SELECT ?compound WHERE { VALUES ?query { "524.1765"^^xsd:decimal } VALUES ?ppm { "10"^^xsd:decimal } ?compound wdt:P2067 ?mass. FILTER((?mass > (?query - ((?ppm * "0.000001"^^xsd:decimal) * ?query))) && (?mass < (?query + ((?ppm * "0.000001"^^xsd:decimal) * ?query)))) } } AS %compounds WHERE { INCLUDE %compounds ?compound (wdt:P703/wdt:P225) ?taxon_name; wdt:P234 ?inchi; wdt:P274 ?mf. } GROUP BY ?compound ?mf ?inchi LIMIT 10000 title: Which compounds corresponding to a given mass ± 10ppm are found in which organism(s)? SELECT DISTINCT ?compound ?mf ?inchi (GROUP_CONCAT(?taxon_name; SEPARATOR = ", ") AS ?organism) WITH { SELECT ?compound WHERE { VALUES ?query { "524.1765"^^xsd:decimal } VALUES ?ppm { "10"^^xsd:decimal } ?compound wdt:P2067 ?mass. FILTER((?mass > (?query - ((?ppm * "0.000001"^^xsd:decimal) * ?query))) && (?mass < (?query + ((?ppm * "0.000001"^^xsd:decimal) * ?query)))) } } AS %compounds WHERE { INCLUDE %compounds ?compound (wdt:P703/wdt:P225) ?taxon_name; wdt:P234 ?inchi; wdt:P274 ?mf. } GROUP BY ?compound ?mf ?inchi LIMIT 10000

Use at

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
#title: Which compounds corresponding to a given mass ± 10ppm are found in which organism(s)?
SELECT DISTINCT ?compound ?mf ?inchi (GROUP_CONCAT(?taxon_name; SEPARATOR = ", ") AS ?organism) WHERE {
   {
  SELECT ?compound WHERE {
    VALUES ?query {
      "524.1765"^^xsd:decimal
    }
    VALUES ?ppm {
      "10"^^xsd:decimal
    }
    ?compound wdt:P2067 ?mass.
    FILTER((?mass > (?query - ((?ppm * "0.000001"^^xsd:decimal) * ?query))) && (?mass < (?query + ((?ppm * "0.000001"^^xsd:decimal) * ?query))))
  }
}  ?compound (wdt:P703/wdt:P225) ?taxon_name;
    wdt:P234 ?inchi;
    wdt:P274 ?mf.
}
GROUP BY ?compound ?mf ?inchi
LIMIT 10000

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?compound"):::projected v6("?inchi"):::projected v1("?mass") v7("?mf"):::projected v8("?organism") v4("?ppm") v4("?query") v5("?taxon_name"):::projected a1((" ")) f0[["?mass > ?query - ?ppm * '0.000001^^xsd:decimal' * ?query?mass < ?query + ?ppm * '0.000001^^xsd:decimal' * ?query"]] f0 --> v1 f0 --> v4 f0 --> v4 bind1[/VALUES ?query/] bind1-->v4 bind10(["524.1765^^xsd:decimal"]) bind10 --> bind1 bind2[/VALUES ?ppm/] bind2-->v4 bind20(["10^^xsd:decimal"]) bind20 --> bind2 v4 --"wdt:P2067"--> v1 v4 --"wdt:P703"--> a1 a1 --"wdt:P225"--> v5 v4 --"wdt:P234"--> v6 v4 --"wdt:P274"--> v7 bind4[/"?taxon_name"/] v5 --o bind4 bind4 --as--o v8