query-2107a286f1f646f164b3134945870878

rq turtle/ttl

Propertiessubclass of (P279)part of (P361)instance of (P31)physically interacts with (P129)subject has role (P2868)

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#>
PREFIX wp:      <http://vocabularies.wikipathways.org/wp#> 
PREFIX dcterms:  <http://purl.org/dc/terms/>
PREFIX dc:      <http://purl.org/dc/elements/1.1/> 

SELECT DISTINCT ?metabolite ?wikidatadrug ?wikidatadrugLabel ?title ?wpIdentifier WHERE {
    {?protein wdt:P279* wd:Q422500 .}
     UNION
    {?protein wdt:P361* wd:Q422500 .}
  ?protein wdt:P31 wd:Q8054 .
  ?wikidatadrug wdt:P129 ?protein .
  ?wikidatadrug p:P129/pq:P2868 wd:Q389934 .
  SERVICE <http://sparql.wikipathways.org/> {
  ?metabolite a wp:Metabolite ;
    wp:bdbWikidata ?wikidatadrug ;
    dcterms:isPartOf ?pathway .
   ?pathway a wp:Pathway .
    ?pathway dc:title ?title .
    ?pathway dc:identifier ?wpIdentifier .
  }
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; v3("?metabolite"):::projected v4("?pathway") v1("?protein") v5("?title"):::projected v2("?wikidatadrug"):::projected v6("?wpIdentifier"):::projected a1((" ")) c21(["en"]):::literal c2(["wd:Q422500"]):::iri c15([http://vocabularies.wikipathways.org/wp#Pathway]):::iri c12([http://vocabularies.wikipathways.org/wp#Metabolite]):::iri c19(["bd:serviceParam"]):::iri c5(["wd:Q8054"]):::iri c9(["wd:Q389934"]):::iri subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v1 --"p:direct/P361"--> c2 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v1 --"p:direct/P279"--> c2 end union0r <== or ==> union0l end v1 --"p:direct/P31"--> c5 v2 --"p:direct/P129"--> v1 v2 --"p:P129"--> a1 a1 --"p:qualifier/P2868"--> c9 subgraph s1["http://sparql.wikipathways.org/"] style s1 stroke-width:4px; v3 --"a"--> c12 v3 --http://vocabularies.wikipathways.org/wp#bdbWikidata--> v2 v3 --http://purl.org/dc/terms/isPartOf--> v4 v4 --"a"--> c15 v4 --http://purl.org/dc/elements/1.1/title--> v5 v4 --http://purl.org/dc/elements/1.1/identifier--> v6 end subgraph s2["http://wikiba.se/ontology#label"] style s2 stroke-width:4px; c19 --"wikibase:language"--> c21 end