Skip to content

Instantly share code, notes, and snippets.

@andrawaag
Created June 26, 2017 19:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrawaag/ba1b7d1b9adf06e9d45afa98c1d1e239 to your computer and use it in GitHub Desktop.
Save andrawaag/ba1b7d1b9adf06e9d45afa98c1d1e239 to your computer and use it in GitHub Desktop.
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 ?metabolite1Label ?metabolite2Label ?mass1 ?mass2 WHERE {
?metabolite2 wdt:P2067 ?mass2 .
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
{SELECT * WHERE {
?metabolite1 wdt:P2067 ?mass1 .
{SELECT * WHERE {
?pathwayItem wdt:P2410 "WP706" ;
wdt:P2888 ?pwIri .
FILTER (?metabolite1 != ?metabolite2)
SERVICE <http://sparql.wikipathways.org/> {
?pathway dc:identifier ?pwIri .
?interaction rdf:type wp:Interaction ;
wp:participants ?wpmb1, ?wpmb2 ;
dcterms:isPartOf ?pathway .
?wpmb1 wp:bdbWikidata ?metabolite1 .
?wpmb2 wp:bdbWikidata ?metabolite2 .
FILTER (?wpmb1 != ?wpmb2)}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment