Skip to content

Instantly share code, notes, and snippets.

@CliffordAnderson
Last active September 24, 2019 20:12
Show Gist options
  • Save CliffordAnderson/71a6fd26da764618d5be1ea3e0144785 to your computer and use it in GitHub Desktop.
Save CliffordAnderson/71a6fd26da764618d5be1ea3e0144785 to your computer and use it in GitHub Desktop.
Starter Query
declare namespace output = "http://www.w3.org/2010/xslt-xquery-serialization";
declare option output:method "csv";
declare option output:csv "header=yes, separator=comma";
<csv>
{
for $doc in fn:collection("bpp-quarterly")
let $fullText := $doc/Record/FullText/text()
let $title := $doc/Record/Publication/Title/text()
let $articleTitle := $doc/Record/RecordTitle/text()
let $jury-not-law := $fullText contains text "jury" ftand ftnot "law" using stemming
where $jury-not-law
return
<record>
<title>{$articleTitle}</title>
<journal>{$title}</journal>
<jury>{$jury-not-law}</jury>
</record>
}
</csv>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment