Last active
August 29, 2015 14:08
-
-
Save jonasalmeida/8d78513101d499422216 to your computer and use it in GitHub Desktop.
retrieving URLs for TCGA tissue images from SPARQL endpoint
This file contains hidden or 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
// SPARQL query composition at http://agalpha.mathbiol.org/repositories/tcga#query/r/TCGA-CM-4743-01A-01_URL | |
label='TCGA-CM-4743-01A-0' // example of a label | |
url = 'http://agalpha.mathbiol.org/download?file=query.json&accept=application%2Fsparql-results%2Bjson&path=%2Frepositories%2Ftcga%3Fquery%3Dselect%2520distinct%2520%253Fo%2520%253Fu%250Awhere%2520%257B%250A%2509%253Ft%2520a%2520%253Chttp%253A%252F%252Fpurl.org%252Ftcga%252Fcore%2523platform%253E.%250A%2520%2520%2509%253Ft%2520%253Chttp%253A%252F%252Fwww.w3.org%252F2000%252F01%252Frdf-schema%2523label%253E%2520%2522tissue_images%2522.%250A%2520%2520%2509%253Fo%2520%253Chttp%253A%252F%252Fpurl.org%252Ftcga%252Fcore%2523platform%253E%2520%253Ft.%250A%2520%2520%2509%253Fo%2520rdfs%253Alabel%2520%253FL.%250A%2520%2520%2509filter%2520REGEX(%253FL%252C%72'+label+'1%27)%250A%2520%2520%2520%2520%253Fo%2520tcga%253Aurl%2520%253Fu%250A%257D%26infer%3Dfalse' | |
$.getJSON(url,function(x){ | |
y=x.results.bindings.map(function(xi){return xi.u.value}); | |
console.log('done:',y) | |
}) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
the result should be y =
[
"https://tcga-data.nci.nih.gov/tcgafiles/ftp_auth/distro_ftpusers/anonymous/tumor/coad/bcr/intgen.org/tissue_images/slide_images/intgen.org_COAD.tissue_images.Level_1.116.4.0/TCGA-CM-4743-01A-01-BS1.d11d0a14-b3a7-4e66-8dc1-dade356b9171.svs",
"https://tcga-data.nci.nih.gov/tcgafiles/ftp_auth/distro_ftpusers/anonymous/tumor/coad/bcr/intgen.org/tissue_images/slide_images/intgen.org_COAD.tissue_images.Level_1.116.4.0/TCGA-CM-4743-01A-01-TS1.549e7f47-bb93-43d1-8835-9db9564a1d8a.svs"
]