Created
July 22, 2015 17:48
-
-
Save CliffordAnderson/1f5c323d88c56eec4503 to your computer and use it in GitHub Desktop.
XQuery Working Group Challenge
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.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)} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How would you refine this query to return only those verses where at least one token is repeated?