lotus-sparql-examples

A set of SPARQL examples that are used in LOTUS

View the Project on GitHub lotusnprod/lotus-sparql-examples

wd_nps_bioactivity_grampos

rq turtle/ttl

Compounds found in taxon treating gram-positive infections (Q55789782).

Use at


PREFIX bd: <http://www.bigdata.com/rdf#>
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 taxon treating gram-positive infections (Q55789782).
SELECT DISTINCT ?infection ?infectionLabel ?compound ?compound_smiles ?taxon ?taxon_name WHERE {
    VALUES ?disease {
        wd:Q55789782   # Gram-positive
    # wd:Q19597369 # Gram-negative
    }
    ?infection (wdt:P279*) ?disease.
    { ?compound wdt:P2175 ?infection. }
    UNION
    { ?infection wdt:P2176 ?compound. }
    ?compound wdt:P233 ?compound_smiles;
    wdt:P703 ?taxon.
    ?taxon wdt:P225 ?taxon_name.
    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;
  v3("?compound"):::projected 
  v4("?compound_smiles"):::projected 
  v1("?disease")
  v2("?infection"):::projected 
  v5("?taxon"):::projected 
  v6("?taxon_name"):::projected 
  c8([http://www.bigdata.com/rdf#serviceParam]):::iri 
  c10(["#91;AUTO_LANGUAGE#93;,mul,en"]):::literal 
  bind0[/VALUES ?disease/]
  bind0-->v1
  bind00(["wd:Q55789782"])
  bind00 --> bind0
  v2 --"wdt:P279"-->  v1
  subgraph union0[" Union "]
  subgraph union0l[" "]
    style union0l fill:#abf,stroke-dasharray: 3 3;
    v2 --"wdt:P2176"-->  v3
  end
  subgraph union0r[" "]
    style union0r fill:#abf,stroke-dasharray: 3 3;
    v3 --"wdt:P2175"-->  v2
  end
  union0r <== or ==> union0l
  end
  v3 --"wdt:P233"-->  v4
  v3 --"wdt:P703"-->  v5
  v5 --"wdt:P225"-->  v6
  subgraph s1["http://wikiba.se/ontology#label"]
    style s1 stroke-width:4px;
    c8 --"wikibase:language"-->  c10
  end