query-39cd50f54d81cd6cee6d661d3ae04718

rq turtle/ttl

... and show associated pathways SELECT DISTINCT ?gene ?geneLabel ?pathwayLabel 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

?pathway wdt:P31 wd:Q4915012 ; # instance of a biological pathway wdt:P527 ?gene .

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#>
#... and show associated pathways
SELECT DISTINCT ?gene ?geneLabel ?pathwayLabel 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

  ?pathway wdt:P31 wd:Q4915012 ;                   # instance of a biological pathway
           wdt:P527 ?gene .

  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") v2("?gene"):::projected v6("?pathway") v4("?protein") v1("?s") c18(["en"]):::literal c11(["wd:Q14349455"]):::iri c16(["bd:serviceParam"]):::iri c13(["wd:Q4915012"]):::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/P31"--> c13 v6 --"p:direct/P527"--> v2 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c16 --"wikibase:language"--> c18 end