Skip to content

Instantly share code, notes, and snippets.

@andrawaag
Created July 11, 2013 10:50
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/5974484 to your computer and use it in GitHub Desktop.
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
#!/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;
@egonw
Copy link

egonw commented Oct 6, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment