Skip to content

Instantly share code, notes, and snippets.

@CliffordAnderson
Created July 22, 2015 17:48
Show Gist options
  • Save CliffordAnderson/1f5c323d88c56eec4503 to your computer and use it in GitHub Desktop.
Save CliffordAnderson/1f5c323d88c56eec4503 to your computer and use it in GitHub Desktop.
XQuery Working Group Challenge
xquery version "3.1";
(: Converts sentences into verses :)
(: Official release of the PROIEL treebank of ancient Indo-European languages :)
let $uri := "https://raw.githubusercontent.com/proiel/proiel-treebank/master/latin-nt.xml"
let $doc := fn:doc($uri)
let $tokens := $doc//token
for $citation in fn:distinct-values(fn:data($doc//token/@citation-part))
return element verse {
attribute citation {$citation},
fn:data($tokens[./@citation-part = $citation]/@form)}
@CliffordAnderson
Copy link
Author

How would you refine this query to return only those verses where at least one token is repeated?

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