query-878e9f75ad56ab7eff93a470bb14fef7

rq turtle/ttl

title: How many compounds are structurally similar to compounds labeled as antibiotics? Results are grouped by the parent taxon of the organism they were found in. PREFIX sachem: http://bioinfo.uochb.cas.cz/rdf/v1.0/sachem# # prefixes needed for structural similarity search PREFIX idsm: https://idsm.elixir-czech.cz/sparql/endpoint/ SELECT ?parent_taxon ?parent_taxon_name (COUNT(DISTINCT ?compound) AS ?count) WHERE { SERVICE idsm:wikidata { VALUES ?CUTOFF { "0.9"^^xsd:double } SERVICE https://query.wikidata.org/bigdata/namespace/wdq/sparql { VALUES ?MESH { "D000900" } ?antibiotic ((wdt:P279)/wdt:P2868/wdt:P486) ?MESH; wdt:P233 ?smiles. } ?compound sachem:similarCompoundSearch :b40. :b40 sachem:query ?smiles; sachem:cutoff ?CUTOFF. } hint:Prior hint:runFirst "true"^^xsd:boolean. ?compound wdt:P703/wdt:P171 ?parent_taxon. ?parent_taxon wdt:P225 ?parent_taxon_name. } GROUP BY ?parent_taxon ?parent_taxon_name ORDER BY DESC (?count) title: How many compounds are structurally similar to compounds labeled as antibiotics? Results are grouped by the parent taxon of the organism they were found in. PREFIX sachem: http://bioinfo.uochb.cas.cz/rdf/v1.0/sachem# # prefixes needed for structural similarity search PREFIX idsm: https://idsm.elixir-czech.cz/sparql/endpoint/ SELECT ?parent_taxon ?parent_taxon_name (COUNT(DISTINCT ?compound) AS ?count) WHERE { SERVICE idsm:wikidata { VALUES ?CUTOFF { "0.9"^^xsd:double } SERVICE https://query.wikidata.org/bigdata/namespace/wdq/sparql { VALUES ?MESH { "D000900" } ?antibiotic ((wdt:P279)/wdt:P2868/wdt:P486) ?MESH; wdt:P233 ?smiles. } ?compound sachem:similarCompoundSearch :b40. :b40 sachem:query ?smiles; sachem:cutoff ?CUTOFF. } hint:Prior hint:runFirst "true"^^xsd:boolean. ?compound wdt:P703/wdt:P171 ?parent_taxon. ?parent_taxon wdt:P225 ?parent_taxon_name. } GROUP BY ?parent_taxon ?parent_taxon_name ORDER BY DESC (?count) title: How many compounds are structurally similar to compounds labeled as antibiotics? Results are grouped by the parent taxon of the organism they were found in. PREFIX sachem: http://bioinfo.uochb.cas.cz/rdf/v1.0/sachem# # prefixes needed for structural similarity search PREFIX idsm: https://idsm.elixir-czech.cz/sparql/endpoint/ SELECT ?parent_taxon ?parent_taxon_name (COUNT(DISTINCT ?compound) AS ?count) WHERE { SERVICE idsm:wikidata { VALUES ?CUTOFF { "0.9"^^xsd:double } SERVICE https://query.wikidata.org/bigdata/namespace/wdq/sparql { VALUES ?MESH { "D000900" } ?antibiotic ((wdt:P279)/wdt:P2868/wdt:P486) ?MESH; wdt:P233 ?smiles. } ?compound sachem:similarCompoundSearch :b40. :b40 sachem:query ?smiles; sachem:cutoff ?CUTOFF. } hint:Prior hint:runFirst "true"^^xsd:boolean. ?compound wdt:P703/wdt:P171 ?parent_taxon. ?parent_taxon wdt:P225 ?parent_taxon_name. } GROUP BY ?parent_taxon ?parent_taxon_name ORDER BY DESC (?count) title: How many compounds are structurally similar to compounds labeled as antibiotics? Results are grouped by the parent taxon of the organism they were found in. PREFIX sachem: http://bioinfo.uochb.cas.cz/rdf/v1.0/sachem# # prefixes needed for structural similarity search PREFIX idsm: https://idsm.elixir-czech.cz/sparql/endpoint/ SELECT ?parent_taxon ?parent_taxon_name (COUNT(DISTINCT ?compound) AS ?count) WHERE { SERVICE idsm:wikidata { VALUES ?CUTOFF { "0.9"^^xsd:double } SERVICE https://query.wikidata.org/bigdata/namespace/wdq/sparql { VALUES ?MESH { "D000900" } ?antibiotic ((wdt:P279)/wdt:P2868/wdt:P486) ?MESH; wdt:P233 ?smiles. } ?compound sachem:similarCompoundSearch :b40. :b40 sachem:query ?smiles; sachem:cutoff ?CUTOFF. } hint:Prior hint:runFirst "true"^^xsd:boolean. ?compound wdt:P703/wdt:P171 ?parent_taxon. ?parent_taxon wdt:P225 ?parent_taxon_name. } GROUP BY ?parent_taxon ?parent_taxon_name ORDER BY DESC (?count) title: How many compounds are structurally similar to compounds labeled as antibiotics? Results are grouped by the parent taxon of the organism they were found in. PREFIX sachem: http://bioinfo.uochb.cas.cz/rdf/v1.0/sachem# # prefixes needed for structural similarity search PREFIX idsm: https://idsm.elixir-czech.cz/sparql/endpoint/ SELECT ?parent_taxon ?parent_taxon_name (COUNT(DISTINCT ?compound) AS ?count) WHERE { SERVICE idsm:wikidata { VALUES ?CUTOFF { "0.9"^^xsd:double } SERVICE https://query.wikidata.org/bigdata/namespace/wdq/sparql { VALUES ?MESH { "D000900" } ?antibiotic ((wdt:P279)/wdt:P2868/wdt:P486) ?MESH; wdt:P233 ?smiles. } ?compound sachem:similarCompoundSearch :b40. :b40 sachem:query ?smiles; sachem:cutoff ?CUTOFF. } hint:Prior hint:runFirst "true"^^xsd:boolean. ?compound wdt:P703/wdt:P171 ?parent_taxon. ?parent_taxon wdt:P225 ?parent_taxon_name. } GROUP BY ?parent_taxon ?parent_taxon_name ORDER BY DESC (?count) title: How many compounds are structurally similar to compounds labeled as antibiotics? Results are grouped by the parent taxon of the organism they were found in. PREFIX sachem: http://bioinfo.uochb.cas.cz/rdf/v1.0/sachem# # prefixes needed for structural similarity search PREFIX idsm: https://idsm.elixir-czech.cz/sparql/endpoint/ SELECT ?parent_taxon ?parent_taxon_name (COUNT(DISTINCT ?compound) AS ?count) WHERE { SERVICE idsm:wikidata { VALUES ?CUTOFF { "0.9"^^xsd:double } SERVICE https://query.wikidata.org/bigdata/namespace/wdq/sparql { VALUES ?MESH { "D000900" } ?antibiotic ((wdt:P279)/wdt:P2868/wdt:P486) ?MESH; wdt:P233 ?smiles. } ?compound sachem:similarCompoundSearch :b40. :b40 sachem:query ?smiles; sachem:cutoff ?CUTOFF. } hint:Prior hint:runFirst "true"^^xsd:boolean. ?compound wdt:P703/wdt:P171 ?parent_taxon. ?parent_taxon wdt:P225 ?parent_taxon_name. } GROUP BY ?parent_taxon ?parent_taxon_name ORDER BY DESC (?count)

Use at

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
#title: How many compounds are structurally similar to compounds labeled as antibiotics? Results are grouped by the parent taxon of the organism they were found in.
PREFIX sachem: <http://bioinfo.uochb.cas.cz/rdf/v1.0/sachem#> # prefixes needed for structural similarity search
PREFIX idsm: <https://idsm.elixir-czech.cz/sparql/endpoint/>
SELECT ?parent_taxon ?parent_taxon_name (COUNT(DISTINCT ?compound) AS ?count) WHERE {
  SERVICE idsm:wikidata {
    VALUES ?CUTOFF {
      "0.9"^^xsd:double
    }
    SERVICE <https://query.wikidata.org/bigdata/namespace/wdq/sparql> {
      VALUES ?MESH {
        "D000900"
      }
      ?antibiotic ((wdt:P279*)/wdt:P2868/wdt:P486) ?MESH;
        wdt:P233 ?smiles.
    }
    ?compound sachem:similarCompoundSearch _:b40.
    _:b40 sachem:query ?smiles;
      sachem:cutoff ?CUTOFF.
  }

  ?compound wdt:P703/wdt:P171 ?parent_taxon.
  ?parent_taxon wdt:P225 ?parent_taxon_name.
}
GROUP BY ?parent_taxon ?parent_taxon_name
ORDER BY DESC (?count)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?CUTOFF") v3("?MESH") v4("?antibiotic") v6("?compound"):::projected v9("?count") v7("?parent_taxon"):::projected v8("?parent_taxon_name"):::projected v5("?smiles") a3((" ")) a1((" ")) a2((" ")) a4((" ")) subgraph s1["https://idsm.elixir-czech.cz/sparql/endpoint/wikidata"] style s1 stroke-width:4px; bind0[/VALUES ?CUTOFF/] bind0-->v2 bind00(["0.9^^xsd:double"]) bind00 --> bind0 subgraph s2["https://query.wikidata.org/bigdata/namespace/wdq/sparql"] style s2 stroke-width:4px; bind1[/VALUES ?MESH/] bind1-->v3 bind10(["D000900"]) bind10 --> bind1 v4 --"wdt:P279"--> a1 a1 --"wdt:P2868"--> a2 a2 --"wdt:P486"--> v3 v4 --"wdt:P233"--> v5 end v6 --http://bioinfo.uochb.cas.cz/rdf/v1.0/sachem#similarCompoundSearch--> a3 a3 --http://bioinfo.uochb.cas.cz/rdf/v1.0/sachem#query--> v5 a3 --http://bioinfo.uochb.cas.cz/rdf/v1.0/sachem#cutoff--> v2 end v6 --"wdt:P703"--> a4 a4 --"wdt:P171"--> v7 v7 --"wdt:P225"--> v8 bind3[/"count(?compound)"/] v6 --o bind3 bind3 --as--o v9