Skip to content

Commit

Permalink
ajout de la clef pour l’édition 'edition' pour le renvoi au texte édi…
Browse files Browse the repository at this point in the history
…té #1795
  • Loading branch information
emchateau committed Jan 31, 2022
1 parent 49e8d76 commit 6c2bc9f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
3 changes: 2 additions & 1 deletion models/tei.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -714,12 +714,13 @@ declare function getBibliographicalManifestation($queryParams) {
'tei' : $bibliographicalManifestation,
'editeur' : $bibliographicalManifestation/tei:monogr/tei:imprint/tei:publisher,
'lieu' : $bibliographicalManifestation/tei:monogr/tei:imprint/tei:pubPlace,
'extent' : fn:normalize-space($bibliographicalManifestation/tei:monogr/tei:extent),
'extent' : $bibliographicalManifestation/tei:monogr/tei:extent ! fn:normalize-space(.) => fn:string-join('. '),
'idno' : array{
for $idno in $bibliographicalManifestation/tei:idno[@type='catBnf']
return map { 'type' : 'catBnf', 'url' : $idno}
},
'notes' : array{$bibliographicalManifestation/tei:note},
'edition' : getEdition($bibliographicalManifestation),
'uuid' : $uuid,
'path' : '/bibliography/manifestations/',
'url' : $gdp.globals:root || '/bibliography/manifestations/' || $uuid
Expand Down
18 changes: 18 additions & 0 deletions models/teiBuilder.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,24 @@ declare function getBiblTitles($content as element()*, $lang as xs:string){
', ')
};

(:~
: this function get edition from manifestation
:
: @param $content manifestation
: @param $lang iso langcode starts
: @return a string
:)
declare function getEdition($content as element()*) as map(*)? {
let $text := db:open('gdp')/tei:teiCorpus/tei:teiCorpus/tei:TEI[tei:teiHeader/tei:fileDesc/tei:sourceDesc/tei:bibl/@copyOf = '#' || $content/@xml:id]
let $uuid := $text/tei:teiHeader/tei:fileDesc/tei:sourceDesc/@xml:id
return if ($uuid) then map {
'uuid' : $uuid,
'title' : getTitles($text, 'fr'),
'path' : '/texts/',
'url' : $gdp.globals:root || '/texts/' || $uuid
}
};

(:~
: this function get description
:
Expand Down

0 comments on commit 6c2bc9f

Please sign in to comment.