Skip to content

Instantly share code, notes, and snippets.

@sterkenburgsara-zz
Created September 18, 2015 21:37
Show Gist options
  • Save sterkenburgsara-zz/a4a91787de1548343d58 to your computer and use it in GitHub Desktop.
Save sterkenburgsara-zz/a4a91787de1548343d58 to your computer and use it in GitHub Desktop.
Mining Syriaca database for bibl sources and matching them on OCLC Search API
xquery version "3.1";
declare namespace tei="http://www.tei-c.org/ns/1.0";
let $doc := fn:doc("draft-data-works/251.xml")
let $term := $doc//tei:bibl[@xml:id="bibl251-9"]/text()
let $search-term := fn:substring-after($term, ".")
let $final-search-term := fn:encode-for-uri(fn:normalize-space($search-term))
let $query := fetch:text("
http://www.worldcat.org/webservices/catalog/search/opensearch?q="||$final-search-term||"&wskey=[insert-key]")
return $query
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment