From 3e1d3a50326fd4197a6561686e73052c148a14de Mon Sep 17 00:00:00 2001 From: HelenaSabel Date: Thu, 6 Dec 2018 11:02:17 +0100 Subject: [PATCH] Added queries --- XQuery/XSLT/dub.xsl | 49 + XQuery/XSLT/ex.xsl | 46 + XQuery/XSLT/reading.xsl | 623 +++ XQuery/XSLT/select.xsl | 24 + XQuery/XSLT/string.xsl | 25 + XQuery/XSLT/table.xsl | 486 ++ XQuery/corpus.xquery | 313 ++ XQuery/count.xquery | 5 + XQuery/count2.xquery | 5 + XQuery/edition.xquery | 162 + XQuery/form.xquery | 208 + XQuery/graphs/arcaico.svg | 168 + XQuery/graphs/arcaismos-evol.svg | 4353 ++++++++++++++++ XQuery/graphs/arcaismos.xquery | 298 ++ XQuery/graphs/common-text.xquery | 56 + .../graphs/corpus-comparison-compact.xquery | 264 + XQuery/graphs/corpus-comparison-long.xquery | 204 + XQuery/graphs/corpus-comparison-tese.xquery | 264 + XQuery/graphs/corpus-composition.xquery | 172 + XQuery/graphs/corpus.svg | 4467 +++++++++++++++++ XQuery/graphs/evol-lingua-arcaismos.xquery | 159 + XQuery/graphs/evol-lingua.xquery | 171 + XQuery/graphs/grafos-tese.xquery | 166 + XQuery/graphs/image.pdf | Bin 0 -> 24470 bytes XQuery/graphs/image.pdf_tex | 135 + XQuery/graphs/ling-evol-prova.xquery | 512 ++ XQuery/graphs/ling-evol.xquery | 501 ++ XQuery/graphs/radar-plot-initial.svg | 40 + XQuery/graphs/radar-plot.xquery | 298 ++ XQuery/graphs/resultados-tese-autor.xquery | 163 + XQuery/graphs/resultados-tese.xquery | 182 + XQuery/graphs/results-by-author.svg | 1343 +++++ XQuery/graphs/results-by-line.svg | 1010 ++++ XQuery/graphs/results-by-song.svg | 1342 +++++ XQuery/graphs/tese.svg | 4467 +++++++++++++++++ XQuery/ling.xquery | 305 ++ XQuery/other-queries/abbreviations.xquery | 7 + XQuery/other-queries/latex-tables-2.xquery | 76 + XQuery/other-queries/latex-tables.xquery | 76 + XQuery/other-queries/line-counting.xquery | 27 + XQuery/other-queries/me-status.xquery | 24 + XQuery/other-queries/mi-status.xquery | 27 + XQuery/tabular.xquery | 62 + 43 files changed, 23285 insertions(+) create mode 100644 XQuery/XSLT/dub.xsl create mode 100644 XQuery/XSLT/ex.xsl create mode 100644 XQuery/XSLT/reading.xsl create mode 100644 XQuery/XSLT/select.xsl create mode 100644 XQuery/XSLT/string.xsl create mode 100644 XQuery/XSLT/table.xsl create mode 100644 XQuery/corpus.xquery create mode 100644 XQuery/count.xquery create mode 100644 XQuery/count2.xquery create mode 100644 XQuery/edition.xquery create mode 100644 XQuery/form.xquery create mode 100644 XQuery/graphs/arcaico.svg create mode 100644 XQuery/graphs/arcaismos-evol.svg create mode 100644 XQuery/graphs/arcaismos.xquery create mode 100644 XQuery/graphs/common-text.xquery create mode 100644 XQuery/graphs/corpus-comparison-compact.xquery create mode 100644 XQuery/graphs/corpus-comparison-long.xquery create mode 100644 XQuery/graphs/corpus-comparison-tese.xquery create mode 100644 XQuery/graphs/corpus-composition.xquery create mode 100644 XQuery/graphs/corpus.svg create mode 100644 XQuery/graphs/evol-lingua-arcaismos.xquery create mode 100644 XQuery/graphs/evol-lingua.xquery create mode 100644 XQuery/graphs/grafos-tese.xquery create mode 100644 XQuery/graphs/image.pdf create mode 100644 XQuery/graphs/image.pdf_tex create mode 100644 XQuery/graphs/ling-evol-prova.xquery create mode 100644 XQuery/graphs/ling-evol.xquery create mode 100644 XQuery/graphs/radar-plot-initial.svg create mode 100644 XQuery/graphs/radar-plot.xquery create mode 100644 XQuery/graphs/resultados-tese-autor.xquery create mode 100644 XQuery/graphs/resultados-tese.xquery create mode 100644 XQuery/graphs/results-by-author.svg create mode 100644 XQuery/graphs/results-by-line.svg create mode 100644 XQuery/graphs/results-by-song.svg create mode 100644 XQuery/graphs/tese.svg create mode 100644 XQuery/ling.xquery create mode 100644 XQuery/other-queries/abbreviations.xquery create mode 100644 XQuery/other-queries/latex-tables-2.xquery create mode 100644 XQuery/other-queries/latex-tables.xquery create mode 100644 XQuery/other-queries/line-counting.xquery create mode 100644 XQuery/other-queries/me-status.xquery create mode 100644 XQuery/other-queries/mi-status.xquery create mode 100644 XQuery/tabular.xquery diff --git a/XQuery/XSLT/dub.xsl b/XQuery/XSLT/dub.xsl new file mode 100644 index 0000000..c09761e --- /dev/null +++ b/XQuery/XSLT/dub.xsl @@ -0,0 +1,49 @@ + + + + + + + + + ] + + + // + + + + -- + + + + + + + + + + -- + + + + + + + + + + + error + + + + + + + \ No newline at end of file diff --git a/XQuery/XSLT/ex.xsl b/XQuery/XSLT/ex.xsl new file mode 100644 index 0000000..5d209bb --- /dev/null +++ b/XQuery/XSLT/ex.xsl @@ -0,0 +1,46 @@ + + + + + + + + + + ] + + + // + + + + -- + + + + + + + + + + + -- + + + + + + + + + + + error + + + + + + + \ No newline at end of file diff --git a/XQuery/XSLT/reading.xsl b/XQuery/XSLT/reading.xsl new file mode 100644 index 0000000..b64f5b3 --- /dev/null +++ b/XQuery/XSLT/reading.xsl @@ -0,0 +1,623 @@ + + + + + + + + ' + + + +
    + +
+
+ + + + + + + + + highlight + + + + + + + + + + + + error en + + + + + + + error pt + + + + + + + error gl + + + + + + + + + + + + + + + linguistic en + + + + + + + linguistic pt + + + + + + + linguistic gl + + + + + + + + + + + equipolent en + + + + + + + equipolent pt + + + + + + + equipolent gl + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + error en + + + + + + + error pt + + + + + + + error gl + + + + + + + + + + + + linguistic en + + + + + + + linguistic pt + + + + + + + linguistic gl + + + + + + + + + equipolent en + Divergent reading + + + + equipolent pt + Lição divergente + + + + equipolent gl + Lección diverxente + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + hide + + ( + + + + + + + + + + + + + + + + + pt + + + + Omissão provocada pelo estado de conservação do testemunho + + + Trecho ilegível + + + + + + * + + + + + + + + + + gl + + + + Omisión provocada polo estado de conservación do testemuño + + + Trecho ilexíbel + + + + + + * + + + + + + + + + + en + + + + Damaged witness + + + Illegible + + + + + + * + + + + + + + + + + + + + ) + + + + + + + + + + + + + + + gap pt + + + + Erro de cópia + + + Omissão de conteúdos repetidos + + + Omissão de origem desconhecida + + + Omissão provocada pelo estado de conservação do testemunho + + + Trecho ilegível + + + Provavelmente, omissão presente no modelo + + + Testemunho inacabado + + + + + + + + + + + + * + + + + + + + + + + [ ] + + + + + + gap gl + + + + Erro de copia + + + Omisión de contidos repetidos + + + Omisión de orixe descoñecida + + + Omisión provocada polo estado de conservación do testemuño + + + Trecho ilexíbel + + + Probabelmente, omisión presente no modelo + + + Testemuño inacabado + + + + + + + + + + + + * + + + + + + + + + + [ ] + + + + + + gap en + + + + Scribal error + + + Omission of repeated contents + + + Unknown reason for omission + + + Damaged witness + + + Illegivel + + + Likely, omission present in the model of this witness + + + Unfinished witness + + + + + + + + + + + + * + + + + + + + + + + [ ] + + + + + + + + + + + + + + + + + + + + +
+
+
diff --git a/XQuery/XSLT/select.xsl b/XQuery/XSLT/select.xsl new file mode 100644 index 0000000..c9d48ae --- /dev/null +++ b/XQuery/XSLT/select.xsl @@ -0,0 +1,24 @@ + + + + + + + + / + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/XQuery/XSLT/string.xsl b/XQuery/XSLT/string.xsl new file mode 100644 index 0000000..4b550ff --- /dev/null +++ b/XQuery/XSLT/string.xsl @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/XQuery/XSLT/table.xsl b/XQuery/XSLT/table.xsl new file mode 100644 index 0000000..8078935 --- /dev/null +++ b/XQuery/XSLT/table.xsl @@ -0,0 +1,486 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + error en + + + + + + + error pt + + + + + + + error gl + + + + + + + + + + + + + + + linguistic en + + + + + + + linguistic pt + + + + + + + linguistic gl + + + + + + + + + + + equipolent en + + + + + + + equipolent pt + + + + + + + equipolent gl + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + error en + + + + + + + error pt + + + + + + + error gl + + + + + + + + + + + + linguistic en + + + + + + + linguistic pt + + + + + + + linguistic gl + + + + + + + + + equipolent en + Divergent reading + + + + equipolent pt + Lição divergente + + + + equipolent gl + Lección diverxente + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ( + + + + + + + + + + + gap pt + + + + Erro de cópia + + + Omissão de conteúdos repetidos + + + Omissão de origem desconhecida + + + Omissão provocada pelo estado de conservação do testemunho + + + Trecho ilegível + + + Provavelmente, omissão presente no modelo + + + Testemunho inacabado + + + + + + + gap gl + + + + Erro de copia + + + Omisión de contidos repetidos + + + Omisión de orixe descoñecida + + + Omisión provocada polo estado de conservación do testemuño + + + Trecho ilexíbel + + + Probabelmente, omisión presente no modelo + + + Testemuño inacabado + + + + + + + gap en + + + + Scribal error + + + Omission of repeated contents + + + Unknown reason for omission + + + Damaged witness + + + Illegivel + + + Likely, omission present in the model of this witness + + + Unfinished witness + + + + + + + + + + ) + + + + + + enhance + + + + + + + + + gap pt + + + + Erro de cópia + + + Omissão de conteúdos repetidos + + + Omissão de origem desconhecida + + + Omissão provocada pelo estado de conservação do testemunho + + + Trecho ilegível + + + Provavelmente, omissão presente no modelo + + + Testemunho inacabado + + + [ ] + + + + gap gl + + + + Erro de copia + + + Omisión de contidos repetidos + + + Omisión de orixe descoñecida + + + Omisión provocada polo estado de conservación do testemuño + + + Trecho ilexíbel + + + Probabelmente, omisión presente no modelo + + + Testemuño inacabado + + + [ ] + + + + gap en + + + + Scribal error + + + Omission of repeated contents + + + Unknown reason for omission + + + Damaged witness + + + Illegivel + + + Likely, omission present in the model of this witness + + + Unfinished witness + + + [ ] + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/XQuery/corpus.xquery b/XQuery/corpus.xquery new file mode 100644 index 0000000..950104a --- /dev/null +++ b/XQuery/corpus.xquery @@ -0,0 +1,313 @@ +xquery version "3.0"; +declare namespace tei = "http://www.tei-c.org/ns/1.0"; +declare namespace output = "http://www.w3.org/2010/xslt-xquery-serialization"; +declare option output:method "xhtml"; +declare option output:indent "yes"; +declare option output:encoding "UTF-8"; +let $authors := doc('/db/VTLGP/ancillary/corpus-autores.xml')//tei:person[concat('#', @xml:id) = collection('/db/VTLGP/edition')//tei:name[@role eq 'author']/@ref] +let $periods := $authors/tei:floruit/@period +let $copyists := collection('/db/VTLGP/edition')//tei:div//tei:title//tei:rdg/substring(@hand, 2) +let $authorsImpar := doc('/db/VTLGP/ancillary/corpus-autores.xml')//tei:person[concat('#', @xml:id) = collection('/db/VTLGP/edition')//tei:name[@role eq 'author']/@ref][tei:persName/matches(., '^[A-J]')] +let $authorsPar := doc('/db/VTLGP/ancillary/corpus-autores.xml')//tei:person[concat('#', @xml:id) = collection('/db/VTLGP/edition')//tei:name[@role eq 'author']/@ref][tei:persName/matches(., '^[L-Z]')] +return + + (
+
+
+ { + for $i in 1 to (count($authorsImpar)) + let $author := $authorsImpar[$i] + let $songs := collection('/db/VTLGP/edition')//tei:name[@role eq 'author'][@ref = $author/concat('#', @xml:id)]/ancestor::tei:div + order by $author + return +
+ {$author/tei:persName/string()} +
+ + + + + + +
    + { + for $song in $songs + order by $song/number(substring-before(substring(@corresp, 3), 'B')) + return +
  • +
  • + }
+ +
+
+ }
+
+ { + for $x in 1 to (count($authorsPar)) + let $author := $authorsPar[$x] + let $i := $x + 14 + let $songs := collection('/db/VTLGP/edition')//tei:name[@role eq 'author'][@ref = $author/concat('#', @xml:id)]/ancestor::tei:div + order by $author + return +
+ {$author/tei:persName/string()} +
+ + + + + + +
    + { + for $song in $songs + order by $song/number(substring-before(substring(@corresp, 3), 'B')) + return +
  • +
  • + }
+ +
+
+ } + +
+
+ +
, + (:

Por períodoBy period

, +
+ { + for $period in distinct-values($periods) + let $songs := collection('/db/VTLGP/edition')//tei:name[@role eq 'author'][@ref = $authors[tei:floruit/@period eq $period]/concat('#', @xml:id)]/ancestor::tei:div + order by number($period) + return +
+ Período {$period}Period {$period} +
+ + + + + + +
    + { + for $song in $songs + order by $song/number(substring-before(substring(@corresp, 3), 'B')) + return +
  • +
  • + }
+ +
+
+ } + +
,:) +

Por copistaBy scribe

, +
+ { + for $hand in distinct-values($copyists) + let $songs := collection('/db/VTLGP/edition')//tei:div[@type eq 'poem'][.//tei:title//tei:rdg/substring(@hand, 2) = $hand] + order by $hand + return +
+ Copista {$hand} (manuscrito{ + (if ($hand = ('b', 'c', 'a', 'd', 'e')) then + ' B' + else + (if ($hand = 'v') then + ' V' + else + ' A')) + }) + Scribe {$hand} (witness{ + (if ($hand = ('b', 'c', 'a', 'd', 'e')) then + ' B' + else + (if ($hand = 'v') then + ' V' + else + ' A')) + }) +
+ + + + + + +
    + { + for $song in $songs + order by $song/number(substring-before(substring(@corresp, 3), 'B')) + return +
  • +
  • + }
+ +
+
+ } + +
+ ) diff --git a/XQuery/count.xquery b/XQuery/count.xquery new file mode 100644 index 0000000..9e14e47 --- /dev/null +++ b/XQuery/count.xquery @@ -0,0 +1,5 @@ +xquery version "3.0"; +declare namespace tei = "http://www.tei-c.org/ns/1.0"; +let $songs := collection('/db/VTLGP/edition')//tei:div[@type eq 'poem'] +return + count($songs) \ No newline at end of file diff --git a/XQuery/count2.xquery b/XQuery/count2.xquery new file mode 100644 index 0000000..5c66155 --- /dev/null +++ b/XQuery/count2.xquery @@ -0,0 +1,5 @@ +xquery version "3.0"; +declare namespace tei = "http://www.tei-c.org/ns/1.0"; +declare variable $songs := collection('/db/VTLGP/edition')//tei:div[@type eq 'poem']; +declare variable $authors := doc('/db/VTLGP/ancillary/corpus-autores.xml')//tei:person[concat('#', @xml:id) = $songs//tei:name[@role eq 'author']/@ref]; +count($authors) diff --git a/XQuery/edition.xquery b/XQuery/edition.xquery new file mode 100644 index 0000000..9ceb56e --- /dev/null +++ b/XQuery/edition.xquery @@ -0,0 +1,162 @@ +xquery version "3.0"; +declare namespace tei = "http://www.tei-c.org/ns/1.0"; +declare namespace functx = "http://www.functx.com"; +(: Local function written by David J. Birnbaum (djbpitt@gmail.com) :) +declare namespace djb = "www.obdurodon.org"; +declare option exist:serialize "method=xhtml media-type=application/xhtml+html indent=no"; +declare function djb:locus($from as node()?, $to as node()?) +{ + (if ($from eq $to) + then + $from/string() + else + if (substring($from, 1, string-length($from) - 1) eq substring($to, 1, string-length($to) - 1)) + then + concat($from, '-v') + else + concat($from, '-', $to)) +}; +declare function functx:is-node-in-sequence-deep-equal +($node as node()?, +$seq as node()*) as xs:boolean { + + some $nodeInSeq in $seq + satisfies deep-equal($nodeInSeq, $node) +}; +declare function functx:distinct-deep +($nodes as node()*) as node()* { + + for $seq in (1 to count($nodes)) + return + $nodes[$seq][not(functx:is-node-in-sequence-deep-equal( + ., $nodes[position() < $seq]))] +}; +declare variable $cantigas := collection('/db/VTLGP/edition')//tei:div[@type eq 'poem']; +declare variable $poets := doc('/db/VTLGP/ancillary/corpus-autores.xml')//tei:person[@xml:id/string() = $cantigas//tei:name[@role eq 'author']/substring(@ref, 2)]; +declare variable $partialselection := request:get-parameter("song", ()); +declare variable $partialSelection := request:get-parameter("author", ()); +declare variable $nextSelection := request:get-parameter("scribe", ()); +declare variable $line := request:get-parameter("line", ()); +let $selectionPoet := for $i in tokenize($partialSelection, ',+') +return + concat('#', $i) +let $selectionSong := for $y in tokenize($partialselection, ',+') +return + concat('#', $y) +let $selectionScribe := for $g in tokenize($nextSelection, ',+') +return + concat('#', $g) +let $songs := $cantigas[@corresp = $selectionSong] | +$cantigas[descendant::tei:name[@ref = $selectionPoet]] | +$cantigas[tei:head/descendant::tei:rdg[@hand = $selectionScribe]] +return +
+
+ { + for $song in functx:distinct-deep($songs) + let $author := doc('/db/VTLGP/ancillary/corpus-autores.xml')//tei:person[concat('#', @xml:id) = $song//tei:name[@role eq 'author']/@ref] + order by $song/number(substring-before(substring(@corresp, 3), 'B')) + return +
+ +

Ver edição tabularVer edición tabular + Ver edición tabular

+
+ { + + for $witness in $song/tei:head/descendant::tei:rdg + let $parameter := + + + + + return +
+

TestemunhñoWitness: {$witness/substring(@wit, 2)}

+

Texto: {$witness/tei:idno/string()}

+

LocalizaçãociónLocation: {djb:locus($witness/tei:locus/@from, $witness/tei:locus/@to)}

+

CopistaCopyist: {$witness/substring(@hand, 2)}

+ + {transform:transform($song//tei:lg, doc('/db/VTLGP/xslt/reading.xsl'), $parameter)} + +
+ + } +
+
+ } +
+ +
\ No newline at end of file diff --git a/XQuery/form.xquery b/XQuery/form.xquery new file mode 100644 index 0000000..1a198de --- /dev/null +++ b/XQuery/form.xquery @@ -0,0 +1,208 @@ +xquery version "3.0"; +declare namespace tei = "http://www.tei-c.org/ns/1.0"; +declare namespace output = "http://www.w3.org/2010/xslt-xquery-serialization"; +declare option output:method "xhtml"; +declare option output:indent "yes"; +declare option output:encoding "UTF-8"; +let $songs := collection('/db/VTLGP/edition')//tei:div[@type eq 'poem'] +let $anas := $songs//tei:rdg/@ana +let $ana := distinct-values(for $values in $anas +return + tokenize($values, '\s+')) +let $file := doc('/db/VTLGP/ancillary/feature-library.xml') +let $ling-features := $file//tei:fvLib/tei:fs[concat('#', @xml:id) = $ana] +let $phonetic := $ling-features[.//tei:fs[@type eq 'phonetic']] +let $morph := $ling-features[.//tei:fs[@type eq 'morphosyntactic']/tei:f[@name eq 'POS']/tei:fs] +let $other := $ling-features[.//tei:fs[@type eq 'morphosyntactic']/tei:f[@name eq 'POS']/tei:symbol] + +return + + (
+
+
+ Principais fenómenos morfológicos + + { + for $id in $morph + let $name := $id//tei:string[@xml:lang eq 'pt']/text() + order by $name + return + (, + ,
) + } +
+
+ Fenómenos fonéticos + + { + for $id in $phonetic + let $name := $id//tei:string[@xml:lang eq 'pt']/text() + order by $name + return + (, + ,
) + } +
+
+ Outros fenómenos + + { + for $id in $other + let $name := $id//tei:string[@xml:lang eq 'pt']/text() + order by $name + return + (, + ,
) + } +
+ +
, +
+
+
+ Principais fenómenos morfolóxicos + + { + for $id in $morph + let $name := $id//tei:string[@xml:lang eq 'gl']/text() + order by $name + return + (, + ,
) + } +
+
+ Fenómenos fonéticos + + { + for $id in $phonetic + let $name := $id//tei:string[@xml:lang eq 'gl']/text() + order by $name + return + (, + ,
) + } +
+
+ Outros fenómenos + + { + for $id in $other + let $name := $id//tei:string[@xml:lang eq 'gl']/text() + order by $name + return + (, + ,
) + } + +
+ +
, +
+
+
+ Main morphological phenomena + + { + for $id in $morph + let $name := $id//tei:string[@xml:lang eq 'en']/text() + order by $name + return + (, + ,
) + } +
+
+ Phonetic phenomena + + { + for $id in $phonetic + let $name := $id//tei:string[@xml:lang eq 'en']/text() + order by $name + return + (, + ,
) + } +
+
+ Other phenomena + + { + for $id in $other + let $name := $id//tei:string[@xml:lang eq 'en']/text() + order by $name + return + (, + ,
) + } +
+ +
+ + ) diff --git a/XQuery/graphs/arcaico.svg b/XQuery/graphs/arcaico.svg new file mode 100644 index 0000000..ceef8c0 --- /dev/null +++ b/XQuery/graphs/arcaico.svg @@ -0,0 +1,168 @@ + + + + Grafos + + + + arcaísmos A + + arcaísmos B + + inovações A + + inovações B + + + + arcaísmos A + + arcaísmos B + + inovações A + + inovações B + + + + inovações A (gl) + + inovações B (gl) + + inovações A (pt) + + inovações B (pt) + + + + inovações A (gl) + + inovações B (gl) + + inovações A (pt) + + inovações B (pt) + + + + diff --git a/XQuery/graphs/arcaismos-evol.svg b/XQuery/graphs/arcaismos-evol.svg new file mode 100644 index 0000000..15292ae --- /dev/null +++ b/XQuery/graphs/arcaismos-evol.svg @@ -0,0 +1,4353 @@ + + + + + + Número ocorrências + + + A309 + + + + A307 + + + + A297 + + + + A296 + + + + A295 + + + + A294 + + + + A293 + + + + A292 + + + + A290 + + + + A289 + + + + A288 + + + + A286 + + + + A285 + + + + A283 + + + + A266 + + + + A265 + + + + A264 + + + + A263 + + + + A262 + + + + A261 + + + + A260 + + + + A259 + + + + A258 + + + + A257 + + + + A255 + + + + A248 + + + + A246 + + + + A245 + + + + A244 + + + + A243 + + + + A242 + + + + A240 + + + + A234 + + + + A233 + + + + A232 + + + + A231 + + + + A230 + + + + A229 + + + + A225 + + + + A224 + + + + A223 + + + + A222 + + + + A221 + + + + A220 + + + + A219 + + + + A218 + + + + A217 + + + + A205 + + + + A203 + + + + A202 + + + + A201 + + + + A200 + + + + A199 + + + + A192 + + + + A189 + + + + A187 + + + + A179 + + + + A174 + + + + A173 + + + + A171 + + + + A166 + + + + A165 + + + + A149 + + + + A146 + + + + A145 + + + + A144 + + + + A138 + + + + A137 + + + + A136 + + + + A135 + + + + A133 + + + + A132 + + + + A122 + + + + A121 + + + + A120 + + + + A119 + + + + A118 + + + + A117 + + + + A116 + + + + A115 + + + + A113 + + + + A112 + + + + A111 + + + + A101 + + + + A99 + + + + A95 + + + + A93 + + + + A92 + + + + A90 + + + + A89 + + + + A88 + + + + A87 + + + + A86 + + + + A85 + + + + A84 + + + + A83 + + + + A82 + + + + A76 + + + + A75 + + + + A74 + + + + A73 + + + + A72 + + + + A71 + + + + A70 + + + + A67 + + + + A66 + + + + A65 + + + + A64 + + + + A54 + + + + A53 + + + + A52 + + + + A51 + + + + A50 + + + + A49 + + + + A48 + + + + A47 + + + + A46 + + + + A45 + + + + A44 + + + + A43 + + + + A42 + + + + A41 + + + + A40 + + + + A35 + + + + A34 + + + + A33 + + + + A32 + + + + A31 + + + + A25 + + + + A24 + + + + A23 + + + + A22 + + + + A21 + + + + A20 + + + + A19 + + + + A18 + + + + A17 + + + + A16 + + + + A15 + + + + A14 + + + + A10 + + + + A9 + + + + A8 + + + + A7 + + + + A6 + + + + A5 + + + + A4 + + + + A3 + + + + A2 + + + + A1 + + + + + + + + + + + + + + + + + Roi Fernandiz de Santiago + Vasco Rodriguez de Calvelo + Pero da Ponte + Fernan Padron + Pedr’ Eanes Solaz + Bonifaci Calvo + Fernan Velho + Pai Gomez Charinho + Johan Vasquiz de Talaveira + Estevan Faian + Johan Garcia de Guilhade + Afonso Lopez de Baian + Pero Gomez Barroso + Fernan Gonçalvez de Seabra + Johan Lopez de Ulhoa + Roi Paez de Ribela + Johan Soarez Coelho + Vasco Gil + Roi Queimado + Fernan Garcia Esgaravunha + Johan Nunez Camanez + Pero Garcia de Burgalês + Nuno Fernandez Torneol + Airas Carpancho + Martin Soarez + Pai Soarez de Taveirós + Johan Soarez Somesso + Vasco Fernandez Praga de Sandin + + diff --git a/XQuery/graphs/arcaismos.xquery b/XQuery/graphs/arcaismos.xquery new file mode 100644 index 0000000..2e483d3 --- /dev/null +++ b/XQuery/graphs/arcaismos.xquery @@ -0,0 +1,298 @@ +xquery version "3.0"; +declare namespace tei = "http://www.tei-c.org/ns/1.0"; +declare variable $increase := number('2'); +declare variable $height := number('22'); +declare variable $fs := doc('../../ancillary/feature-library.xml')//tei:fs[@type]; +declare variable $arcaic := +for $i in $fs[@type eq 'arcaico']/@xml:id +return + concat('#', $i); +declare variable $innova-pt := for $i in $fs[@type eq 'inova-pt']/@xml:id +return + concat('#', $i); +declare variable $innova-gl := for $i in $fs[@type eq 'inova-gl']/@xml:id +return + concat('#', $i); +declare variable $innova := for $i in $fs[@type eq 'inova']/@xml:id +return + concat('#', $i); +declare variable $songs := collection('../../edition')//tei:div[@type eq 'poem']; +declare variable $readingsA := $songs//tei:rdg[contains(@wit, '#A')]; +declare variable $readingsB := $songs//tei:rdg[contains(@wit, '#B')]; +declare variable $poets := doc('../../ancillary/corpus-autores.xml')//tei:person; +let $width1a := count($readingsA[tokenize(@ana, '\s+') = $arcaic]) +let $width1a-dis := count(distinct-values($readingsA[tokenize(@ana, '\s+') = $arcaic])) +let $width2a := count($readingsA[tokenize(@ana, '\s+') = $innova]) + count($readingsA[tokenize(@ana, '\s+') = $innova-gl]) + +count($readingsA[tokenize(@ana, '\s+') = $innova-pt]) +let $width2a-dis := count(distinct-values($readingsA[tokenize(@ana, '\s+') = $innova])) + +count(distinct-values($readingsA[tokenize(@ana, '\s+') = $innova-gl])) + count(distinct-values($readingsA[tokenize(@ana, '\s+') = $innova-pt])) + +let $width1b := count($readingsB[tokenize(@ana, '\s+') = $arcaic]) +let $width1b-dis := count(distinct-values($readingsB[tokenize(@ana, '\s+') = $arcaic])) +let $width2b := count($readingsB[tokenize(@ana, '\s+') = $innova]) + count($readingsB[tokenize(@ana, '\s+') = $innova-gl]) + +count($readingsB[tokenize(@ana, '\s+') = $innova-pt]) +let $width2b-dis := count(distinct-values($readingsB[tokenize(@ana, '\s+') = $innova])) + +count(distinct-values($readingsB[tokenize(@ana, '\s+') = $innova-gl])) + count(distinct-values($readingsB[tokenize(@ana, '\s+') = $innova-pt])) + +let $width3a := count($readingsA[tokenize(@ana, '\s+') = $innova-gl]) +let $width3a-dis := count(distinct-values($readingsA[tokenize(@ana, '\s+') = $innova-gl])) +let $width3b := count($readingsB[tokenize(@ana, '\s+') = $innova-gl]) +let $width3b-dis := count(distinct-values($readingsB[tokenize(@ana, '\s+') = $innova-gl])) + +let $width4a := count($readingsA[tokenize(@ana, '\s+') = $innova-pt]) +let $width4a-dis := count(distinct-values($readingsA[tokenize(@ana, '\s+') = $innova-pt])) +let $width4b := count($readingsB[tokenize(@ana, '\s+') = $innova-pt]) +let $width4b-dis := count(distinct-values($readingsB[tokenize(@ana, '\s+') = $innova-pt])) + +return + + + Grafos + + + + arcaísmos A + + arcaísmos B + + inovações A + + inovações B + + + + arcaísmos A + + arcaísmos B + + inovações A + + inovações B + + + + inovações A (gl) + + inovações B (gl) + + inovações A (pt) + + inovações B (pt) + + + + inovações A (gl) + + inovações B (gl) + + inovações A (pt) + + inovações B (pt) + + + + \ No newline at end of file diff --git a/XQuery/graphs/common-text.xquery b/XQuery/graphs/common-text.xquery new file mode 100644 index 0000000..2cb1ad6 --- /dev/null +++ b/XQuery/graphs/common-text.xquery @@ -0,0 +1,56 @@ +xquery version "3.0"; +declare namespace tei = "http://www.tei-c.org/ns/1.0"; +declare option exist:serialize "method=html5 media-type=text/html omit-xml-declaration=yes indent=yes"; +declare variable $songs := collection('/db/VTLGP/edition')//tei:div[@type eq 'poem']; +declare variable $fs := doc('/db/VTLGP/ancillary/feature-library.xml'); +declare variable $ling-features := $fs//tei:fvLib[@corresp eq '#linguistic']/tei:fs/@xml:id; +declare variable $equipolent := $fs//tei:fvLib[@n eq 'equipolent readings']/tei:fs/@xml:id; +declare variable $scribalError := $fs//tei:fvLib[@corresp eq '#scribal']/tei:fs/@xml:id; +declare variable $significant := $equipolent | $scribalError | $ling-features; +let $authors := doc('/db/VTLGP/ancillary/corpus-autores.xml')//tei:person[concat('#', @xml:id) = $songs//tei:name[@role eq 'author']/@ref] +return + + + Overlapping graphs + + +{for $author in $authors +let $booksong := $songs[descendant::tei:name[@role eq 'author']/@ref = concat('#', $author/@xml:id)] +order by $author +return + + (

{$author/tei:persName/string()}

, + + { + let $widthA:= sum($booksong/descendant::tei:rdg[contains(@wit, '#A')]/string-length(.)) div 10 + let $xB:= sum($booksong/descendant::tei:rdg[@wit eq'#A']/string-length(.)) div 10 + let $widthB:= sum($booksong/descendant::tei:rdg[contains(@wit, '#B')]/string-length(.)) div 10 + let $count:= count($booksong) + return + (: if (count($booksong) le 3) then + + + + + else + if(count($booksong) gt 8) then + + + + + + + else + + + + :) + + + + + + } + )} + + \ No newline at end of file diff --git a/XQuery/graphs/corpus-comparison-compact.xquery b/XQuery/graphs/corpus-comparison-compact.xquery new file mode 100644 index 0000000..ab6b0cf --- /dev/null +++ b/XQuery/graphs/corpus-comparison-compact.xquery @@ -0,0 +1,264 @@ +xquery version "3.0"; +declare namespace tei = "http://www.tei-c.org/ns/1.0"; +declare variable $songs := //song[@class eq 'A']; +declare variable $b := //song[@class eq 'B']; +declare variable $collection := collection('../../edition')//tei:div[@type eq 'poem']; +declare variable $authors := distinct-values($songs/author); +declare variable $realauthors := $songs/author[not(. = ' ')]; +declare variable $colors := ('#B54D1A', '#EAE5C5', '#4E240A', '#351278', '#B0E9ED', '#FFFDF0', '#848DF1', '#58B94C', '#B15282', '#5B77EE', '#FD2F8D', '#311CE1', +'#E399DE', '#6A685A', '#D03471', '#6C659D', '#398566', '#74A0D7', '#F20EDA', '#6BA901', '#A38A9E', '#1D8A3E', '#1A2BB0', '#5C647F', '#EFC88C', '#A303DA', '#2F7A9B', '#9A5C61', '#CABFE5', +'#1C4D5D', '#679DA1', '#B788A4', '#9D9875', '#F45B43', '#050526', '#2D648A', '#4C0391', '#B1CFF3', '#AE709B', '#4A14F4', '#A21169', '#BA6CDF', '#D91A91', '#D40549', '#1842D3', +'#68579C', '#157715', '#7FF998', '#4EA807'); +declare variable $colors2 := ('#B54D1A', '#4E240A', '#351278', '#B0E9ED', '#FFFDF0', '#848DF1', '#58B94C', '#B15282', '#5B77EE', '#FD2F8D', '#311CE1', +'#E399DE', '#6A685A', '#D03471', '#6C659D', '#398566', '#74A0D7', '#F20EDA', '#6BA901', '#A38A9E', '#1D8A3E', '#1A2BB0', '#5C647F', '#EFC88C', +'#A303DA', '#2F7A9B', '#9A5C61', '#CABFE5', '#1C4D5D', '#679DA1', '#B788A4', '#9D9875', '#F45B43', '#050526', '#2D648A', '#4C0391', '#B1CFF3', '#AE709B', +'#4A14F4', '#A21169', '#BA6CDF', '#D91A91', '#D40549', '#1842D3', '#68579C', '#157715', '#7FF998', '#4EA807'); +declare variable $colors3 := ('#B54D1A', '#EAE5C5', '#4E240A', '#351278', '#B0E9ED', '#EAE5C5', '#848DF1', '#58B94C', '#B15282', '#5B77EE', '#FD2F8D', '#311CE1', +'#E399DE', '#6A685A', '#D03471', '#6C659D', '#398566', '#74A0D7', '#F20EDA', '#6BA901', '#A38A9E', '#1D8A3E', '#1A2BB0', '#5C647F', '#EFC88C', '#A303DA', '#2F7A9B', '#9A5C61', '#CABFE5', +'#1C4D5D', '#679DA1', '#B788A4', '#9D9875', '#F45B43', '#050526', '#2D648A', '#4C0391', '#B1CFF3', '#AE709B', '#4A14F4', '#A21169', '#BA6CDF', '#D91A91', '#D40549', '#1842D3', +'#68579C', '#157715', '#7FF998', '#4EA807'); + + All + Other witnesses + Done + + { + let $sorted := for $song in $songs + order by $song/*[1]/number(replace(., '-.*', '')) + return + $song + for $song at $position in $sorted + let $margin := number('100') + let $current := index-of($authors, $song/*[3]) + return + (if ((number($song/*[1]) + 3) mod 4 = 0) then + + + else + (if ((number($song/*[1]) + 2) mod 4 = 0) + + then + + + else + (if ((number($song/*[1]) + 1) mod 4 = 0) then + + else + + )) + + , + if ($song/*[1]/@id = $b/*[1]/@id and (number($song/*[1]) + 3) mod 4 = 0) then + + else + (if ($song/*[1]/@id = $b/*[1]/@id and (number($song/*[1]) + 2) mod 4 = 0) + then + + else + (if ($song/*[1]/@id = $b/*[1]/@id and (number($song/*[1] + 1) mod 4 = 0)) + then + + else + (if ($song/*[1]/@id = $b/*[1]/@id and number($song/*[1] mod 4 = 0)) then + + else + ()))), + + if ($collection//tei:head/descendant::tei:rdg[@wit eq '#A']/substring(tei:idno, 2) = $song/*[1]/replace(., '-([a-z])', '$1') + and (number($song/*[1]) + 3) mod 4 = 0) then + + else + (if ($collection//tei:head/descendant::tei:rdg[@wit eq '#A']/substring(tei:idno, 2) = $song/*[1]/replace(., '-([a-z])', '$1') + and (number($song/*[1]) + 2) mod 4 = 0) then + + else + (if ($collection//tei:head/descendant::tei:rdg[@wit eq '#A']/substring(tei:idno, 2) = $song/*[1]/replace(., '-([a-z])', '$1') + and number($song/*[1] + 1) mod 4 = 0) then + + else + (if ($collection//tei:head/descendant::tei:rdg[@wit eq '#A']/substring(tei:idno, 2) = $song/*[1]/replace(., '-([a-z])', '$1') + and number($song/*[1]) mod 4 = 0) then + + else + ()))) + ) + } + + { + for $author at $pos in distinct-values($realauthors) + let $current := $colors2[$pos] + return + if (($pos + 5) mod 6 = 0) then + ({replace($author, '\(.*?\)', '')}, + ) + else + (if (($pos + 4) mod 6 = 0) + then + ({replace($author, '\(.*?\)', '')}, + ) + else + (if (($pos + 3) mod 6 = 0) then + ({replace($author, '\(.*?\)', '')}, + ) + else + (if (($pos + 2) mod 6 = 0) then + ({replace($author, '\(.*?\)', '')}, + ) + else + (if (($pos + 1) mod 6 = 0) + then + ({replace($author, '\(.*?\)', '')}, + ) + else + (if ($pos mod 6 = 0) + then + ({replace($author, '\(.*?\)', '')}, + ) + else + ()))))) + } + + \ No newline at end of file diff --git a/XQuery/graphs/corpus-comparison-long.xquery b/XQuery/graphs/corpus-comparison-long.xquery new file mode 100644 index 0000000..97ead8e --- /dev/null +++ b/XQuery/graphs/corpus-comparison-long.xquery @@ -0,0 +1,204 @@ +xquery version "3.0"; +declare namespace tei = "http://www.tei-c.org/ns/1.0"; +declare variable $songs := //song[@class eq 'A']; +declare variable $b := //song[@class eq 'B']; +declare variable $collection := collection('../../edition')//tei:div[@type eq 'poem']; +declare variable $authors := distinct-values($songs/author); +declare variable $realauthors := $songs/author[not(. = ' ')]; +declare variable $colors := ('#B54D1A', '#4E240A', '#351278', '#FFFDF0', '#B0E9ED', '#848DF1', '#58B94C', '#B15282', '#5B77EE', '#FD2F8D', '#311CE1', +'#E399DE', '#6A685A', '#D03471', '#EAE5C5', '#6C659D', '#398566', '#74A0D7', '#F20EDA', '#6BA901', '#A38A9E', '#1D8A3E', '#1A2BB0', '#5C647F', '#EFC88C', '#A303DA', '#2F7A9B', '#9A5C61', '#CABFE5', +'#1C4D5D', '#679DA1', '#B788A4', '#9D9875', '#F45B43', '#050526', '#2D648A', '#4C0391', '#B1CFF3', '#AE709B', '#4A14F4', '#A21169', '#BA6CDF', '#D91A91', '#D40549', '#1842D3', +'#68579C', '#157715', '#7FF998', '#4EA807'); +declare variable $colors2 := ('#B54D1A', '#4E240A', '#351278', '#FFFDF0', '#B0E9ED', '#848DF1', '#58B94C', '#B15282', '#5B77EE', '#FD2F8D', '#311CE1', +'#E399DE', '#6A685A', '#D03471', '#6C659D', '#398566', '#74A0D7', '#F20EDA', '#6BA901', '#A38A9E', '#1D8A3E', '#1A2BB0', '#5C647F', '#EFC88C', +'#A303DA', '#2F7A9B', '#9A5C61', '#CABFE5', '#1C4D5D', '#679DA1', '#B788A4', '#9D9875', '#F45B43', '#050526', '#2D648A', '#4C0391', '#B1CFF3', '#AE709B', +'#4A14F4', '#A21169', '#BA6CDF', '#D91A91', '#D40549', '#1842D3', '#68579C', '#157715', '#7FF998', '#4EA807'); + + All + Other witnesses + Done + + { + let $sorted := for $song in $songs + order by $song/*[1]/number(replace(., '-.*', '')) + return + $song + for $song at $position in $sorted + let $margin := number('100') + let $current := index-of($authors, $song/*[3]) + return + (if ((number($song/*[1]) + 2) mod 3 = 0) then + + + else + (if ((number($song/*[1]) + 1) mod 3 = 0) + + then + + + else + + ) + + , + if ($song/*[1]/@id = $b/*[1]/@id and (number($song/*[1]) + 2) mod 3 = 0) then + + else + (if ($song/*[1]/@id = $b/*[1]/@id and (number($song/*[1]) + 1) mod 3 = 0) + then + + else + (if ($song/*[1]/@id = $b/*[1]/@id and number($song/*[1] mod 3 = 0)) + then + + else + ())), + if ($collection//tei:head/descendant::tei:rdg[@wit eq '#A']/substring(tei:idno, 2) = $song/*[1]/replace(., '-([a-z])', '$1') + and (number($song/*[1]) + 2) mod 3 = 0) then + + else + (if ($collection//tei:head/descendant::tei:rdg[@wit eq '#A']/substring(tei:idno, 2) = $song/*[1]/replace(., '-([a-z])', '$1') + and (number($song/*[1]) + 1) mod 3 = 0) then + + else + (if ($collection//tei:head/descendant::tei:rdg[@wit eq '#A']/substring(tei:idno, 2) = $song/*[1]/replace(., '-([a-z])', '$1') + and number($song/*[1]) mod 3 = 0) then + + else + ())) + ) + } + + { + for $author at $pos in distinct-values($realauthors) + let $current := $colors2[$pos] + return + if (($pos + 3) mod 4 = 0) then + ({replace($author, '\(.*?\)', '')}, + ) + else + (if (($pos + 2) mod 4 = 0) + then + ({replace($author, '\(.*?\)', '')}, + ) + else + (if (($pos + 1) mod 4 = 0) then + ({replace($author, '\(.*?\)', '')}, + ) + else + (if ($pos mod 4 = 0) + then + ({replace($author, '\(.*?\)', '')}, + ) + else + ()))) + } + + \ No newline at end of file diff --git a/XQuery/graphs/corpus-comparison-tese.xquery b/XQuery/graphs/corpus-comparison-tese.xquery new file mode 100644 index 0000000..ab6b0cf --- /dev/null +++ b/XQuery/graphs/corpus-comparison-tese.xquery @@ -0,0 +1,264 @@ +xquery version "3.0"; +declare namespace tei = "http://www.tei-c.org/ns/1.0"; +declare variable $songs := //song[@class eq 'A']; +declare variable $b := //song[@class eq 'B']; +declare variable $collection := collection('../../edition')//tei:div[@type eq 'poem']; +declare variable $authors := distinct-values($songs/author); +declare variable $realauthors := $songs/author[not(. = ' ')]; +declare variable $colors := ('#B54D1A', '#EAE5C5', '#4E240A', '#351278', '#B0E9ED', '#FFFDF0', '#848DF1', '#58B94C', '#B15282', '#5B77EE', '#FD2F8D', '#311CE1', +'#E399DE', '#6A685A', '#D03471', '#6C659D', '#398566', '#74A0D7', '#F20EDA', '#6BA901', '#A38A9E', '#1D8A3E', '#1A2BB0', '#5C647F', '#EFC88C', '#A303DA', '#2F7A9B', '#9A5C61', '#CABFE5', +'#1C4D5D', '#679DA1', '#B788A4', '#9D9875', '#F45B43', '#050526', '#2D648A', '#4C0391', '#B1CFF3', '#AE709B', '#4A14F4', '#A21169', '#BA6CDF', '#D91A91', '#D40549', '#1842D3', +'#68579C', '#157715', '#7FF998', '#4EA807'); +declare variable $colors2 := ('#B54D1A', '#4E240A', '#351278', '#B0E9ED', '#FFFDF0', '#848DF1', '#58B94C', '#B15282', '#5B77EE', '#FD2F8D', '#311CE1', +'#E399DE', '#6A685A', '#D03471', '#6C659D', '#398566', '#74A0D7', '#F20EDA', '#6BA901', '#A38A9E', '#1D8A3E', '#1A2BB0', '#5C647F', '#EFC88C', +'#A303DA', '#2F7A9B', '#9A5C61', '#CABFE5', '#1C4D5D', '#679DA1', '#B788A4', '#9D9875', '#F45B43', '#050526', '#2D648A', '#4C0391', '#B1CFF3', '#AE709B', +'#4A14F4', '#A21169', '#BA6CDF', '#D91A91', '#D40549', '#1842D3', '#68579C', '#157715', '#7FF998', '#4EA807'); +declare variable $colors3 := ('#B54D1A', '#EAE5C5', '#4E240A', '#351278', '#B0E9ED', '#EAE5C5', '#848DF1', '#58B94C', '#B15282', '#5B77EE', '#FD2F8D', '#311CE1', +'#E399DE', '#6A685A', '#D03471', '#6C659D', '#398566', '#74A0D7', '#F20EDA', '#6BA901', '#A38A9E', '#1D8A3E', '#1A2BB0', '#5C647F', '#EFC88C', '#A303DA', '#2F7A9B', '#9A5C61', '#CABFE5', +'#1C4D5D', '#679DA1', '#B788A4', '#9D9875', '#F45B43', '#050526', '#2D648A', '#4C0391', '#B1CFF3', '#AE709B', '#4A14F4', '#A21169', '#BA6CDF', '#D91A91', '#D40549', '#1842D3', +'#68579C', '#157715', '#7FF998', '#4EA807'); + + All + Other witnesses + Done + + { + let $sorted := for $song in $songs + order by $song/*[1]/number(replace(., '-.*', '')) + return + $song + for $song at $position in $sorted + let $margin := number('100') + let $current := index-of($authors, $song/*[3]) + return + (if ((number($song/*[1]) + 3) mod 4 = 0) then + + + else + (if ((number($song/*[1]) + 2) mod 4 = 0) + + then + + + else + (if ((number($song/*[1]) + 1) mod 4 = 0) then + + else + + )) + + , + if ($song/*[1]/@id = $b/*[1]/@id and (number($song/*[1]) + 3) mod 4 = 0) then + + else + (if ($song/*[1]/@id = $b/*[1]/@id and (number($song/*[1]) + 2) mod 4 = 0) + then + + else + (if ($song/*[1]/@id = $b/*[1]/@id and (number($song/*[1] + 1) mod 4 = 0)) + then + + else + (if ($song/*[1]/@id = $b/*[1]/@id and number($song/*[1] mod 4 = 0)) then + + else + ()))), + + if ($collection//tei:head/descendant::tei:rdg[@wit eq '#A']/substring(tei:idno, 2) = $song/*[1]/replace(., '-([a-z])', '$1') + and (number($song/*[1]) + 3) mod 4 = 0) then + + else + (if ($collection//tei:head/descendant::tei:rdg[@wit eq '#A']/substring(tei:idno, 2) = $song/*[1]/replace(., '-([a-z])', '$1') + and (number($song/*[1]) + 2) mod 4 = 0) then + + else + (if ($collection//tei:head/descendant::tei:rdg[@wit eq '#A']/substring(tei:idno, 2) = $song/*[1]/replace(., '-([a-z])', '$1') + and number($song/*[1] + 1) mod 4 = 0) then + + else + (if ($collection//tei:head/descendant::tei:rdg[@wit eq '#A']/substring(tei:idno, 2) = $song/*[1]/replace(., '-([a-z])', '$1') + and number($song/*[1]) mod 4 = 0) then + + else + ()))) + ) + } + + { + for $author at $pos in distinct-values($realauthors) + let $current := $colors2[$pos] + return + if (($pos + 5) mod 6 = 0) then + ({replace($author, '\(.*?\)', '')}, + ) + else + (if (($pos + 4) mod 6 = 0) + then + ({replace($author, '\(.*?\)', '')}, + ) + else + (if (($pos + 3) mod 6 = 0) then + ({replace($author, '\(.*?\)', '')}, + ) + else + (if (($pos + 2) mod 6 = 0) then + ({replace($author, '\(.*?\)', '')}, + ) + else + (if (($pos + 1) mod 6 = 0) + then + ({replace($author, '\(.*?\)', '')}, + ) + else + (if ($pos mod 6 = 0) + then + ({replace($author, '\(.*?\)', '')}, + ) + else + ()))))) + } + + \ No newline at end of file diff --git a/XQuery/graphs/corpus-composition.xquery b/XQuery/graphs/corpus-composition.xquery new file mode 100644 index 0000000..cac46c6 --- /dev/null +++ b/XQuery/graphs/corpus-composition.xquery @@ -0,0 +1,172 @@ +xquery version "3.0"; +declare namespace tei = "http://www.tei-c.org/ns/1.0"; +declare variable $poets := doc('/db/VTLGP/ancillary/corpus-autores.xml')//tei:person; +declare variable $songs := collection('/db/VTLGP/edition')//tei:div[@type eq 'poem']; +declare variable $periods := $poets[@xml:id = $songs//tei:name/substring(@ref, 2)]/tei:floruit/@period; +declare variable $witnesses := $songs//tei:title//tei:rdg/@wit; +declare variable $copyists := $songs//tei:title//tei:rdg/@hand; +declare variable $count := count($songs); +
+

Cantigas segundo o períodoSongs by period

+ + + { + + for $period at $pos in distinct-values($periods) + let $sum := count($songs[.//tei:name/substring(@ref, 2) = $poets[./tei:floruit/@period eq $period]/@xml:id]) + let $percentage := round-half-to-even((100 * $sum div $count), 2) + return + + + {' (' || $percentage || '%)'} + Período {$period} + Period {$period} + + } +

Cantigas por testemunhotestemuñoSongs by witness

+ + { + + for $wit at $pos in distinct-values($witnesses) + let $sum := count($songs[.//tei:title//tei:rdg/@wit = $wit]) + let $percentage := round-half-to-even((100 * $sum div $count), 2) + return + + + {' (' || $percentage || '%)'} + Ms. {substring($wit, 2)} + + + { + let $hand := $songs/tei:head//tei:rdg[@wit = $wit]/@hand + let $distinctHands := for $distinct-hand in distinct-values($hand) order by $distinct-hand return $distinct-hand + for $h in 1 to count($distinctHands) + let $x := count($songs[.//tei:head//tei:rdg[@wit = $wit][@hand = $distinctHands[position() lt $h]]]) + let $div := $songs[tei:head//tei:rdg[@wit = $wit][@hand = $distinctHands[$h]]] + let $conta := count($div) + order by $h + + + return + + (, + {substring($distinctHands[$h], 2)}) + + + } + + } +

Cantigas segundo o copistaSongs by scribe

+ + { + let $variables := + { + + for $hand in distinct-values($copyists) + let $sum := count($songs[.//tei:title//tei:rdg/@hand = $hand]) + let $percentage := round-half-to-even((100 * $sum div $count), 2) + order by $sum descending + return + + {$sum} + {$percentage} + {$hand} + + } + for $thing at $pos in $variables/item + return + + + {' (' || $thing/percentage || '%)'} + Copista {substring($thing/hand, 2)} + Copyist {substring($thing/hand, 2)} + + } +
\ No newline at end of file diff --git a/XQuery/graphs/corpus.svg b/XQuery/graphs/corpus.svg new file mode 100644 index 0000000..870dbf9 --- /dev/null +++ b/XQuery/graphs/corpus.svg @@ -0,0 +1,4467 @@ + + + All + Other witnesses + Done + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Vasco Praga de Sandin + + Johan Soarez Somesso + + Pai Soarez de Taveirós + + Martin Soarez + + Dubidoso/Anónimo + + Airas Carpancho + + Nuno Rodriguez de Candarei + + Nuno Fernandez Torneol + + Pero Garcia Burgalês + + Johan Nunez Camanez + + Fernan Garcia Esgaravunha + + Roi Queimado + + Vasco Gil + + Johan Soarez Coelho + + Roi Paez de Ribela + + Johan Lopez de Ulhoa + + Fernan Gonçalvez de Seabra + + Pero Gomez Barroso + + Afonso Lopez de Baian + + Johan Garcia de Guilhade + + Estevan Faian + + Johan Vasquiz de Talaveira + + Pai Gomez Charinho + + Fernan Velho + + Bonifaci Calvo + + Pedr' Eanes Solaz + + Fernan Padron + + Pero da Ponte + + Vasco Rodriguez de Calvelo + + Martin Moxa + + Roi Fernandiz, clérigo de Santiago + + + diff --git a/XQuery/graphs/evol-lingua-arcaismos.xquery b/XQuery/graphs/evol-lingua-arcaismos.xquery new file mode 100644 index 0000000..31f7d56 --- /dev/null +++ b/XQuery/graphs/evol-lingua-arcaismos.xquery @@ -0,0 +1,159 @@ +xquery version "3.0"; +declare namespace tei = "http://www.tei-c.org/ns/1.0"; +(:declare variable $songs := collection('/db/VTLGP/edition')//tei:div[@type eq 'poem']; (\:corpus of songs:\) +declare variable $fs := doc('/db/VTLGP/ancillary/feature-library.xml'); (\:variants file:\):) +declare variable $songs := collection('../../edition')//tei:div[@type eq 'poem']; +declare variable $names := doc('../../ancillary/corpus-autores.xml')//tei:person; +declare variable $authors := $songs//tei:name; +declare variable $fs := doc('../../ancillary/feature-library.xml')//tei:fs[@type]; +declare variable $ling-features := for $i in $fs[@type eq 'arcaico']/@xml:id +return + concat('#', $i); +declare variable $legendWidth := number('22'); +declare variable $legendHeight := number('22'); +declare variable $increased := number('15'); +declare variable $sep := number('9'); + + + + + Número ocorrências + + { + for $section at $pos in + for $i in $songs + order by number($i//tei:title//tei:rdg[@wit eq '#A']/substring(tei:idno, 2)) descending + return + $i + let $ling := $section/descendant::tei:rdg[tokenize(@ana, '\s+') = $ling-features] + let $song := $section//tei:title//tei:rdg[@wit eq '#A']/tei:idno/string() + let $y := count($ling) * $increased + let $dist-ling := count(distinct-values($ling/string())) * $increased + let $x := $sep * $pos + return + + (, + , + + {$song}, + + + + ) + + } + + + + + + + + { + for $i in 1 to 9 + return + + } + + + + + { + for $poet at $pos in + for $i in distinct-values($authors/@ref) + order by number($songs[descendant::tei:name/@ref = $i][1]//tei:title//tei:rdg[@wit eq '#A']/substring(tei:idno, 2)) descending + return + $i + let $name := $names[@xml:id = substring($poet, 2)]/tei:persName + + let $x := $sep * count($songs//tei:name/@ref = $poet) * $pos + return + + {$name/string()} + } + + + + diff --git a/XQuery/graphs/evol-lingua.xquery b/XQuery/graphs/evol-lingua.xquery new file mode 100644 index 0000000..97d11a3 --- /dev/null +++ b/XQuery/graphs/evol-lingua.xquery @@ -0,0 +1,171 @@ +xquery version "3.0"; +declare namespace tei = "http://www.tei-c.org/ns/1.0"; +(:declare variable $songs := collection('/db/VTLGP/edition')//tei:div[@type eq 'poem']; (\:corpus of songs:\) +declare variable $fs := doc('/db/VTLGP/ancillary/feature-library.xml'); (\:variants file:\):) +declare variable $songs := collection('../../edition')//tei:div[@type eq 'poem']; +declare variable $names := doc('../../ancillary/corpus-autores.xml')//tei:person; +declare variable $authors := $songs//tei:name; +declare variable $fs := doc('../../ancillary/feature-library.xml'); +declare variable $ling-features := $fs//tei:fs[tei:f/tei:fs[@type eq 'linguistic']]/@xml:id; +declare variable $legendWidth := number('22'); +declare variable $legendHeight := number('22'); +declare variable $increased := number('12'); +declare variable $sep := number('9'); + + + + + Número ocorrências + + Formas únicas + + { + for $section at $pos in + for $i in $songs + order by number($i//tei:title//tei:rdg[@wit eq '#A']/substring(tei:idno, 2)) descending + return + $i + let $ling := $section/descendant::tei:rdg[tokenize(replace(@ana, '#', ''), '\s+') = $ling-features] + let $song := $section//tei:title//tei:rdg[@wit eq '#A']/tei:idno/string() + let $y := count($ling) * $increased + let $dist-ling := count(distinct-values($ling/string())) * $increased + let $x := $sep * $pos + return + + (, + , + + {$song}, + + + + ) + + } + + + + + + + + { + for $i in 1 to 16 + return + + } + + + + + { + for $poet at $pos in + for $i in distinct-values($authors/@ref) + order by number($songs[descendant::tei:name/@ref = $i][1]//tei:title//tei:rdg[@wit eq '#A']/substring(tei:idno, 2)) descending + return + $i + let $name := $names[@xml:id = substring($poet, 2)]/tei:persName + + let $x := $sep * count($songs//tei:name/@ref = $poet) * $pos + return + + {$name/string()} + } + + + + diff --git a/XQuery/graphs/grafos-tese.xquery b/XQuery/graphs/grafos-tese.xquery new file mode 100644 index 0000000..318a606 --- /dev/null +++ b/XQuery/graphs/grafos-tese.xquery @@ -0,0 +1,166 @@ +xquery version "3.0"; +declare namespace tei = "http://www.tei-c.org/ns/1.0"; +declare variable $increase := number('11'); +declare variable $search := request:get-parameter("phenomenon", ("oer")); +let $values := tokenize($search, ',') +let $songs := collection('/db/VTLGP/edition')//tei:div[@type eq 'poem'] +let $readings := $songs//tei:rdg +let $ling-features := doc('/db/VTLGP/ancillary/feature-library.xml')//tei:fs[@xml:id] +let $poets := doc('/db/VTLGP/ancillary/corpus-autores.xml')//tei:person +return +
+ { + for $result in $values + return + (

{transform:transform($ling-features[@xml:id = $result]//tei:string[@xml:lang eq 'pt']/text(), 'xmldb:exist:///db/VTLGP/xslt/string.xsl', ())}

, +

Testemunho

, + + { + + let $fen := $readings[some $ana in tokenize(@ana, '\s+') satisfies $ana = concat('#', $result)] + for $wit at $pos in + for $i in distinct-values($fen/tokenize(./@wit, '\s+')) + order by count($fen[./tokenize(@wit, '\s+') = $i]) descending + return + $i + let $count := count($fen[contains(@wit, $wit)]) + let $sum := count($fen) + let $percentage := round-half-to-even((100 * $count div $sum), 2) + order by $count descending + return + + + {' (' || $percentage || '%)'} + Ms. {substring($wit, 2)} + + { + let $hand := $songs[.//tei:rdg[. intersect $fen[contains(@wit, $wit)]]]/tei:head//tei:rdg[@wit = $wit]/@hand + let $distinctHands := distinct-values($hand) + for $h in 1 to count($distinctHands) + let $x := count($songs[tei:head//tei:rdg[@wit = $wit][@hand = $distinctHands[position() lt $h]]] + //tei:rdg[. intersect $fen][contains(@wit, $wit)]) + let $div := $songs[tei:head//tei:rdg[@wit = $wit][@hand = $distinctHands[$h]]][.//tei:rdg[. intersect $fen]] + let $conta := count($div//tei:rdg[. intersect $fen[contains(@wit, $wit)]]) + order by $h descending + return + + + {substring($distinctHands[$h], 2)} + + } + + }, +

Período

, + + { + + let $fen := $readings[some $ana in tokenize(@ana, '\s+') satisfies $ana = concat('#', $result)] + for $period at $pos in + for $i in distinct-values($poets[@xml:id = $fen/ancestor::tei:div[1]//tei:name/substring(@ref, 2)]/tei:floruit/@period) + order by count($fen[ancestor::tei:div[1]//tei:name/substring(@ref, 2) = $poets/tei:floruit[@period = $i]/../@xml:id]) descending + return + $i + let $count := count($fen[ancestor::tei:div[1]//tei:name/substring(@ref, 2) = $poets/tei:floruit[@period = $period]/../@xml:id]) + let $sum := count($fen) + let $percentage := round-half-to-even((100 * $count div $sum), 2) + order by $count descending + return + + + {' (' || $percentage || '%)'} + P°. {$period} + + }, + + { + + let $fen := $readings[some $ana in tokenize(@ana, '\s+') satisfies $ana = concat('#', $result)] + for $nationality at $pos in + for $i in distinct-values($poets[@xml:id = $fen/ancestor::tei:div[1]//tei:name/substring(@ref, 2)]/tei:nationality/@key) + order by count($fen[ancestor::tei:div[1]//tei:name/substring(@ref, 2) = $poets/tei:nationality[@key = $i]/../@xml:id]) descending + return + $i + let $count := count($fen[ancestor::tei:div[1]//tei:name/substring(@ref, 2) = $poets/tei:nationality[@key = $nationality]/../@xml:id]) + let $sum := count($fen) + let $percentage := round-half-to-even((100 * $count div $sum), 2) + order by $count descending + return + + + {' (' || $percentage || '%)'} + {upper-case($nationality)} + + } + ) + } +
+ diff --git a/XQuery/graphs/image.pdf b/XQuery/graphs/image.pdf new file mode 100644 index 0000000000000000000000000000000000000000..e0078ee052c78846ee764d34fb32ce0820d6d937 GIT binary patch literal 24470 zcmc(n2|QHa`^PI}FZ&W@WKEXYm+afv#aI%FvF~JyLS-jKq!e0^T_I(O7;DOslt>G0 zDiO)jqW*VA<2#Jk>-X*7S9$enays|kbD#5`&+|Ozp8JRyX<%g_vT!D`Yh#zcGQmJ# zkhh&1lY#+0d}=nH&$;Qbvn9PPaw9GR4qnEd>G9r2z_ zK^fa$LXFlCK>O+DHE5zf*~!uyR$w_zOwb#%5J}8y zjzU4Vm>j(veqI&$7jeAAK@vZKVM4$t;{OwWgD&0;Y5bZ&{#qvfz}P_w3d9EBM-C4L zegVm;tAZdPIeR?tH*iP5e*k|2e}0|^v3MSkoN2I+BS_8&@9aoArxD)Q(aRq=jBF$W zM+aBDns*S$3TOg@5GbT98UuwwpddH~E(=E?z+fcEnsltXx0gR~upfwM^#v1a`FaQV zPz-P3YNS^3h)sYo_~O0%e27=J4<7ksn338npfE~@OWVIteDZ8q|2Ao zUDZKJ!f)?B>#k-H{*+_Am9Lz~l5U@LRc-96?HawIpUftw4g_5J7_!?Z-+@5WP4W~hDlXVPva`=X*C!aV@^5jFnjZ83#w7+PI6*;#>rz zMcGxgFK!D7ops=IdTk$QH)4N0xxp}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jF(3v(b+td9ec;wK#N zT$>n|gGiNPfRBYPq?!mg5b1Su9EkKDFYvK&68J(F(z`u4pjss9aMG@H9Eh~z7x-A{ zLfWQ=1Ch1>;XtI#6~M>BSI15&ki}D zq$bel?2Gqtakcl8_4ak%wvA*-BVTWa0DGXC=)XUVB8FR1E@VMc)$#s#4{zs%lLOT` z{eITu{O713Uq>e zv+R5rqJ5XOA&4((Eo;M2j}Hn40}gd*KPZxz5iV9H^9T$pqVz0lLlRfKm$hN2?+p%gS>6whq-FySrM4*?L44@D^crv^ znrhAwE8H&}Lp^T@DE0j!R=8gThA10LuZvjWei0br?);_wkYM7=CCl27NUAwULaFBs z=tjjA5=E57rRPJzh^n}>4T(WgT^9u-iuclfC^#`JS=xpM6Ki5DZ9^f6lDo7G4JIzY zEo&n!Brj`2QS*$35i1!i>xZP~8I7X03kF7f-m>&q449f{3=BmzZx}dnckz;Afrnm1 z@35o|j6qT92GEacE&-oGe9djiv491LFJ&xigHbUA^n+6$ize2^Sb8i3PNgNl;v4mS zK;Ts0O9%u(rD1^oB6`?m*FaI<2b8qLx3nJ=N?fR3)`ljgsmt2nRGb3gE@t_B0MRaS zAH>pQVQ^ykfMso@@OfDqoa#Fbfgz~01Of*WLxN?;qNscT&~Jq{z^KcQ1&UHrx50?< z#?ouRQN(~|SsR)dH7spIz^T4(5Cj-OWoHDO>iY%(+zb_KNYb*wvTLBIzHbmDnD~%= zX+I={dOnb7DjkO)0fDAE7De15yX<_x7kGIa3XY+=Hxz`p%)Ini6ktHAHUx2_{?dK` ze$?k%Va#X.pdf_tex} +%% instead of +%% \includegraphics{.pdf} +%% To scale the image, write +%% \def\svgwidth{} +%% \input{.pdf_tex} +%% instead of +%% \includegraphics[width=]{.pdf} +%% +%% Images with a different path to the parent latex file can +%% be accessed with the `import' package (which may need to be +%% installed) using +%% \usepackage{import} +%% in the preamble, and then including the image with +%% \import{}{.pdf_tex} +%% Alternatively, one can specify +%% \graphicspath{{/}} +%% +%% For more information, please see info/svg-inkscape on CTAN: +%% http://tug.ctan.org/tex-archive/info/svg-inkscape +%% +\begingroup% + \makeatletter% + \providecommand\color[2][]{% + \errmessage{(Inkscape) Color is used for the text in Inkscape, but the package 'color.sty' is not loaded}% + \renewcommand\color[2][]{}% + }% + \providecommand\transparent[1]{% + \errmessage{(Inkscape) Transparency is used (non-zero) for the text in Inkscape, but the package 'transparent.sty' is not loaded}% + \renewcommand\transparent[1]{}% + }% + \providecommand\rotatebox[2]{#2}% + \ifx\svgwidth\undefined% + \setlength{\unitlength}{576.8921875bp}% + \ifx\svgscale\undefined% + \relax% + \else% + \setlength{\unitlength}{\unitlength * \real{\svgscale}}% + \fi% + \else% + \setlength{\unitlength}{\svgwidth}% + \fi% + \global\let\svgwidth\undefined% + \global\let\svgscale\undefined% + \makeatother% + \begin{picture}(1,0.85713589)% + \put(0,0){\includegraphics[width=\unitlength,page=1]{image.pdf}}% + \put(0.55296023,0.00346144){\color[rgb]{0,0,0}\makebox(0,0)[b]{\smash{Índice de formas únicas por verso}}}% + \put(0.01213127,0.46385942){\rotatebox{90}{\makebox(0,0)[b]{\smash{Autores}}}}% + \put(0,0){\includegraphics[width=\unitlength,page=2]{image.pdf}}% + \put(0.9551151,0.4056163){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{Ms. B}}}% + \put(0,0){\includegraphics[width=\unitlength,page=3]{image.pdf}}% + \put(0.9551151,0.44721853){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{Ms. A}}}% + \put(0,0){\includegraphics[width=\unitlength,page=4]{image.pdf}}% + \put(0.26867834,0.12549464){\color[rgb]{0,0,0}\makebox(0,0)[rb]{\smash{Afonso Lopez de Baian}}}% + \put(0,0){\includegraphics[width=\unitlength,page=5]{image.pdf}}% + \put(0.26867834,0.09775982){\color[rgb]{0,0,0}\makebox(0,0)[rb]{\smash{Airas Carpancho}}}% + \put(0,0){\includegraphics[width=\unitlength,page=6]{image.pdf}}% + \put(0.26867834,0.15322945){\color[rgb]{0,0,0}\makebox(0,0)[rb]{\smash{Bonifaci Calvo}}}% + \put(0,0){\includegraphics[width=\unitlength,page=7]{image.pdf}}% + \put(0.26867834,0.18096427){\color[rgb]{0,0,0}\makebox(0,0)[rb]{\smash{Estevan Faian}}}% + \put(0,0){\includegraphics[width=\unitlength,page=8]{image.pdf}}% + \put(0.26867834,0.20869909){\color[rgb]{0,0,0}\makebox(0,0)[rb]{\smash{Fernan Garcia Esgaravunha}}}% + \put(0,0){\includegraphics[width=\unitlength,page=9]{image.pdf}}% + \put(0.26867834,0.23643391){\color[rgb]{0,0,0}\makebox(0,0)[rb]{\smash{Fernan Gonçalvez de Seabra}}}% + \put(0,0){\includegraphics[width=\unitlength,page=10]{image.pdf}}% + \put(0.26867834,0.26416873){\color[rgb]{0,0,0}\makebox(0,0)[rb]{\smash{Fernan Padron}}}% + \put(0,0){\includegraphics[width=\unitlength,page=11]{image.pdf}}% + \put(0.26867834,0.29190355){\color[rgb]{0,0,0}\makebox(0,0)[rb]{\smash{Fernan Velho}}}% + \put(0,0){\includegraphics[width=\unitlength,page=12]{image.pdf}}% + \put(0.26867834,0.31963836){\color[rgb]{0,0,0}\makebox(0,0)[rb]{\smash{Johan Garcia de Guilhade}}}% + \put(0,0){\includegraphics[width=\unitlength,page=13]{image.pdf}}% + \put(0.26867834,0.34737318){\color[rgb]{0,0,0}\makebox(0,0)[rb]{\smash{Johan Lopez de Ulhoa}}}% + \put(0,0){\includegraphics[width=\unitlength,page=14]{image.pdf}}% + \put(0.26867834,0.375108){\color[rgb]{0,0,0}\makebox(0,0)[rb]{\smash{Johan Nunez Camanez}}}% + \put(0,0){\includegraphics[width=\unitlength,page=15]{image.pdf}}% + \put(0.26867834,0.40284282){\color[rgb]{0,0,0}\makebox(0,0)[rb]{\smash{Johan Soarez Coelho}}}% + \put(0,0){\includegraphics[width=\unitlength,page=16]{image.pdf}}% + \put(0.26867834,0.45831246){\color[rgb]{0,0,0}\makebox(0,0)[rb]{\smash{Johan Soarez Somesso}}}% + \put(0,0){\includegraphics[width=\unitlength,page=17]{image.pdf}}% + \put(0.26867834,0.48604727){\color[rgb]{0,0,0}\makebox(0,0)[rb]{\smash{Johan Vasquiz de Talaveira}}}% + \put(0,0){\includegraphics[width=\unitlength,page=18]{image.pdf}}% + \put(0.26867834,0.51378209){\color[rgb]{0,0,0}\makebox(0,0)[rb]{\smash{Martin Soarez}}}% + \put(0,0){\includegraphics[width=\unitlength,page=19]{image.pdf}}% + \put(0.26867834,0.54151691){\color[rgb]{0,0,0}\makebox(0,0)[rb]{\smash{Nuno Fernandez Torneol}}}% + \put(0,0){\includegraphics[width=\unitlength,page=20]{image.pdf}}% + \put(0.26867834,0.56925173){\color[rgb]{0,0,0}\makebox(0,0)[rb]{\smash{Pai Gomez Charinho}}}% + \put(0,0){\includegraphics[width=\unitlength,page=21]{image.pdf}}% + \put(0.26867834,0.59698655){\color[rgb]{0,0,0}\makebox(0,0)[rb]{\smash{Pai Soarez de Taveirós}}}% + \put(0,0){\includegraphics[width=\unitlength,page=22]{image.pdf}}% + \put(0.26867834,0.62472137){\color[rgb]{0,0,0}\makebox(0,0)[rb]{\smash{Pedr’ Eanes Solaz}}}% + \put(0,0){\includegraphics[width=\unitlength,page=23]{image.pdf}}% + \put(0.26867834,0.65245618){\color[rgb]{0,0,0}\makebox(0,0)[rb]{\smash{Pero Garcia de Burgalês}}}% + \put(0,0){\includegraphics[width=\unitlength,page=24]{image.pdf}}% + \put(0.26867834,0.680191){\color[rgb]{0,0,0}\makebox(0,0)[rb]{\smash{Pero Gomez Barroso}}}% + \put(0,0){\includegraphics[width=\unitlength,page=25]{image.pdf}}% + \put(0.26867834,0.70792582){\color[rgb]{0,0,0}\makebox(0,0)[rb]{\smash{Pero da Ponte}}}% + \put(0,0){\includegraphics[width=\unitlength,page=26]{image.pdf}}% + \put(0.26867834,0.43057764){\color[rgb]{0,0,0}\makebox(0,0)[rb]{\smash{Roi Fernandiz de Santiago}}}% + \put(0,0){\includegraphics[width=\unitlength,page=27]{image.pdf}}% + \put(0.26867834,0.73566064){\color[rgb]{0,0,0}\makebox(0,0)[rb]{\smash{Roi Paez de Ribela}}}% + \put(0,0){\includegraphics[width=\unitlength,page=28]{image.pdf}}% + \put(0.26867834,0.76339546){\color[rgb]{0,0,0}\makebox(0,0)[rb]{\smash{Roi Queimado}}}% + \put(0,0){\includegraphics[width=\unitlength,page=29]{image.pdf}}% + \put(0.26867834,0.79113028){\color[rgb]{0,0,0}\makebox(0,0)[rb]{\smash{Vasco Fernandez Praga de Sandin}}}% + \put(0,0){\includegraphics[width=\unitlength,page=30]{image.pdf}}% + \put(0.26867834,0.81886509){\color[rgb]{0,0,0}\makebox(0,0)[rb]{\smash{Vasco Gil}}}% + \put(0,0){\includegraphics[width=\unitlength,page=31]{image.pdf}}% + \put(0.26867834,0.84659991){\color[rgb]{0,0,0}\makebox(0,0)[rb]{\smash{Vasco Rodriguez de Calvelo}}}% + \put(0,0){\includegraphics[width=\unitlength,page=32]{image.pdf}}% + \put(0.30334687,0.04506366){\color[rgb]{0,0,0}\makebox(0,0)[b]{\smash{1}}}% + \put(0.33108168,0.04506366){\color[rgb]{0,0,0}\makebox(0,0)[b]{\smash{2}}}% + \put(0.3588165,0.04506366){\color[rgb]{0,0,0}\makebox(0,0)[b]{\smash{3}}}% + \put(0.38655132,0.04506366){\color[rgb]{0,0,0}\makebox(0,0)[b]{\smash{4}}}% + \put(0.41428614,0.04506366){\color[rgb]{0,0,0}\makebox(0,0)[b]{\smash{5}}}% + \put(0.44202096,0.04506366){\color[rgb]{0,0,0}\makebox(0,0)[b]{\smash{6}}}% + \put(0.46975578,0.04506366){\color[rgb]{0,0,0}\makebox(0,0)[b]{\smash{7}}}% + \put(0.49749059,0.04506366){\color[rgb]{0,0,0}\makebox(0,0)[b]{\smash{8}}}% + \put(0.52522541,0.04506366){\color[rgb]{0,0,0}\makebox(0,0)[b]{\smash{9}}}% + \put(0.55296023,0.04506366){\color[rgb]{0,0,0}\makebox(0,0)[b]{\smash{10}}}% + \put(0.58069505,0.04506366){\color[rgb]{0,0,0}\makebox(0,0)[b]{\smash{11}}}% + \put(0.60842987,0.04506366){\color[rgb]{0,0,0}\makebox(0,0)[b]{\smash{12}}}% + \put(0.63616469,0.04506366){\color[rgb]{0,0,0}\makebox(0,0)[b]{\smash{13}}}% + \put(0.6638995,0.04506366){\color[rgb]{0,0,0}\makebox(0,0)[b]{\smash{14}}}% + \put(0.69163432,0.04506366){\color[rgb]{0,0,0}\makebox(0,0)[b]{\smash{15}}}% + \put(0.71936914,0.04506366){\color[rgb]{0,0,0}\makebox(0,0)[b]{\smash{16}}}% + \put(0.74710396,0.04506366){\color[rgb]{0,0,0}\makebox(0,0)[b]{\smash{17}}}% + \put(0.77483878,0.04506366){\color[rgb]{0,0,0}\makebox(0,0)[b]{\smash{18}}}% + \end{picture}% +\endgroup% diff --git a/XQuery/graphs/ling-evol-prova.xquery b/XQuery/graphs/ling-evol-prova.xquery new file mode 100644 index 0000000..abd5e36 --- /dev/null +++ b/XQuery/graphs/ling-evol-prova.xquery @@ -0,0 +1,512 @@ +xquery version "3.0"; +declare namespace tei = "http://www.tei-c.org/ns/1.0"; +declare variable $songs := collection('/db/VTLGP/edition')//tei:div[@type eq 'poem']; (:corpus of songs:) +declare variable $fs := doc('/db/VTLGP/ancillary/feature-library.xml'); (:variants file:) +declare variable $ling-features := $fs//tei:fs[tei:f/tei:fs[@type eq 'linguistic']]/@xml:id; +(: Since there is a gap in my edition regarding the location of the songs, I manually create the intervals :) +declare variable $sections := + + {$songs[descendant::tei:rdg[@wit eq '#A']/tei:locus/number(replace(@from, 'v|r', '')) = 1][descendant::tei:locus/number(replace(@to, 'v|r', '')) = 1]} + {$songs[descendant::tei:rdg[@wit eq '#A']/tei:locus/number(replace(@from, 'v|r', '')) > 1][descendant::tei:locus/number(replace(@to, 'v|r', '')) <= 5]} + {$songs[descendant::tei:rdg[@wit eq '#A']/tei:locus/number(replace(@from, 'v|r', '')) > 5][descendant::tei:locus/number(replace(@to, 'v|r', '')) <= 10]} + {$songs[descendant::tei:rdg[@wit eq '#A']/tei:locus/number(replace(@from, 'v|r', '')) > 10][descendant::tei:locus/number(replace(@to, 'v|r', '')) <= 15]} + {$songs[descendant::tei:rdg[@wit eq '#A']/tei:locus/number(replace(@from, 'v|r', '')) > 15][descendant::tei:locus/number(replace(@to, 'v|r', '')) <= 20]} + {$songs[descendant::tei:rdg[@wit eq '#A']/tei:locus/number(replace(@from, 'v|r', '')) > 20][descendant::tei:locus/number(replace(@to, 'v|r', '')) <= 25]} + (: Gap in my edition :) + {$songs[descendant::tei:rdg[@wit eq '#A']/tei:locus/number(replace(@from, 'v|r', '')) >= 51][descendant::tei:locus/number(replace(@to, 'v|r', '')) <= 55]} + {$songs[descendant::tei:rdg[@wit eq '#A']/tei:locus/number(replace(@from, 'v|r', '')) > 55][descendant::tei:locus/number(replace(@to, 'v|r', '')) <= 60]} + {$songs[descendant::tei:rdg[@wit eq '#A']/tei:locus/number(replace(@from, 'v|r', '')) > 60][descendant::tei:locus/number(replace(@to, 'v|r', '')) <= 65]} + {$songs[descendant::tei:rdg[@wit eq '#A']/tei:locus/number(replace(@from, 'v|r', '')) > 65][descendant::tei:locus/number(replace(@to, 'v|r', '')) <= 70]} + {$songs[descendant::tei:rdg[@wit eq '#A']/tei:locus/number(replace(@from, 'v|r', '')) > 70][descendant::tei:locus/number(replace(@to, 'v|r', '')) <= 75]} + {$songs[descendant::tei:rdg[@wit eq '#A']/tei:locus/number(replace(@from, 'v|r', '')) > 75][descendant::tei:locus/number(replace(@to, 'v|r', '')) <= 80]} + {$songs[descendant::tei:rdg[@wit eq '#A']/tei:locus/number(replace(@from, 'v|r', '')) > 80][descendant::tei:locus/number(replace(@to, 'v|r', '')) <= 85]} +; +declare variable $legendWidth := number('22'); +declare variable $legendHeight := number('22'); +declare variable $increased := number('2'); + + + + + Número ocorrências + Folio Ms. A + + + + + + + + + + + + + + + + + + + + 20 + 40 + 60 + 80 + 100 + 120 + 140 + 160 + 180 + + + + + + + + + + + + + + + 1 + 5 + 10 + 15 + 20 + 25 + 55 + 60 + 65 + 70 + 75 + 80 + 85 + + Variantes de língua + + Número de fenómenos únicos + + + { + for $section at $pos in $sections/* + let $ling := $section/descendant::tei:rdg[tokenize(replace(@ana, '#', ''), '\s+') = $ling-features] + let $y2 := count($section/following-sibling::*[1]/descendant::tei:rdg[tokenize(replace(@ana, '#', ''), '\s+') = $ling-features]) * $increased + let $y := count($ling) * $increased + let $dist-ling := count(distinct-values($ling)) * $increased + let $yControl := ($y - $y2) div 2 - $y2 + let $x := 40 * $pos (:40 is the interval between the sections:) + return + + ( + , + + , + + + ) + + } + { + for $section at $pos in $sections/*[position() mod 2 = 1] + let $ling := $section/descendant::tei:rdg[tokenize(replace(@ana, '#', ''), '\s+') = $ling-features] + let $y2 := count($section/following-sibling::*[2]/descendant::tei:rdg[tokenize(replace(@ana, '#', ''), '\s+') = $ling-features]) * $increased + let $y := count($ling) * $increased + let $controlY := count($section/following-sibling::*[1]/descendant::tei:rdg[tokenize(replace(@ana, '#', ''), '\s+') = $ling-features]) * $increased + let $x := (($pos - 1) + $pos) * 40 + return + + } + + + + + + \ No newline at end of file diff --git a/XQuery/graphs/ling-evol.xquery b/XQuery/graphs/ling-evol.xquery new file mode 100644 index 0000000..992fe71 --- /dev/null +++ b/XQuery/graphs/ling-evol.xquery @@ -0,0 +1,501 @@ +xquery version "3.0"; +declare namespace tei = "http://www.tei-c.org/ns/1.0"; +declare variable $songs := collection('/db/VTLGP/edition')//tei:div[@type eq 'poem']; (:corpus of songs:) +declare variable $fs := doc('/db/VTLGP/ancillary/feature-library.xml'); (:variants file:) +declare variable $ling-features := $fs//tei:fs[tei:f/tei:fs[@type eq 'linguistic']]/@xml:id; +(: Since there is a gap in my edition regarding the location of the songs, I manually create the intervals :) +declare variable $sections := + +{$songs[descendant::tei:rdg[@wit eq '#A']/tei:locus/number(replace(@from, 'v|r', '')) = 1][descendant::tei:locus/number(replace(@to, 'v|r', '')) = 1]} + {$songs[descendant::tei:rdg[@wit eq '#A']/tei:locus/number(replace(@from, 'v|r', '')) > 1][descendant::tei:locus/number(replace(@to, 'v|r', '')) <= 5]} + {$songs[descendant::tei:rdg[@wit eq '#A']/tei:locus/number(replace(@from, 'v|r', '')) > 5][descendant::tei:locus/number(replace(@to, 'v|r', '')) <= 10]} + {$songs[descendant::tei:rdg[@wit eq '#A']/tei:locus/number(replace(@from, 'v|r', '')) > 10][descendant::tei:locus/number(replace(@to, 'v|r', '')) <= 15]} + {$songs[descendant::tei:rdg[@wit eq '#A']/tei:locus/number(replace(@from, 'v|r', '')) > 15][descendant::tei:locus/number(replace(@to, 'v|r', '')) <= 20]} + {$songs[descendant::tei:rdg[@wit eq '#A']/tei:locus/number(replace(@from, 'v|r', '')) > 20][descendant::tei:locus/number(replace(@to, 'v|r', '')) < 25]} + {$songs[descendant::tei:rdg[@wit eq '#A']/tei:locus/number(replace(@from, 'v|r', '')) >= 25][descendant::tei:locus/number(replace(@to, 'v|r', '')) <= 30]} + (: Gap in my edition :) + {$songs[descendant::tei:rdg[@wit eq '#A']/tei:locus/number(replace(@from, 'v|r', '')) >= 51][descendant::tei:locus/number(replace(@to, 'v|r', '')) <= 55]} + {$songs[descendant::tei:rdg[@wit eq '#A']/tei:locus/number(replace(@from, 'v|r', '')) > 55][descendant::tei:locus/number(replace(@to, 'v|r', '')) <= 60]} + {$songs[descendant::tei:rdg[@wit eq '#A']/tei:locus/number(replace(@from, 'v|r', '')) > 60][descendant::tei:locus/number(replace(@to, 'v|r', '')) <= 65]} + {$songs[descendant::tei:rdg[@wit eq '#A']/tei:locus/number(replace(@from, 'v|r', '')) > 65][descendant::tei:locus/number(replace(@to, 'v|r', '')) <= 70]} + {$songs[descendant::tei:rdg[@wit eq '#A']/tei:locus/number(replace(@from, 'v|r', '')) > 70][descendant::tei:locus/number(replace(@to, 'v|r', '')) <= 75]} + {$songs[descendant::tei:rdg[@wit eq '#A']/tei:locus/number(replace(@from, 'v|r', '')) > 75][descendant::tei:locus/number(replace(@to, 'v|r', '')) <= 80]} + {$songs[descendant::tei:rdg[@wit eq '#A']/tei:locus/number(replace(@from, 'v|r', '')) > 80][descendant::tei:locus/number(replace(@to, 'v|r', '')) <= 85]} + ; +declare variable $legendWidth := number('22'); +declare variable $legendHeight := number('22'); +declare variable $increased := number('2'); + + + + + Número ocorrências + Folio Ms. A + + + + + + + + + + + + + + + + + + + + + 20 + 40 + 60 + 80 + 100 + 120 + 140 + 160 + 180 + + + + + + + + + + + + + + + + 1 + 5 + 10 + 15 + 20 + 25 + 30 + 55 + 60 + 65 + 70 + 75 + 80 + 85 + + Variantes de língua + + Número de fenómenos únicos + + { + for $section at $pos in $sections/* + let $ling := $section/descendant::tei:rdg[tokenize(replace(@ana, '#', ''), '\s+') = $ling-features] + let $y := count($ling) * $increased + let $dist-ling := count(distinct-values($ling)) * $increased + let $x := 40 * $pos (:40 is the interval between the sections:) + return + + ( + , + + + ) + + } + + + + + + \ No newline at end of file diff --git a/XQuery/graphs/radar-plot-initial.svg b/XQuery/graphs/radar-plot-initial.svg new file mode 100644 index 0000000..88d26d2 --- /dev/null +++ b/XQuery/graphs/radar-plot-initial.svg @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + 0 + 10 + 20 + 40 + 60 + 80 + 30 + 50 + 70 + 90 + 10 + 30 + 50 + 70 + 90 + 20 + 40 + 60 + 80 + Variantes de língua + Erros de cópia + Outras + Equipolentes + + \ No newline at end of file diff --git a/XQuery/graphs/radar-plot.xquery b/XQuery/graphs/radar-plot.xquery new file mode 100644 index 0000000..7b7debc --- /dev/null +++ b/XQuery/graphs/radar-plot.xquery @@ -0,0 +1,298 @@ +xquery version "3.0"; +declare namespace tei = "http://www.tei-c.org/ns/1.0"; +declare variable $songs := collection('/db/VTLGP/edition')//tei:div[@type eq 'poem']; +declare variable $fs := doc('/db/VTLGP/ancillary/feature-library.xml'); +declare variable $ling-features := $fs//tei:fvLib[@corresp eq '#linguistic']/tei:fs/@xml:id; +declare variable $equipolent := $fs//tei:fvLib[@n eq 'equipolent readings']/tei:fs/@xml:id; +declare variable $scribalError := $fs//tei:fvLib[@corresp eq '#scribal']/tei:fs/@xml:id; +declare variable $significant := $equipolent | $scribalError | $ling-features; +declare variable $poets := doc('/db/VTLGP/ancillary/corpus-autores.xml')//tei:person[concat('#', @xml:id) = $songs//tei:name[@role eq 'author']/@ref]; +declare variable $periods := $poets[@xml:id = $songs//tei:name/substring(@ref, 2)]/tei:floruit/@period; +declare variable $fixedWidth := number('400'); +declare variable $radio := number("3.5"); +declare variable $color := ('#2B3966', '#BD6D03', '#B3A8CC', '#CF4205', '#6C659D', '#009CA2', '#BC9650', '#233310', '#FFC938', '#5C647F', +'#22461E', '#EDDF81', '#6A643A', '#B0E9ED', '#B788A4', '#889BB7', '#73843A', '#3d4144', '#6A685A', '#2B6273', +'#73473C', '#490301', '#f2cf95', '#1B0CA2', '#630C03', '#025256', '#E25C05', '#11894A', '#009CA2', '#895F11'); +declare variable $max := number('320'); + + + + + + + + + + + + + 0 + 10 + 20 + 40 + 60 + 80 + 30 + 50 + 70 + 10 + 30 + 50 + 70 + 20 + 40 + 60 + 80 + Variantes de língua + Erros de cópia + Outras + Equipolentes + + { + for $period at $pos in distinct-values($periods) + let $booksong := $songs[.//tei:name/substring(@ref, 2) = $poets[./tei:floruit/@period eq $period]/@xml:id] + let $total := sum($booksong/descendant::tei:rdg[tokenize(replace(@ana, '#', ''), '\s+') = $significant]/string-length(.)) + let $errors := sum($booksong/descendant::tei:rdg[tokenize(replace(@ana, '#', ''), '\s+') = $scribalError]/string-length(.)) * $fixedWidth div $total + let $equip := sum($booksong/descendant::tei:rdg[contains(@ana, '#equip')]/string-length(.)) * $fixedWidth div $total + let $ling := sum($booksong/descendant::tei:rdg[tokenize(replace(@ana, '#', ''), '\s+') = $ling-features]/string-length(.)) * $fixedWidth div $total + let $outras := $total * $fixedWidth div $total - $errors - $equip - $ling + return + + + + + + + + + } + { + + let $sortedAuthors := for $author in $poets + order by $songs[descendant::tei:name[@role eq 'author']/@ref = concat('#', $author/@xml:id)][1]/descendant::tei:title/descendant::tei:rdg[@wit eq + '#A']/tei:locus/number(replace(@from, '(v|r)', '')) + return + $author + for $author at $pos in $sortedAuthors + let $booksong := $songs[descendant::tei:name[@role eq 'author']/@ref = concat('#', $author/@xml:id)] + let $total := sum($booksong/descendant::tei:rdg[tokenize(replace(@ana, '#', ''), '\s+') = $significant]/string-length(.)) + let $errors := sum($booksong/descendant::tei:rdg[tokenize(replace(@ana, '#', ''), '\s+') = $scribalError]/string-length(.)) * $fixedWidth div $total + let $equip := sum($booksong/descendant::tei:rdg[contains(@ana, '#equip')]/string-length(.)) * $fixedWidth div $total + let $ling := sum($booksong/descendant::tei:rdg[tokenize(replace(@ana, '#', ''), '\s+') = $ling-features]/string-length(.)) * $fixedWidth div $total + let $outras := $total * $fixedWidth div $total - $errors - $equip - $ling + let $no := $pos + 2 + return + + + + + + + + + } + \ No newline at end of file diff --git a/XQuery/graphs/resultados-tese-autor.xquery b/XQuery/graphs/resultados-tese-autor.xquery new file mode 100644 index 0000000..bdeb60f --- /dev/null +++ b/XQuery/graphs/resultados-tese-autor.xquery @@ -0,0 +1,163 @@ +xquery version "3.0"; +declare namespace tei = "http://www.tei-c.org/ns/1.0"; +(:declare variable $songs := collection('/db/VTLGP/edition')//tei:div[@type eq 'poem']; (\:corpus of songs:\) +declare variable $fs := doc('/db/VTLGP/ancillary/feature-library.xml'); (\:variants file:\):) +declare variable $songs := collection('../../edition')//tei:div[@type eq 'poem']; +declare variable $fs := doc('../../ancillary/feature-library.xml'); +declare variable $ling-features := $fs//tei:fs[tei:f/tei:fs[@type eq 'linguistic']]/@xml:id; +declare variable $legendWidth := number('22'); +declare variable $legendHeight := number('22'); +declare variable $increased := number('20'); +declare variable $sep := number('20'); +declare variable $authors := doc('../../ancillary/corpus-autores.xml')//tei:person[concat('#', @xml:id) = $songs//tei:name/@ref]; + + + + + + + + Índice de formas únicas por verso + Autores + + Ms. B + + Ms. A + + { let $orderedAuthors := for $i in $authors order by $i/tei:nationality/@key descending return $i + for $author at $pos in $orderedAuthors + let $booksong := $songs[descendant::tei:name[substring(@ref, 2) = $author/@xml:id]] + let $lines := count($booksong//tei:l) + let $ling-A := distinct-values($booksong/descendant::tei:rdg[contains(@wit, '#A')] + [tokenize(replace(@ana, '#', ''), '\s+') = $ling-features]/string()) + let $ling-B := distinct-values($booksong/descendant::tei:rdg[contains(@wit, '#B')] + [tokenize(replace(@ana, '#', ''), '\s+') = $ling-features]/string()) + let $x-A := count($ling-A) * $increased * 100 div $lines + let $x-B := count($ling-B) * $increased * 100 div $lines + let $y := $sep * $pos + return + + (, + + , + , + , + + + {$author/tei:persName/text()} + + ) + + } + { + for $i in 1 to 36 + return + + } + + { + for $i in 1 to 18 + return + {$i} + } + + + diff --git a/XQuery/graphs/resultados-tese.xquery b/XQuery/graphs/resultados-tese.xquery new file mode 100644 index 0000000..b3bc093 --- /dev/null +++ b/XQuery/graphs/resultados-tese.xquery @@ -0,0 +1,182 @@ +xquery version "3.0"; +declare namespace tei = "http://www.tei-c.org/ns/1.0"; +(:declare variable $songs := collection('/db/VTLGP/edition')//tei:div[@type eq 'poem']; (\:corpus of songs:\) +declare variable $fs := doc('/db/VTLGP/ancillary/feature-library.xml'); (\:variants file:\):) +declare variable $songs := collection('../../edition')//tei:div[@type eq 'poem']; +declare variable $fs := doc('../../ancillary/feature-library.xml'); +declare variable $ling-features := $fs//tei:fs[tei:f/tei:fs[@type eq 'linguistic']]/@xml:id; +declare variable $legendWidth := number('22'); +declare variable $legendHeight := number('22'); +declare variable $increased := number('12'); +declare variable $sep := number('9'); + + + + + Número ocorrências + Cantiga + + Variantes de língua + + Formas únicas + + { + for $section at $pos in + for $i in $songs + order by number($i//tei:title//tei:rdg[@wit eq '#A']/substring(tei:idno, 2)) descending + return + $i + let $ling := $section/descendant::tei:rdg[tokenize(replace(@ana, '#', ''), '\s+') = $ling-features] + let $song := $section//tei:title//tei:rdg[@wit eq '#A']/tei:idno/string() + let $y := count($ling) * $increased + let $dist-ling := count(distinct-values($ling/string())) * $increased + let $x := $sep * $pos + return + + (, + + , + , + + {$song}, + + + + ) + + } + + + { + for $i in 1 to 21 + return + + } + + + + { + for $x in 1 to 4 + return + {($x + 4 - $x * 2 + 1) * 5} + } + + + 1 + + diff --git a/XQuery/graphs/results-by-author.svg b/XQuery/graphs/results-by-author.svg new file mode 100644 index 0000000..02010b5 --- /dev/null +++ b/XQuery/graphs/results-by-author.svg @@ -0,0 +1,1343 @@ + + + + + + + + + Índice de formas únicas por verso + Autores + + Ms. B + + Ms. A + + + + + Afonso Lopez de Baian + + + + + Fernan Garcia Esgaravunha + + + + + Fernan Gonçalvez de Seabra + + + + + Johan Garcia de Guilhade + + + + + Johan Soarez Coelho + + + + + Martin Soarez + + + + + Pero Gomez Barroso + + + + + Roi Queimado + + + + + Vasco Gil + + + + + Vasco Rodriguez de Calvelo + + + + + Bonifaci Calvo + + + + + + Airas Carpancho + + + + + Fernan Padron + + + + + Fernan Velho + + + + + Johan Lopez de Ulhoa + + + + + Johan Nunez Camanez + + + + + Roi Fernandiz de Santiago + + + + + Johan Soarez Somesso + + + + + Nuno Fernandez Torneol + + + + + Pai Gomez Charinho + + + + + Pai Soarez de Taveirós + + + + + Pero da Ponte + + + + + Roi Paez de Ribela + + + + + Vasco Fernandez Praga de Sandin + + + + + Estevan Faian + + + + + Johan Vasquiz de Talaveira + + + + + Pero Garcia de Burgalês + + + + + Pedr’ Eanes Solaz + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + + diff --git a/XQuery/graphs/results-by-line.svg b/XQuery/graphs/results-by-line.svg new file mode 100644 index 0000000..4e1a53c --- /dev/null +++ b/XQuery/graphs/results-by-line.svg @@ -0,0 +1,1010 @@ + + + + + + Número ocorrências + + Formas únicas + + + A309 + + + + A307 + + + + A297 + + + + A296 + + + + A295 + + + + A294 + + + + A293 + + + + A292 + + + + A290 + + + + A289 + + + + A288 + + + + A286 + + + + A285 + + + + A283 + + + + A266 + + + + A265 + + + + A264 + + + + A263 + + + + A262 + + + + A261 + + + + A260 + + + + A259 + + + + A258 + + + + A257 + + + + A255 + + + + A248 + + + + A246 + + + + A245 + + + + A244 + + + + A243 + + + + A242 + + + + A240 + + + + A234 + + + + A233 + + + + A232 + + + + A231 + + + + A230 + + + + A229 + + + + A225 + + + + A224 + + + + A223 + + + + A222 + + + + A221 + + + + A220 + + + + A219 + + + + A218 + + + + A217 + + + + A205 + + + + A203 + + + + A202 + + + + A201 + + + + A200 + + + + A199 + + + + A192 + + + + A189 + + + + A187 + + + + A179 + + + + A174 + + + + A173 + + + + A171 + + + + A166 + + + + A165 + + + + A149 + + + + A146 + + + + A145 + + + + A144 + + + + A138 + + + + A137 + + + + A136 + + + + A135 + + + + A133 + + + + A132 + + + + A122 + + + + A121 + + + + A120 + + + + A119 + + + + A118 + + + + A117 + + + + A116 + + + + A115 + + + + A113 + + + + A112 + + + + A111 + + + + A101 + + + + A99 + + + + A95 + + + + A93 + + + + A92 + + + + A90 + + + + A89 + + + + A88 + + + + A87 + + + + A86 + + + + A85 + + + + A84 + + + + A83 + + + + A82 + + + + A76 + + + + A75 + + + + A74 + + + + A73 + + + + A72 + + + + A71 + + + + A70 + + + + A67 + + + + A66 + + + + A65 + + + + A64 + + + + A54 + + + + A53 + + + + A52 + + + + A51 + + + + A50 + + + + A49 + + + + A48 + + + + A47 + + + + A46 + + + + A45 + + + + A44 + + + + A43 + + + + A42 + + + + A41 + + + + A40 + + + + A35 + + + + A34 + + + + A33 + + + + A32 + + + + A31 + + + + A25 + + + + A24 + + + + A23 + + + + A22 + + + + A21 + + + + A20 + + + + A19 + + + + A18 + + + + A17 + + + + A16 + + + + A15 + + + + A14 + + + + A10 + + + + A9 + + + + A8 + + + + A7 + + + + A6 + + + + A5 + + + + A4 + + + + A3 + + + + A2 + + + + A1 + + + + + + + + + + + + + + + + + + + + + + + + + Roi Fernandiz de Santiago + Vasco Rodriguez de Calvelo + Pero da Ponte + Fernan Padron + Pedr’ Eanes Solaz + Bonifaci Calvo + Fernan Velho + Pai Gomez Charinho + Johan Vasquiz de Talaveira + Estevan Faian + Johan Garcia de Guilhade + Afonso Lopez de Baian + Pero Gomez Barroso + Fernan Gonçalvez de Seabra + Johan Lopez de Ulhoa + Roi Paez de Ribela + Johan Soarez Coelho + Vasco Gil + Roi Queimado + Fernan Garcia Esgaravunha + Johan Nunez Camanez + Pero Garcia de Burgalês + Nuno Fernandez Torneol + Airas Carpancho + Martin Soarez + Pai Soarez de Taveirós + Johan Soarez Somesso + Vasco Fernandez Praga de Sandin + + diff --git a/XQuery/graphs/results-by-song.svg b/XQuery/graphs/results-by-song.svg new file mode 100644 index 0000000..3ac1a60 --- /dev/null +++ b/XQuery/graphs/results-by-song.svg @@ -0,0 +1,1342 @@ + + + + + + + + + Índice de formas únicas por verso + Autores + + Ms. B + + Ms. A + + + + + Afonso Lopez de Baian + + + + + Fernan Garcia Esgaravunha + + + + + Fernan Gonçalvez de Seabra + + + + + Johan Garcia de Guilhade + + + + + Johan Soarez Coelho + + + + + Martin Soarez + + + + + Pero Gomez Barroso + + + + + Roi Queimado + + + + + Vasco Gil + + + + + Vasco Rodriguez de Calvelo + + + + + Bonifaci Calvo + + + + + + Airas Carpancho + + + + + Fernan Padron + + + + + Fernan Velho + + + + + Johan Lopez de Ulhoa + + + + + Johan Nunez Camanez + + + + + Roi Fernandiz de Santiago + + + + + Johan Soarez Somesso + + + + + Nuno Fernandez Torneol + + + + + Pai Gomez Charinho + + + + + Pai Soarez de Taveirós + + + + + Pero da Ponte + + + + + Roi Paez de Ribela + + + + + Vasco Fernandez Praga de Sandin + + + + + Estevan Faian + + + + + Johan Vasquiz de Talaveira + + + + + Pero Garcia de Burgalês + + + + + Pedr’ Eanes Solaz + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + + diff --git a/XQuery/graphs/tese.svg b/XQuery/graphs/tese.svg new file mode 100644 index 0000000..18facb0 --- /dev/null +++ b/XQuery/graphs/tese.svg @@ -0,0 +1,4467 @@ + + + All + Other witnesses + 35 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Vasco Praga de Sandin + + Johan Soarez Somesso + + Pai Soarez de Taveirós + + Martin Soarez + + Dubidoso/Anónimo + + Airas Carpancho + + Nuno Rodriguez de Candarei + + Nuno Fernandez Torneol + + Pero Garcia Burgalês + + Johan Nunez Camanez + + Fernan Garcia Esgaravunha + + Roi Queimado + + Vasco Gil + + Johan Soarez Coelho + + Roi Paez de Ribela + + Johan Lopez de Ulhoa + + Fernan Gonçalvez de Seabra + + Pero Gomez Barroso + + Afonso Lopez de Baian + + Johan Garcia de Guilhade + + Estevan Faian + + Johan Vasquiz de Talaveira + + Pai Gomez Charinho + + Fernan Velho + + Bonifaci Calvo + + Pedr' Eanes Solaz + + Fernan Padron + + Pero da Ponte + + Vasco Rodriguez de Calvelo + + Martin Moxa + + Roi Fernandiz, clérigo de Santiago + + + diff --git a/XQuery/ling.xquery b/XQuery/ling.xquery new file mode 100644 index 0000000..914c6ee --- /dev/null +++ b/XQuery/ling.xquery @@ -0,0 +1,305 @@ +xquery version "3.0"; +declare namespace tei = "http://www.tei-c.org/ns/1.0"; +(: Local function written by David J. Birnbaum (www.obdurodon.org) :) +declare namespace djb = "www.obdurodon.org"; +declare function djb:locus($from as node(), $to as node()) +{ + (if ($from eq $to) + then + $from/string() + else + if (substring($from, 1, string-length($from) - 1) eq substring($to, 1, string-length($to) - 1)) + then + concat($from, '-v') + else + concat($from, '-', $to)) +}; +declare variable $search := request:get-parameter("phenomenon", ()); +let $values := tokenize($search, ',') +let $songs := collection('/db/VTLGP/edition')//tei:div[@type eq 'poem'] +let $readings := $songs//tei:rdg +let $ling-features := doc('/db/VTLGP/ancillary/feature-library.xml')//tei:fs[tei:f[@name eq 'taxonomy']/tei:fs[@type eq 'linguistic']] +let $poets := doc('/db/VTLGP/ancillary/corpus-autores.xml')//tei:person +return +
+
+ { + for $result in $values + return + (

{transform:transform($ling-features[@xml:id = $result]//tei:string[@xml:lang eq 'pt']/text(), 'xmldb:exist:///db/VTLGP/xslt/string.xsl', ())} + {transform:transform($ling-features[@xml:id = $result]//tei:string[@xml:lang eq 'gl']/text(), 'xmldb:exist:///db/VTLGP/xslt/string.xsl', ())}{transform:transform($ling-features[@xml:id = $result]//tei:string[@xml:lang eq 'en']/text(), 'xmldb:exist:///db/VTLGP/xslt/string.xsl', ())}

, +

TestemunhoTestemuñoWitness

, + + { + + let $fen := $readings[some $ana in tokenize(@ana, '\s+') satisfies $ana = concat('#', $result)] + for $wit at $pos in + for $i in distinct-values($fen/tokenize(./@wit, '\s+')) + order by count($fen[./tokenize(@wit, '\s+') = $i]) descending + return + $i + let $count := count($fen[contains(@wit, $wit)]) + let $sum := count($fen) + let $percentage := round-half-to-even((100 * $count div $sum), 2) + order by $count descending + return + + + {' (' || $percentage || '%)'} + Ms. {substring($wit, 2)} + + { + let $hand := $songs[.//tei:rdg[. intersect $fen[contains(@wit, $wit)]]]/tei:head//tei:rdg[@wit = $wit]/@hand + let $distinctHands := distinct-values($hand) + for $h in 1 to count($distinctHands) + let $x := count($songs[tei:head//tei:rdg[@wit = $wit][@hand = $distinctHands[position() lt $h]]] + //tei:rdg[. intersect $fen][contains(@wit, $wit)]) + let $div := $songs[tei:head//tei:rdg[@wit = $wit][@hand = $distinctHands[$h]]][.//tei:rdg[. intersect $fen]] + let $conta := count($div//tei:rdg[. intersect $fen[contains(@wit, $wit)]]) + order by $h descending + return + + + {substring($distinctHands[$h], 2)} + + } + + }, +

PeríodoPeriod

, + + { + + let $fen := $readings[some $ana in tokenize(@ana, '\s+') satisfies $ana = concat('#', $result)] + for $period at $pos in + for $i in distinct-values($poets[@xml:id = $fen/ancestor::tei:div[1]//tei:name/substring(@ref, 2)]/tei:floruit/@period) + order by count($fen[ancestor::tei:div[1]//tei:name/substring(@ref, 2) = $poets/tei:floruit[@period = $i]/../@xml:id]) descending + return + $i + let $count := count($fen[ancestor::tei:div[1]//tei:name/substring(@ref, 2) = $poets/tei:floruit[@period = $period]/../@xml:id]) + let $sum := count($fen) + let $percentage := round-half-to-even((100 * $count div $sum), 2) + order by $count descending + return + + + {' (' || $percentage || '%)'} + Per. {$period} + + }, + + + + + + + + + + + + + + + { + for $fen in $readings[some $ana in tokenize(@ana, '\s+') satisfies $ana = concat('#', $result)] + let $rdg := + + + + + let $author := $poets[@xml:id = $fen/ancestor::tei:div[1]//tei:name/substring(@ref, 2)] + return + + + + + + + + + + + } + +
FenómenoPhenomenon + TestemunhoTestemuñoWitness + LocalizaçãoLocalizaciónLocation + CopistaCopyist + AutorAuthor + PeríodoPeriod + CantigaSong + V.L. +
{transform:transform($fen/.., 'xmldb:exist:///db/VTLGP/xslt/ex.xsl', ($rdg))}{ + (if ($fen/contains(@wit, ' ')) then +
    { + for $wit in tokenize($fen/@wit, '\s+') + order by $wit + return +
  • {substring($wit, 2)}
  • + }
+ else + $fen/substring(@wit, 2) + ) + }
{ + (if (contains($fen/@wit, ' ')) then +
    { + + for $wit in tokenize($fen/@wit, '\s+') + order by $wit + return +
  • {djb:locus($fen/ancestor::tei:div[1]/tei:head//tei:rdg[@wit = $wit]/tei:locus/@from, $fen/ancestor::tei:div[1]/tei:head//tei:rdg[@wit = $wit]/tei:locus/@to) + }
  • + }
+ else + djb:locus($fen/ancestor::tei:div[1]/tei:head//tei:rdg[@wit = $fen/@wit]/tei:locus/@from, $fen/ancestor::tei:div[1]/tei:head//tei:rdg[@wit = $fen/@wit]/tei:locus/@to)) + }
{ + (if (contains($fen/@wit, ' ')) then +
    { + + for $wit in tokenize($fen/@wit, '\s+') + order by $wit + return +
  • {$fen/ancestor::tei:div[1]/tei:head//tei:rdg[@wit = $wit]/substring(@hand, 2)}
  • + }
+ else + $fen/ancestor::tei:div[1]/tei:head//tei:rdg[@wit = $fen/@wit]/substring(@hand, 2)) + }
{$author/tei:persName/string()}{$author/tei:floruit/@from || '-' || $author/tei:floruit/@to || ' (' || $author/tei:floruit/@period || ')'}{$fen/ancestor::tei:div[1]/string-join(descendant::tei:title//tei:idno, ', ')}{$fen/ancestor::tei:l/@n/string()}
) + } +
+ +
diff --git a/XQuery/other-queries/abbreviations.xquery b/XQuery/other-queries/abbreviations.xquery new file mode 100644 index 0000000..e95a1b2 --- /dev/null +++ b/XQuery/other-queries/abbreviations.xquery @@ -0,0 +1,7 @@ +xquery version "3.0"; +declare namespace tei="http://www.tei-c.org/ns/1.0"; +let $songs := collection('/db/VTLGP')//tei:div[@type='poem'] +let $fenomena := doc('/db/VTLGP/feature_library.xml')//tei:fs[@xml:id eq 'vus'] +let $exemplos := $songs//tei:rdg[contains(tei:ex[preceding-sibling::text()[contains(.,'q')]], 'uan')] +for $exemplo in $exemplos +return $exemplo/ancestor::*[name() eq 'div']/@corresp/string() || '-' || $exemplo/@wit \ No newline at end of file diff --git a/XQuery/other-queries/latex-tables-2.xquery b/XQuery/other-queries/latex-tables-2.xquery new file mode 100644 index 0000000..e886909 --- /dev/null +++ b/XQuery/other-queries/latex-tables-2.xquery @@ -0,0 +1,76 @@ +xquery version "3.0"; +declare namespace tei = "http://www.tei-c.org/ns/1.0"; +(: Local function written by David J. Birnbaum (www.obdurodon.org) :) +declare namespace djb = "www.obdurodon.org"; +declare option exist:serialize "method=text media-type=text/plain omit-xml-declaration=yes"; +declare function djb:locus($from as node(), $to as node()) +{ + (if ($from eq $to) + then + $from/string() + else + if (substring($from, 1, string-length($from) - 1) eq substring($to, 1, string-length($to) - 1)) + then + concat($from, '-v') + else + concat($from, '-', $to)) +}; +declare variable $result := request:get-parameter("phenomenon", ("p1i")); +let $songs := collection('/db/VTLGP/edition')//tei:div[@type eq 'poem'] +let $readings := $songs//tei:rdg +let $poets := doc('/db/VTLGP/ancillary/corpus-autores.xml')//tei:person +for $fen in $readings[some $ana in tokenize(@ana, '\s+') + satisfies $ana = concat('#', $result)] +let $rdg := + + + + +let $author := $poets[@xml:id = $fen/ancestor::tei:div[1]//tei:name/substring(@ref, 2)] +let $orderedWit := for $wit in tokenize($fen/@wit, '\s+') +order by $wit +return + $wit +let $wit1 := $orderedWit[1] +let $wit2 := $orderedWit[2] +order by $wit1, + number($fen/ancestor::tei:div[1]/tei:head//tei:rdg[@wit = $wit1]/tei:locus/replace(@from, '[rv]+', '')) +return + + ( + '\uni{' || string-join(transform:transform($fen/.., 'xmldb:exist:///db/VTLGP/xslt/ex.xsl', ($rdg)), '//') || '} & ' || + + (if ($fen/contains(@wit, ' ')) then + substring($wit1, 2) + + else + $fen/substring(@wit, 2)) + || ' & ' || + + (if (contains($fen/@wit, ' ')) then + djb:locus($fen/ancestor::tei:div[1]/tei:head//tei:rdg[@wit = $wit1]/tei:locus/@from, $fen/ancestor::tei:div[1]/tei:head//tei:rdg[@wit = $wit1]/tei:locus/@to) + else + djb:locus($fen/ancestor::tei:div[1]/tei:head//tei:rdg[@wit = $fen/@wit]/tei:locus/@from, $fen/ancestor::tei:div[1]/tei:head//tei:rdg[@wit = $fen/@wit]/tei:locus/@to)) || ' & ' || + + (if (contains($fen/@wit, ' ')) then + + $fen/ancestor::tei:div[1]/tei:head//tei:rdg[@wit = $wit1]/substring(@hand, 2) + else + $fen/ancestor::tei:div[1]/tei:head//tei:rdg[@wit = $fen/@wit]/substring(@hand, 2)) || ' &' || + $author/tei:persName/string() || ' & ' || +(: $author/tei:floruit/@period || ' & ' || :) + + $fen/ancestor::tei:div[1]/string-join(descendant::tei:title//tei:idno, ', ') || ' & ' || + $fen/ancestor::tei:l/@n/string() || + (if (contains($fen/@wit, ' ')) then + ' \\ \cline{2-4} &' || substring($wit2, 2) || ' & ' || + djb:locus($fen/ancestor::tei:div[1]/tei:head//tei:rdg[@wit = $wit2]/tei:locus/@from, $fen/ancestor::tei:div[1]/tei:head//tei:rdg[@wit = $wit2]/tei:locus/@to) || ' & ' || $fen/ancestor::tei:div[1]/tei:head//tei:rdg[@wit = $wit2]/substring(@hand, 2) || + ' & & & \\ \hline ' + else + ' \\ \hline ' + ) + ) \ No newline at end of file diff --git a/XQuery/other-queries/latex-tables.xquery b/XQuery/other-queries/latex-tables.xquery new file mode 100644 index 0000000..e886909 --- /dev/null +++ b/XQuery/other-queries/latex-tables.xquery @@ -0,0 +1,76 @@ +xquery version "3.0"; +declare namespace tei = "http://www.tei-c.org/ns/1.0"; +(: Local function written by David J. Birnbaum (www.obdurodon.org) :) +declare namespace djb = "www.obdurodon.org"; +declare option exist:serialize "method=text media-type=text/plain omit-xml-declaration=yes"; +declare function djb:locus($from as node(), $to as node()) +{ + (if ($from eq $to) + then + $from/string() + else + if (substring($from, 1, string-length($from) - 1) eq substring($to, 1, string-length($to) - 1)) + then + concat($from, '-v') + else + concat($from, '-', $to)) +}; +declare variable $result := request:get-parameter("phenomenon", ("p1i")); +let $songs := collection('/db/VTLGP/edition')//tei:div[@type eq 'poem'] +let $readings := $songs//tei:rdg +let $poets := doc('/db/VTLGP/ancillary/corpus-autores.xml')//tei:person +for $fen in $readings[some $ana in tokenize(@ana, '\s+') + satisfies $ana = concat('#', $result)] +let $rdg := + + + + +let $author := $poets[@xml:id = $fen/ancestor::tei:div[1]//tei:name/substring(@ref, 2)] +let $orderedWit := for $wit in tokenize($fen/@wit, '\s+') +order by $wit +return + $wit +let $wit1 := $orderedWit[1] +let $wit2 := $orderedWit[2] +order by $wit1, + number($fen/ancestor::tei:div[1]/tei:head//tei:rdg[@wit = $wit1]/tei:locus/replace(@from, '[rv]+', '')) +return + + ( + '\uni{' || string-join(transform:transform($fen/.., 'xmldb:exist:///db/VTLGP/xslt/ex.xsl', ($rdg)), '//') || '} & ' || + + (if ($fen/contains(@wit, ' ')) then + substring($wit1, 2) + + else + $fen/substring(@wit, 2)) + || ' & ' || + + (if (contains($fen/@wit, ' ')) then + djb:locus($fen/ancestor::tei:div[1]/tei:head//tei:rdg[@wit = $wit1]/tei:locus/@from, $fen/ancestor::tei:div[1]/tei:head//tei:rdg[@wit = $wit1]/tei:locus/@to) + else + djb:locus($fen/ancestor::tei:div[1]/tei:head//tei:rdg[@wit = $fen/@wit]/tei:locus/@from, $fen/ancestor::tei:div[1]/tei:head//tei:rdg[@wit = $fen/@wit]/tei:locus/@to)) || ' & ' || + + (if (contains($fen/@wit, ' ')) then + + $fen/ancestor::tei:div[1]/tei:head//tei:rdg[@wit = $wit1]/substring(@hand, 2) + else + $fen/ancestor::tei:div[1]/tei:head//tei:rdg[@wit = $fen/@wit]/substring(@hand, 2)) || ' &' || + $author/tei:persName/string() || ' & ' || +(: $author/tei:floruit/@period || ' & ' || :) + + $fen/ancestor::tei:div[1]/string-join(descendant::tei:title//tei:idno, ', ') || ' & ' || + $fen/ancestor::tei:l/@n/string() || + (if (contains($fen/@wit, ' ')) then + ' \\ \cline{2-4} &' || substring($wit2, 2) || ' & ' || + djb:locus($fen/ancestor::tei:div[1]/tei:head//tei:rdg[@wit = $wit2]/tei:locus/@from, $fen/ancestor::tei:div[1]/tei:head//tei:rdg[@wit = $wit2]/tei:locus/@to) || ' & ' || $fen/ancestor::tei:div[1]/tei:head//tei:rdg[@wit = $wit2]/substring(@hand, 2) || + ' & & & \\ \hline ' + else + ' \\ \hline ' + ) + ) \ No newline at end of file diff --git a/XQuery/other-queries/line-counting.xquery b/XQuery/other-queries/line-counting.xquery new file mode 100644 index 0000000..6b724dc --- /dev/null +++ b/XQuery/other-queries/line-counting.xquery @@ -0,0 +1,27 @@ +xquery version "3.0"; +declare namespace tei="http://www.tei-c.org/ns/1.0"; +declare option exist:serialize "method=html5 media-type=text/html omit-xml-declaration=yes indent=yes"; +let $transcriptions := collection('/db/tese/drafts/temporary') +let $done := collection('/db/tese/drafts/songs')//tei:div//@corresp +let $A := $transcriptions//div[@wit="#A"][@corresp != $done] +let $B := $transcriptions//div[@wit="#B"][@corresp != $done] +let $V := $transcriptions//div[@wit eq '#V'][@corresp != $done] +return + + + Line counts + + +
    { + for $b in $B[@corresp = $A/@corresp] + let $corresp := $b/@corresp + let $a := $A[@corresp eq $corresp] + let $v := $V[@corresp eq $corresp] + let $b-count := count($b/l) + let $a-count := count($a/l) + let $v-count:= count($v/l) + where count(distinct-values(($a-count, $b-count, if ($v) then $v-count else ()))) ne 1 + return
  • {substring($corresp, 2) || ': A ' || $a-count || '; B ' || $b-count || (if ($v-count gt 0) then ('; V ' || $v-count) else ())||' ('|| substring-after(base-uri($b), 'temporary/')||' ' || substring-after(base-uri($a), 'temporary/') || ')' }
  • + }
+ + \ No newline at end of file diff --git a/XQuery/other-queries/me-status.xquery b/XQuery/other-queries/me-status.xquery new file mode 100644 index 0000000..9350365 --- /dev/null +++ b/XQuery/other-queries/me-status.xquery @@ -0,0 +1,24 @@ +xquery version "3.0"; +declare namespace tei = "http://www.tei-c.org/ns/1.0"; +declare option exist:serialize "method=text media-type=text/plain omit-xml-declaration=yes"; +let $songs := collection('/db/VTLGP/edition')//tei:div[@type eq 'poem'] +let $me-apps := $songs//tei:rdg[not(contains(@ana, 'dat'))][matches(., '[^\w][mM]e[^\w]') or (tei:supplied[preceding-sibling::node()[1][matches(., '[^\w][mM]$')]]) or (matches(., '[^\w][mM]e$')) or (matches(., '^[mM]e$')) or (matches(., '^[mM]e[^\w]'))]/parent::tei:app[not(tei:rdg[contains(@ana, 'dat')])] +for $me in $me-apps +order by number($me/ancestor::tei:div[1]/replace(substring-before(@corresp, 'B'), '#A', '')) +return + '\uni{' || transform:transform($me, 'xmldb:exist:///db/VTLGP/xslt/me.xsl', ()) || '} & ' || + + (if ($me[count(tei:rdg[not(contains(@ana, 'dat'))][matches(., '[^\w][mM]e[^\w]') or (tei:supplied[preceding-sibling::node()[1] + [matches(., '[^\w][mM]$')]]) or (matches(., '[^\w][mM]e$')) or (matches(., '^[mM]e$')) or (matches(., '^[mM]e[^\w]'))]) gt 1]) + then + let $witnesses:= for $rdg in $me/tei:rdg[not(contains(@ana, 'dat'))][matches(., '[^\w][mM]e[^\w]') or (tei:supplied[preceding-sibling::node()[1] + [matches(., '[^\w][mM]$')]]) or (matches(., '[^\w][mM]e$')) or (matches(., '^[mM]e$')) or (matches(., '^[mM]e[^\w]'))] return $rdg/replace(replace(@wit, '#', ''), ' ', ', ') + return + string-join($witnesses, ' / ') + + else + $me/tei:rdg[not(contains(@ana, 'dat'))][matches(., '[^\w][mM]e[^\w]') or (tei:supplied[preceding-sibling::node()[1] + [matches(., '[^\w][mM]$')]]) or (matches(., '[^\w][mM]e$')) or (matches(., '^[mM]e$')) or (matches(., '^[mM]e[^\w]'))]/replace(replace(@wit, '#', ''), ' ', ', ') + ) + || ' & ' || $me/ancestor::tei:div[1]/string-join(descendant::tei:title//tei:idno, ', ') || ' & ' || + $me/ancestor::tei:l/@n/string() || ' \\ \hline ' \ No newline at end of file diff --git a/XQuery/other-queries/mi-status.xquery b/XQuery/other-queries/mi-status.xquery new file mode 100644 index 0000000..a5229aa --- /dev/null +++ b/XQuery/other-queries/mi-status.xquery @@ -0,0 +1,27 @@ +xquery version "3.0"; +declare namespace tei = "http://www.tei-c.org/ns/1.0"; +declare option exist:serialize "method=text media-type=text/plain omit-xml-declaration=yes"; +let $songs := collection('/db/VTLGP/edition')//tei:div[@type eq 'poem'] +let $type := 'strong' +let $tp := + + + +let $hits := $songs//tei:app[tei:rdg[@select eq $type]] +for $wk in $hits +order by number($wk/ancestor::tei:div[1]/replace(substring-before(@corresp, 'B'), '#A', '')) +return + '\uni{' || transform:transform($wk, 'xmldb:exist:///db/VTLGP/xslt/select.xsl', ($tp)) || '} & ' || + + (if ($wk[count(tei:rdg[@select eq $type]) gt 1]) + then + let $witnesses:= for $rdg in $wk/tei:rdg[@select = $type] return $rdg/replace(replace(@wit, '#', ''), ' ', ', ') + return + string-join($witnesses, ' / ') + + else + $wk/tei:rdg[@select eq $type]/replace(replace(@wit, '#', ''), ' ', ', ') + ) + || ' & ' || $wk/ancestor::tei:div[1]/string-join(descendant::tei:title//tei:idno, ', ') || ' & ' || + $wk/ancestor::tei:l/@n/string() || ' \\ \hline ' + diff --git a/XQuery/tabular.xquery b/XQuery/tabular.xquery new file mode 100644 index 0000000..5fbe295 --- /dev/null +++ b/XQuery/tabular.xquery @@ -0,0 +1,62 @@ +xquery version "3.0"; +declare namespace tei = "http://www.tei-c.org/ns/1.0"; +(: Local function written by David J. Birnbaum (djbpitt@gmail.com) :) +declare namespace djb = "www.obdurodon.org"; +declare option exist:serialize "method=xhtml media-type=application/xhtml+html indent=no"; +declare function djb:locus($from as node()?, $to as node()?) +{ + (if ($from eq $to) + then + $from/string() + else + if (substring($from, 1, string-length($from) - 1) eq substring($to, 1, string-length($to) - 1)) + then + concat($from, '-v') + else + concat($from, '-', $to)) +}; +declare variable $selection := request:get-parameter("song", 'A82B186b'); +declare variable $cantigas := collection('/db/VTLGP/edition')//tei:div[@type eq 'poem']; +declare variable $song := $cantigas[substring(@corresp, 2) = $selection]; +declare variable $author := doc('/db/VTLGP/ancillary/corpus-autores.xml')//tei:person[string(@xml:id) = $song//tei:name[@role eq 'author']/substring(@ref, 2)]; + +(, +
+ { + for $line in $song//tei:l + return + (

{$line/@n/string()}.

, + { + for $witness in $song/tei:head/descendant::tei:rdg + let $parameter := + + + + return + {transform:transform($line[ancestor::tei:div/tei:head/descendant::tei:rdg/@wit = $witness/@wit], doc('/db/VTLGP/xslt/table.xsl'), $parameter)} + + }
) + + }
) +