query-d4b605e438da5d708d3c000981edef5a

rq turtle/ttl

Get known variants reported in CIViC database (Q27612411) of genes reported in a Wikipathways pathway: Bladder cancer (Q30230812) SELECT DISTINCT ?pathway ?pathwayLabel ?pwpart ?pwpartLabel ?variant ?variantLabel ?disease?diseaseLabel WHERE {

VALUES ?predictor {p:P3354 p:P3355 p:P3356 p:P3357 p:P3358 p:P3359} VALUES ?predictorQualifier {pq:P2175} VALUES ?wpID {"WP2828"}

?pathway wdt:P2410 ?wpID ; # Pathways has a Wikipathways identifier wdt:P527 ?pwpart . # which contains pathways parts

?disease wdt:P279+ wd:Q504775 . # The disease is a subclass of urinary bladder cancer # based on annotations in the Disease ontology ?variant wdt:P3329 ?civicID ; # a variant known in CIViC ?predictor ?node ; # has a predicting relation with diseases # labeled as being a subclass of urinary bladder cancer wdt:P3433 ?pwpart . # variant is biological variant of

{?node ?predictorStatement ?drug_label ; ?predictorQualifier ?disease .} UNION { ?node ?predictorStatement ?disease . } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_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 pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#Get known variants reported in CIViC database (Q27612411) of genes reported in a Wikipathways pathway: Bladder cancer (Q30230812)
SELECT DISTINCT ?pathway ?pathwayLabel ?pwpart ?pwpartLabel ?variant ?variantLabel ?disease?diseaseLabel WHERE {

   VALUES ?predictor {p:P3354 p:P3355 p:P3356 p:P3357 p:P3358 p:P3359}
   VALUES ?predictorQualifier {pq:P2175}
   VALUES ?wpID {"WP2828"}

   ?pathway wdt:P2410 ?wpID ; # Pathways has a Wikipathways identifier
          wdt:P527 ?pwpart . # which contains pathways parts

   ?disease wdt:P279+ wd:Q504775 .  # The disease is a subclass of urinary bladder cancer 
                                    # based on annotations in the Disease ontology
   ?variant wdt:P3329 ?civicID ; # a variant known in CIViC 
             ?predictor ?node ; # has a predicting relation with diseases
                                   # labeled as being a subclass of urinary bladder cancer
             wdt:P3433 ?pwpart .  # variant is biological variant of

   {?node ?predictorStatement ?drug_label ;
              ?predictorQualifier ?disease .}
   UNION 
   {
      ?node ?predictorStatement ?disease  .
   }
   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v8("?civicID") v6("?disease"):::projected v11("?drug_label") v9("?node") v4("?pathway"):::projected v1("?predictor") v2("?predictorQualifier") v10("?predictorStatement") v5("?pwpart"):::projected v7("?variant"):::projected v3("?wpID") c8(["bd:serviceParam"]):::iri c4(["wd:Q504775"]):::iri c10(["#91;AUTO_LANGUAGE#93;,en"]):::literal bind0[/VALUES ?predictor/] bind0-->v1 bind00(["p:P3354"]) bind00 --> bind0 bind01(["p:P3355"]) bind01 --> bind0 bind02(["p:P3356"]) bind02 --> bind0 bind03(["p:P3357"]) bind03 --> bind0 bind04(["p:P3358"]) bind04 --> bind0 bind05(["p:P3359"]) bind05 --> bind0 bind1[/VALUES ?predictorQualifier/] bind1-->v2 bind10(["p:qualifier/P2175"]) bind10 --> bind1 bind2[/VALUES ?wpID/] bind2-->v3 bind20(["WP2828"]) bind20 --> bind2 v4 --"p:direct/P2410"--> v3 v4 --"p:direct/P527"--> v5 v6 --"p:direct/P279"--> c4 v7 --"p:direct/P3329"--> v8 v7 -->v1--> v9 v7 --"p:direct/P3433"--> v5 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v9 -->v10--> v6 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v9 -->v10--> v11 v9 -->v2--> v6 end union0r <== or ==> union0l end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c8 --"wikibase:language"--> c10 end