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
declare namespace tei = "http://www.tei-c.org/ns/1.0"; | |
for $r in collection('/db/apps/srophe-data/data/persons/tei/saints/tei')//tei:revisionDesc[@status="incomplete"]/ancestor::tei:TEI[descendant::tei:idno[@type='BHS']] | |
let $uri := replace($r/descendant::tei:idno[@type='URI'][1],'/tei','') | |
let $name := $r/descendant::tei:persName[@syriaca-tags='#syriaca-headword'][@xml:lang='en'][1]/text() | |
let $pid := substring-after($uri,'person/') | |
return | |
for $b at $pos in $r//tei:idno[@type='BHS'] | |
let $work := for $w in collection('/db/apps/srophe-data/data/works')//tei:idno[@type='BHS'][. = $b] | |
return $w/ancestor::tei:TEI |
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
declare namespace tei = "http://www.tei-c.org/ns/1.0"; | |
for $r in collection('/db/apps/bug-test/data/persons')//tei:revisionDesc[@status="incomplete"]/ancestor::tei:TEI | |
let $uri := replace($r/descendant::tei:idno[@type='URI'][1],'/tei','') | |
let $name := $r/descendant::tei:persName[@syriaca-tags='#syriaca-headword'][@xml:lang='en'][1]/text() | |
let $pid := substring-after($uri,'person/') | |
return | |
for $b in $r//tei:idno[@type='BHS'] | |
let $work-id := | |
for $w in collection('/db/apps/srophe-data/data/works')//tei:idno[@type='BHS'][. = $b] |
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
for $rec in doc('/db/apps/bug-test/data/abstracts-incomplete-saints.xml')//tei:div | |
return | |
for $r in collection('/db/apps/bug-test/data/tei')//tei:idno[. = $rec/tei:idno]/ancestor::tei:TEI/descendant::tei:person | |
return | |
( | |
for $names in $r/tei:persName[@xml:id = $rec/tei:persName/@xml:id] | |
return | |
update replace $names with $rec/tei:persName[@xml:id = $names/@xml:id], | |
for $notes in $r/tei:note[@type='abstract'] | |
return |
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
for $rec in collection('/db/apps/srophe-data/data/works/tei')//tei:note[@xml:lang][@type='ancientVersion' or @type='modernTranslation'] | |
let $bibl := $rec/tei:bibl | |
let $lang := <lang xmlns="http://www.tei-c.org/ns/1.0">{string($rec/@xml:lang)}</lang> | |
return | |
(update insert $lang into $bibl, | |
update delete $rec/@xml:lang) | |
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.0"; | |
declare namespace tei = "http://www.tei-c.org/ns/1.0"; | |
for $rec in collection('/db/apps/srophe-data/data/bibl/tei')//tei:idno[ends-with(.,'/source')] | |
let $recid := replace($rec/text(),'/source','/tei') | |
return | |
update value $rec with $recid |
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.0"; | |
(: | |
: Create new TEI bibl records from bhse-reconciled-authors.xml | |
: Save records to db, must be logged into eXist as admin/with admin privileges | |
:) | |
declare default element namespace "http://www.tei-c.org/ns/1.0"; | |
declare namespace tei = "http://www.tei-c.org/ns/1.0"; | |
declare namespace syriaca = "http://syriaca.org"; | |
declare namespace functx = "http://www.functx.com"; |
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.0"; | |
declare namespace tei = "http://www.tei-c.org/ns/1.0"; | |
for $rec in collection('/db/apps/srophe-data/data/persons/tei')//tei:title[@level="m"][. = 'Qadishe: A Guide to the Syriac Saints'][ancestor::tei:TEI/descendant::tei:person/tei:persName[@syriaca-tags='#syriaca-headword'][@xml:lang='en-x-gedsh']] | |
let $r := $rec/ancestor::tei:TEI | |
let $id := $r/descendant::tei:idno[1] | |
let $title := $r/descendant::tei:titleStmt/tei:title[@level='a'] | |
let $gedesh := $r/descendant::tei:person/tei:persName[@syriaca-tags='#syriaca-headword'][@xml:lang='en-x-gedsh'] | |
let $syr := $r/descendant::tei:person/tei:persName[@syriaca-tags='#syriaca-headword'][@xml:lang='syr'][1] | |
let $syr2 := $r/descendant::tei:person/tei:persName[@syriaca-tags='#syriaca-headword'][@xml:lang='syr'][2] |
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
for $rec in collection('/db/apps/srophe-data/data/works/tei')//tei:note[@source= '#bib221-1'] | |
let $id := tokenize($rec/parent::*[1]/tei:idno[@type='URI'][starts-with(.,'http://syriaca.org')],'/')[last()] | |
return | |
update value $rec/@source with concat('#bib',$id,'-1') |