Created
November 30, 2015 15:51
-
-
Save baskaufs/f01fdd9f76469e6f8e58 to your computer and use it in GitHub Desktop.
generating a file containing Bioimages and Morphbank identifiers
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
xquery version "3.0"; | |
(: let $localFilesFolderUnix := "c:/test" :) | |
let $localFilesFolderPC := "c:\test" | |
let $uri := "http://services.morphbank.net/mbsvc3/request?method=changes&objecttype=Image&keywords=&geolocated=true&firstResult=0&user=&group=Bioimages&change=&lastDateChanged=&numChangeDays=30&id=&taxonName=&format=svc" | |
let $responseDoc := fn:doc($uri) | |
(:let $responseDoc := fn:doc(concat('file:///',$localFilesFolderUnix,'/morphbank-image-response-2015-11-29.xml')) :) | |
let $nl := " " (: newline character :) | |
(: | |
*********** Main query ********* | |
:) | |
return ( | |
file:write(concat($localFilesFolderPC,"\morphbank-ids.csv"), | |
for $id in $responseDoc//object/sourceId | |
return | |
concat($id/external/text(),"|","http://www.morphbank.net/?id=",$id/morphbank/text(),"&imgType=jpeg",$nl) | |
) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment