Created
July 11, 2013 10:50
-
-
Save andrawaag/5974484 to your computer and use it in GitHub Desktop.
Get all mouse pathways. This perl scripts returns the uri through identifiers.org, a link the rdf version of the pathway and a url for the wiki entry of the specific revision currently loading in the triple store of wikipathways
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
#!/usr/bin/perl | |
use LWP::Simple; | |
use URI::Escape; | |
my $sparql = "SELECT DISTINCT ?wpIdentifier ?pathway ?page | |
WHERE { | |
?pathway dc:title ?title . | |
?pathway wp:organism ?organism . | |
?pathway foaf:page ?page . | |
?pathway dc:identifier ?wpIdentifier . | |
?organism rdfs:label \"Mus musculus\"^^<http://www.w3.org/2001/XMLSchema#string> . | |
} | |
ORDER BY ?wpIdentifier "; | |
my $url = 'http://sparql.wikipathways.org/?default-graph-uri=&query='.uri_escape($sparql).'&format=text%2Fcsv&timeout=0&debug=on'; | |
my $content = get $url; | |
die "Couldn't get $url" unless defined $content; | |
print $content; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The query needs to be updated to the one given in the WikiPathways wiki: http://www.wikipathways.org/index.php/Help:WikiPathways_Sparql_queries#List_all_pathways_for_species_.22Mus_musculus.22