query-e464dfef61a4df82cee2504602de7373

rq turtle/ttl

... show associated chemical exposures SELECT DISTINCT ?diseaseGA ?diseaseGALabel ?exposure ?exposureLabel where { ?gene wdt:P2293 ?diseaseGA . # gene has genetic association ?diseaseGA wdt:P279* wd:Q3286546 . # to a type of respiratory system disease

?gene wdt:P31 wd:Q7187 . # gene is subclass of "gene"

?gene wdt:P688 ?protein . # gene encodes a protein ?protein p:P681 ?s . # protein's cell component statement ?s ps:P681 ?cp . # get statement value FILTER NOT EXISTS {?s pq:P459 wd:Q23190881 .} # determination method is not IEA ?cp wdt:P279|wdt:P361 wd:Q14349455 . # statement value is 'part of' or 'subclass of' membrane

?exposure wdt:P1542 ?diseaseGA . # something causes disease ?exposure wdt:P279 wd:Q21167512 . # and that something is a chemical hazard

SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } }

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#... show associated chemical exposures
SELECT DISTINCT ?diseaseGA ?diseaseGALabel ?exposure ?exposureLabel where {
  ?gene wdt:P2293 ?diseaseGA .        # gene has genetic association
  ?diseaseGA wdt:P279* wd:Q3286546 .  # to a type of respiratory system disease

  ?gene wdt:P31 wd:Q7187 .     # gene is subclass of "gene"

  ?gene wdt:P688 ?protein .                        # gene encodes a protein
  ?protein p:P681 ?s .                             # protein's cell component statement
    ?s ps:P681 ?cp .                               # get statement value
    FILTER NOT EXISTS {?s pq:P459 wd:Q23190881 .}  # determination method is not IEA
    ?cp wdt:P279*|wdt:P361* wd:Q14349455 .         # statement value is 'part of' or 'subclass of' membrane

  ?exposure wdt:P1542 ?diseaseGA .  # something causes disease
  ?exposure wdt:P279 wd:Q21167512 . # and that something is a chemical hazard

  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?cp") v3("?diseaseGA"):::projected v6("?exposure"):::projected v2("?gene") v4("?protein") v1("?s") c18(["en"]):::literal c11(["wd:Q14349455"]):::iri c16(["bd:serviceParam"]):::iri c14(["wd:Q21167512"]):::iri c7(["wd:Q7187"]):::iri c2(["wd:Q23190881"]):::iri c5(["wd:Q3286546"]):::iri f0[["not "]] subgraph f0e0["Exists Clause"] e0v1 --"p:qualifier/P459"--> e0c2 e0v1("?s"):::projected e0c2(["wd:Q23190881"]):::iri end f0--EXISTS--> f0e0 f0 --> v1 f0 --> c1 f0 --> c2 v1 --"p:qualifier/P459"--> c2 v2 --"p:direct/P2293"--> v3 v3 --"p:direct/P279"--> c5 v2 --"p:direct/P31"--> c7 v2 --"p:direct/P688"--> v4 v4 --"p:P681"--> v1 v1 --"p:statement/P681"--> v5 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v5 --"p:direct/P361"--> c11 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v5 --"p:direct/P279"--> c11 end union0r <== or ==> union0l end v6 --"p:direct/P1542"--> v3 v6 --"p:direct/P279"--> c14 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c16 --"wikibase:language"--> c18 end