Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix some annotations-in-text issues #532

Merged
merged 2 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions add/data/xql/getAnnotationsInText.xql
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,12 @@ declare function local:getAnnotations($uriSharp as xs:string, $annotations as el
let $plist as array(*) :=
array {
for $p in tokenize($annotation/@plist, '\s+')
where starts-with($p, $uriSharp)
return
if (starts-with($p, $uriSharp)) then
(concat('{id:"', $id, '__', substring-after($p, $uriSharp), '"}'))
else
()
map {
'id': concat( $id, '__', substring-after($p, $uriSharp))
}
}
let $plist := string-join($plist, ',')
return
map {
'id': $id,
Expand Down
6 changes: 2 additions & 4 deletions add/data/xqm/teitext.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ declare namespace tei="http://www.tei-c.org/ns/1.0";
:)
declare function teitext:isText($uri as xs:string) as xs:boolean {

exists(doc($uri)/tei:TEI)
exists(eutil:getDoc($uri)/tei:TEI)

};

Expand All @@ -40,8 +40,6 @@ declare function teitext:isText($uri as xs:string) as xs:boolean {
:)
declare function teitext:getLabel($uri as xs:string, $edition as xs:string) as xs:string {

let $language := eutil:getLanguage($edition)

return doc($uri)//tei:titleStmt/data(tei:title[not(@xml:lang) or @xml:lang = $language])
eutil:getLocalizedTitle(eutil:getDoc($uri), eutil:getLanguage($edition))

};
Loading