Created
December 22, 2017 14:58
-
-
Save egonw/1cadd8132eeac56b19eb7899481e63c1 to your computer and use it in GitHub Desktop.
Federated query between WikiPathways and Wikidata, listing SMILES for substrate and product for metabolic conversions.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PREFIX dcterms: <http://purl.org/dc/terms/> | |
PREFIX wp: <http://vocabularies.wikipathways.org/wp#> | |
SELECT DISTINCT ?sourceWD ?sourceWDLabel ?sourceSMILEScan ?sourceSMILESiso ?targetWD ?targetWDLabel ?targetSMILEScan ?targetSMILESiso WITH { | |
SELECT ?sourceWD ?targetWD WHERE { | |
SERVICE <http://sparql.wikipathways.org/> { | |
?pathway a wp:Pathway . | |
?interaction dcterms:isPartOf ?pathway . | |
?interaction a wp:Interaction, wp:Conversion . | |
?interaction wp:source ?source . ?source a wp:Metabolite; wp:bdbWikidata ?sourceWD . | |
?interaction wp:target ?target . ?target a wp:Metabolite; wp:bdbWikidata ?targetWD . | |
} | |
} | |
} AS %results WHERE { | |
INCLUDE %results | |
OPTIONAL { ?sourceWD wdt:P233 ?sourceSMILEScan } | |
OPTIONAL { ?targetWD wdt:P233 ?targetSMILEScan } | |
OPTIONAL { ?sourceWD wdt:P2017 ?sourceSMILESiso } | |
OPTIONAL { ?targetWD wdt:P2017 ?targetSMILESiso } | |
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment