diff --git a/src/about/ui/__snapshots__/about.test.tsx.snap b/src/about/ui/__snapshots__/about.test.tsx.snap index 608f40eb3..2321b0e82 100644 --- a/src/about/ui/__snapshots__/about.test.tsx.snap +++ b/src/about/ui/__snapshots__/about.test.tsx.snap @@ -144,11 +144,12 @@ exports[`Snapshot 1`] = ` role="tabpanel" >
- - Ohne feste kritische Grundlage wird das philologische Gebäude auf Sand aufgeführt und die philologische Wissenschaft gestaltet sich zum bloßen Dilettantismus. - -

- +

+ + Ohne feste kritische Grundlage wird das philologische Gebäude auf Sand aufgeführt und die philologische Wissenschaft gestaltet sich zum bloßen Dilettantismus. + +

+

W. Freund, . Leipzig, 1874. - +

-

- - The eBL editions aim to present the best text that can be reconstructed at present. The editions prepared in the course of the project include all previous scholarship on the texts, and in particular all new manuscripts identified after the last printed editions. The eBL edition of the +

+ The eBL editions aim to present the best text that can be reconstructed at present. The editions prepared in the course of the project include all previous scholarship on the texts, and in particular all new manuscripts identified after the last printed editions. The eBL edition of the - Cuthaean Legend of Narām-Sîn + Cuthaean Legend of Narām-Sîn - , for instance, almost doubles the manuscript basis of the text available to its last editor; that of the + , for instance, almost doubles the manuscript basis of the text available to its last editor; that of the @@ -178,17 +178,16 @@ exports[`Snapshot 1`] = ` Counsels of Wisdom - includes over twenty new manuscripts that were absent from the most recent printed edition. Most of the new manuscripts used have been identified by the eBL team, and are currently being published in the series of articles + includes over twenty new manuscripts that were absent from the most recent printed edition. Most of the new manuscripts used have been identified by the eBL team, and are currently being published in the series of articles From the Electronic Babylonian Literature Lab - that appear in the journal + that appear in the journal Kaskal - . Moreover, the eBL editions are constantly updated, and the editors will incorporate new discoveries as they appear. - - + . Moreover, the eBL editions are constantly updated, and the editors will incorporate new discoveries as they appear. +

I. Corpus

@@ -264,12 +263,12 @@ exports[`Snapshot 1`] = ` 1, 20 n. 2), that seems to resume the content of the preceding chapter. About one half or even two thirds of the composition is missing. This is underlined by the colophon, that takes almost all of the space on the reverse but in many other cases covers only about a third and occasionally half of a tablet. The tablet stems from the 27. campaign in Uruk 1969 of the residential area U XVIII and was published first by Hunger 1976 in SpTU 1, 2.

- +

Additional translations have been produced by A. R. George ( Gilgameš - ), W. G. Lambert ( + ), W. G. Lambert ( @@ -279,13 +278,13 @@ exports[`Snapshot 1`] = ` - Marduk’s Address to the Demons + Marduk’s Address to the Demons ), T. Mitto ( - Catalogue of Texts and Authors + Catalogue of Texts and Authors and Hymn to Ninurta as Savior - ) and E. Jiménez. - -

- - In addition, a series of translations into Arabic are in preparation by A. A. Fadhil, W. Khatabe, and W. Zerkly (see for now A. A. Fadhil’s Arabic translation of + ) and E. Jiménez. +

+

+ In addition, a series of translations into Arabic are in preparation by A. A. Fadhil, W. Khatabe, and W. Zerkly (see for now A. A. Fadhil’s Arabic translation of @@ -307,13 +305,13 @@ exports[`Snapshot 1`] = ` I ) - +

III. Ideal Text

- - The main version displayed on the eBL Corpus is a phonetic transcription of the text, which has been adjusted according to the rules of Standard Babylonian grammar. This practice somewhat departs from the Assyriological tradition of editing “eclectic” texts, i.e. transliterations that combine the readings of various manuscripts. It has been adopted, however, in the conviction that Mesopotamian texts are also objects of art, and not just objects of scientific study, and as such convey their message only through the interplay of form and content. - +

+ The main version displayed on the eBL Corpus is a phonetic transcription of the text, which has been adjusted according to the rules of Standard Babylonian grammar. This practice somewhat departs from the Assyriological tradition of editing “eclectic” texts, i.e. transliterations that combine the readings of various manuscripts. It has been adopted, however, in the conviction that Mesopotamian texts are also objects of art, and not just objects of scientific study, and as such convey their message only through the interplay of form and content. +

@@ -337,9 +335,8 @@ exports[`Snapshot 1`] = `
-

- - The practice of using a phonetic transcription as the main text no doubt has disadvantages: for instance, it obscures the way in which the text is written in cuneiform, and it affords a sense of grammatical certainty that is absent from a regular transliteration. However, it also offers considerable advantages: in particular, it does not require the editor to adopt any particular spelling when no good criteria exist for preferring one over the other. In +

+ The practice of using a phonetic transcription as the main text no doubt has disadvantages: for instance, it obscures the way in which the text is written in cuneiform, and it affords a sense of grammatical certainty that is absent from a regular transliteration. However, it also offers considerable advantages: in particular, it does not require the editor to adopt any particular spelling when no good criteria exist for preferring one over the other. In Enūma eliš @@ -349,19 +346,18 @@ exports[`Snapshot 1`] = ` > I 49 - (see the adjoining image), for instance, the editor would have to choose between the accusative + (see the adjoining image), for instance, the editor would have to choose between the accusative al-ka-ta - , attested only in Assyrian manuscripts, or the normal Babylonian spelling + , attested only in Assyrian manuscripts, or the normal Babylonian spelling al-ka-tu - ₄. In a transcription the editor can convey his interpretation of the text in a much more satisfactory manner than in a traditional transliteration. - -

- - The transcription respects the ways in which the manuscripts are written as much as possible. For instance, + ₄. In a transcription the editor can convey his interpretation of the text in a much more satisfactory manner than in a traditional transliteration. +

+

+ The transcription respects the ways in which the manuscripts are written as much as possible. For instance, Enūma eliš @@ -371,11 +367,11 @@ exports[`Snapshot 1`] = ` > VI 124 - is transcribed as + is transcribed as muṭaḫḫidu urîšun - , “who enriches their stables,” and thus assumes a hymno-epic ending - + , “who enriches their stables,” and thus assumes a hymno-epic ending - u @@ -383,7 +379,7 @@ exports[`Snapshot 1`] = ` nomen regens - , instead of the normal bound form + , instead of the normal bound form muṭaḫḫid @@ -392,7 +388,7 @@ exports[`Snapshot 1`] = ` mu-ṭaḫ-ḫi-du is the spelling of all manuscripts. - +

IV. Score Edition

@@ -419,65 +415,62 @@ exports[`Snapshot 1`] = ` - - Since the number of manuscripts of each text is constantly growing, cuneiform studies is reaching the point where it is no longer possible to print text editions in the score format. Just the eBL edition score of +

+ Since the number of manuscripts of each text is constantly growing, cuneiform studies is reaching the point where it is no longer possible to print text editions in the score format. Just the eBL edition score of Enūma eliš - , for example, would require some 300 pages in font size 10. Despite this technical limitation, scores are the fastest, most straightforward way of checking exactly how manuscripts write their texts. The eBL scores are, moreover, aligned with the ideal line, so that the reader can check the manuscript basis of the editor’s decisions at any time. - -

- - All transliterations have been checked twice against the published copies and against photographs and in some cases the originals of the cuneiform tablets. - + , for example, would require some 300 pages in font size 10. Despite this technical limitation, scores are the fastest, most straightforward way of checking exactly how manuscripts write their texts. The eBL scores are, moreover, aligned with the ideal line, so that the reader can check the manuscript basis of the editor’s decisions at any time. +

+

+ All transliterations have been checked twice against the published copies and against photographs and in some cases the originals of the cuneiform tablets. +

V. Paratextual information

- - Each text is furnished with an introduction, which discusses the content and structure of the text, its origins and transmission, its Sitz im Leben and the history of research concerning the text. - -

- - The editions are fully lemmatized and annotated. The annotation includes indications of all parallel lines, so that the text can be studied as part of the intertextual network in which it belongs. In addition, the notes on individual lines endeavor to provide the reader with references to all previous bibliography, with particular emphasis on studies which have appeared in the last few years. The notes on the score edition discuss mostly philological issues pertaining to an individual manuscript. - -

- - The colophons of the individual manuscripts are transliterated independently, and can be accessed on the homepage of any text (e.g. +

+ Each text is furnished with an introduction, which discusses the content and structure of the text, its origins and transmission, its Sitz im Leben and the history of research concerning the text. +

+

+ The editions are fully lemmatized and annotated. The annotation includes indications of all parallel lines, so that the text can be studied as part of the intertextual network in which it belongs. In addition, the notes on individual lines endeavor to provide the reader with references to all previous bibliography, with particular emphasis on studies which have appeared in the last few years. The notes on the score edition discuss mostly philological issues pertaining to an individual manuscript. +

+

+ The colophons of the individual manuscripts are transliterated independently, and can be accessed on the homepage of any text (e.g. here - ). In some cases, manuscripts include lines that, though clearly part of the composition in question, cannot yet be placed in it, and thus are transliterated independently, as Unplaced lines. - + ). In some cases, manuscripts include lines that, though clearly part of the composition in question, cannot yet be placed in it, and thus are transliterated independently, as Unplaced lines. +

VI. Šumma ālu

- +

The editions of Šumma ālu - presented here were prepared in the context of the projects “Edition of the Omen Series Šumma Alu” (2017–2021; + presented here were prepared in the context of the projects “Edition of the Omen Series Šumma Alu” (2017–2021; http://p3.snf.ch/project-175970 - ) and “Typology and potential of the excerpt tablets of Šumma alu” (2022–2023; + ) and “Typology and potential of the excerpt tablets of Šumma alu” (2022–2023; http://p3.snf.ch/project-205122 - ), both directed by Prof. Catherine Mittermayer at the University of Geneva and funded by the Swiss National Science Foundation. The complete score editions can be downloaded (PDF) at the “Archive ouverte” of the University of Geneva ( + ), both directed by Prof. Catherine Mittermayer at the University of Geneva and funded by the Swiss National Science Foundation. The complete score editions can be downloaded (PDF) at the “Archive ouverte” of the University of Geneva ( https://archive-ouverte.unige.ch/ - ; search for “Shumma alu”). - + ; search for “Shumma alu”). +

diff --git a/src/about/ui/about.sass b/src/about/ui/about.sass index d0eaa30a1..aba58d594 100644 --- a/src/about/ui/about.sass +++ b/src/about/ui/about.sass @@ -10,13 +10,14 @@ [id^="about-tabpane-"] h3 padding-top: 10px + clear: left [id^="about-tabpane-"] h4 padding-top: 10px [id^="about-tabpane-"] blockquote padding-left: 40% - + [id^="about-tabpane-"] .Introduction &__200px @@ -30,15 +31,15 @@ &__300px width: 300px height: auto - + &__350px width: 350px height: auto - + &__400px width: 400px height: auto - + &__450px width: 450px height: auto @@ -64,7 +65,7 @@ &__creativeCommonsLicense text-align: center - + &__fossey float: right width: 300px @@ -93,4 +94,3 @@ &__secondLineOfParallelism padding-left: 1em - diff --git a/src/about/ui/about.tsx b/src/about/ui/about.tsx index 49b4577f6..041e62290 100644 --- a/src/about/ui/about.tsx +++ b/src/about/ui/about.tsx @@ -64,7 +64,7 @@ export default function About({ {AboutCorpus(markupService)} - {AboutSigns(markupService)} + {AboutSigns()} {AboutDictionary(markupService)} diff --git a/src/about/ui/bibliography.tsx b/src/about/ui/bibliography.tsx index a0be09685..5897dd668 100644 --- a/src/about/ui/bibliography.tsx +++ b/src/about/ui/bibliography.tsx @@ -1,32 +1,31 @@ import React from 'react' -import { Markdown } from 'common/Markdown' +import { MarkdownParagraph } from 'common/Markdown' import Markup from 'markup/ui/markup' import MarkupService from 'markup/application/MarkupService' import afoRegisterCover from 'about/ui/static/afoRegister.png' -export default function AboutProject( +export default function AboutBibliography( markupService: MarkupService ): JSX.Element { return ( <>

I. Bibliography

- -

-

II. AfO-Register

- -

- -

-

C

D

E

F

G

H

J

K

L

M

N

P

R

S

T

@@ -177,12 +298,18 @@ export default function AboutProject(

V

W

Z

diff --git a/src/about/ui/corpus.tsx b/src/about/ui/corpus.tsx index 036aba856..711caf8a8 100644 --- a/src/about/ui/corpus.tsx +++ b/src/about/ui/corpus.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { Markdown } from 'common/Markdown' +import { MarkdownParagraph } from 'common/Markdown' import Markup from 'markup/ui/markup' import MarkupService from 'markup/application/MarkupService' @@ -9,26 +9,43 @@ import geneva from 'about/ui/static/geneva.jpg' import muses from 'about/ui/static/muses.jpg' import snf from 'about/ui/static/snf.jpg' -export default function AboutProject( - markupService: MarkupService -): JSX.Element { +export default function AboutCorpus(markupService: MarkupService): JSX.Element { return ( <>
- - Ohne feste kritische Grundlage wird das philologische Gebäude auf Sand - aufgeführt und die philologische Wissenschaft gestaltet sich zum - bloßen Dilettantismus. - -

- +

+ + Ohne feste kritische Grundlage wird das philologische Gebäude auf + Sand aufgeführt und die philologische Wissenschaft gestaltet sich + zum bloßen Dilettantismus. + +

+ +
-

- {' '} +

I. Corpus

II. Translations

@@ -45,13 +62,36 @@ export default function AboutProject(
+ + + - -

-

III. Ideal Text

- +
I 49
-

- -

- + +

IV. Score Edition

134
- -

- + +

V. Paratextual information

- -

- -

- + + +

VI. Šumma ālu

- +
Université de Genève diff --git a/src/about/ui/dictionary.tsx b/src/about/ui/dictionary.tsx index 5afaeb692..781afcea0 100644 --- a/src/about/ui/dictionary.tsx +++ b/src/about/ui/dictionary.tsx @@ -30,29 +30,80 @@ export default function AboutDictionary( Black, George, Postgate, A Concise Dictionary of Akkadian
- +

- +

II. Akkadian-Arabic Reference Dictionary

III. Akkadische Logogramme

- +

IV. Akkadische Glossare und Indizes (AfO-Register)

- +

- +

V. Supplement to the Akkadian Dictionaries

- + ) } diff --git a/src/about/ui/fragmentarium.tsx b/src/about/ui/fragmentarium.tsx index de1acea22..35564ad31 100644 --- a/src/about/ui/fragmentarium.tsx +++ b/src/about/ui/fragmentarium.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { Markdown } from 'common/Markdown' +import { Markdown, MarkdownParagraph } from 'common/Markdown' import Markup from 'markup/ui/markup' import MarkupService from 'markup/application/MarkupService' @@ -21,44 +21,72 @@ import smithdt1 from 'about/ui/static/smithdt1.jpg' import strassmaier from 'about/ui/static/strassmaier.jpg' import strassmaiercopies from 'about/ui/static/strassmaiercopies.jpg' -export default function AboutProject( +export default function AboutFragmentarium( markupService: MarkupService ): JSX.Element { + function MarkupParagraph({ text }: { text: string }): JSX.Element { + return ( +

+ +

+ ) + } + return ( <> - -

{' '} - +

I. How to Cite

- -

- - + +

{' '} {new Date().toLocaleDateString() + ''}{' '} - - +

II. Sources of the Catalogue

- -

- -

- + +

+ The list of joins has been compiled on the basis of the catalogue of the + British Museum, kindly made available by J. Taylor. This catalogue has + been supplemented by several join books of the British Museum (currently + the join books covering September 1983 to August 1987 and April 1999 to + March 2019 have been integrated into the database). In addition, a list + of joins of tablets in the Penn Museum as been compiled by J. Peterson + on behalf of the eBL project. +

+

+ These initial sources have been thoroughly corrected and supplemented by + the eBL project’s staff. +

III. Photographs

- The photographs of tablets from The British Museum’s Kuyunjik collection - were produced in 2009-2013, as part of the on-going “Ashurbanipal Library - Project” (2002–present), thanks to funding provided by The Townley Group - and The Andrew Mellon Foundation. The photographs were produced by Marieka - Arksey, Kristin A. Phelps, Sarah Readings, and Ana Tam; with the - assistance of Alberto Giannese, Gina Konstantopoulos, Chiara Salvador, and - Mathilde Touillon-Ricci. They are displayed on the eBL website courtesy of - Dr. Jon Taylor, director of the “Ashurbanipal Library Project.” -

-

- I. Kerslake in the British Museum -
- I. Kerslake photographs tablets in the British Museum, 2019 -
-
- The photographs of the The British Museum’s Babylon collection are taken - by Alberto Giannese and Ivor Kerslake (2019–present) in the framework of - the “electronic Babylonian Literature” project, funded by a Sofia - Kovalevskaja Award (Alexander von Humboldt Stiftung). -

- The photographs of the tablets in the Iraq Museum have been produced by - Anmar A. Fadhil (University of Baghdad – eBL Project), and displayed by - permission of the State Board of Antiquities and Heritage and The Iraq - Museum. -

- The photographs of the tablets in the Yale Babylonian Collection are being - produced by Klaus Wagensonner (Yale University), and used with the kind - permission of the Agnete W. Lassen (Associate Curator of the Yale - Babylonian Collection, Yale Peabody Museum). -

- The images cannot be reproduced without the explicit consent of the - funding projects and institutions, as well as the institutions in which - the cuneiform tablets are kept. Users are referred to the conditions for - reproducing the images in the links shown in the captions under the - images. -

+

+ The photographs of tablets from The British Museum’s Kuyunjik collection + were produced in 2009-2013, as part of the on-going “Ashurbanipal + Library Project” (2002–present), thanks to funding provided by The + Townley Group and The Andrew Mellon Foundation. The photographs were + produced by Marieka Arksey, Kristin A. Phelps, Sarah Readings, and Ana + Tam; with the assistance of Alberto Giannese, Gina Konstantopoulos, + Chiara Salvador, and Mathilde Touillon-Ricci. They are displayed on the + eBL website courtesy of Dr. Jon Taylor, director of the “Ashurbanipal + Library Project.” +

+

+

+ I. Kerslake in the British Museum +
+ I. Kerslake photographs tablets in the British Museum, 2019 +
+
+ The photographs of the The British Museum’s Babylon collection are taken + by Alberto Giannese and Ivor Kerslake (2019–present) in the framework of + the “electronic Babylonian Literature” project, funded by a Sofia + Kovalevskaja Award (Alexander von Humboldt Stiftung). +

+

+ The photographs of the tablets in the Iraq Museum have been produced by + Anmar A. Fadhil (University of Baghdad – eBL Project), and displayed by + permission of the State Board of Antiquities and Heritage and The Iraq + Museum. +

+

+ The photographs of the tablets in the Yale Babylonian Collection are + being produced by Klaus Wagensonner (Yale University), and used with the + kind permission of the Agnete W. Lassen (Associate Curator of the Yale + Babylonian Collection, Yale Peabody Museum). +

+

+ The images cannot be reproduced without the explicit consent of the + funding projects and institutions, as well as the institutions in which + the cuneiform tablets are kept. Users are referred to the conditions for + reproducing the images in the links shown in the captions under the + images. +

IV. Editions in the Fragmentarium

-
- List of fragments to revise -
- List of texts to revise, eBL team -
-
- The editions in the Fragmentarium have been produced by the entire eBL - Team, starting in 2018. Thousands of them were produced on the basis of - photographs and have not been collated in the museum. Although the speed - at which fragments have been transliterated has been necessarily fast, the - quality control measurements adopted, and in particular the policy to have - each edition revised by a scholar different from the original editor, - means that they are normally reliable. Each member of the team has - produced some 40 editions and revised some 60 editions a month on average. -

- In addition, the{' '} - - BabMed team - {' '} - has kindly made acessible its large collections of transliterations of - Mesopotamian medicine for their use on the Fragmentarium. They have been - imported by the eBL team using the importer developed by T. Englmeier (see{' '} - - here - {' '} - and{' '} - - here - - ), and thoroughly revised and lemmatized chiefly by H. Stadhouders. The - transliterations of the BabMed team were originally produced by Markham J. - Geller, J. Cale Johnson, Ulrike Steinert, Stravil V. Panayotov, Eric - Schmidtchen, Krisztián Simkó, Marius Hoppe, Marie Lorenz, John - Schlesinger, Till Kappus, and Agnes Kloocke (at FU Berlin), as well as - Annie Attia, Sona Eypper, and Henry Stadhouders (as external - collaborators). -

+

+

+ List of fragments to revise +
+ List of texts to revise, eBL team +
+
+ The editions in the Fragmentarium have been produced by the entire eBL + Team, starting in 2018. Thousands of them were produced on the basis of + photographs and have not been collated in the museum. Although the speed + at which fragments have been transliterated has been necessarily fast, + the quality control measurements adopted, and in particular the policy + to have each edition revised by a scholar different from the original + editor, means that they are normally reliable. Each member of the team + has produced some 40 editions and revised some 60 editions a month on + average. +

+

+ In addition, the{' '} + + BabMed team + {' '} + has kindly made acessible its large collections of transliterations of + Mesopotamian medicine for their use on the Fragmentarium. They have been + imported by the eBL team using the importer developed by T. Englmeier + (see{' '} + + here + {' '} + and{' '} + + here + + ), and thoroughly revised and lemmatized chiefly by H. Stadhouders. The + transliterations of the BabMed team were originally produced by Markham + J. Geller, J. Cale Johnson, Ulrike Steinert, Stravil V. Panayotov, Eric + Schmidtchen, Krisztián Simkó, Marius Hoppe, Marie Lorenz, John + Schlesinger, Till Kappus, and Agnes Kloocke (at FU Berlin), as well as + Annie Attia, Sona Eypper, and Henry Stadhouders (as external + collaborators). +

V. Folios

- The electronic Babylonian Literature (eBL) project, and in particular its - Fragmentarium, continues the efforts of generations of Assyriologists to - rescue the literature of Ancient Mesopotamia from the hands of oblivion. - The Fragmentarium stands on the shoulders of previous scholars, and has - used extensively their unpublished, unfinished work, for compiling its - database of transliterations. It is a pleasure to acknowledge our - gratitude to the following scholars: +

+ The electronic Babylonian Literature (eBL) project, and in particular + its Fragmentarium, continues the efforts of generations of + Assyriologists to rescue the literature of Ancient Mesopotamia from the + hands of oblivion. The Fragmentarium stands on the shoulders of previous + scholars, and has used extensively their unpublished, unfinished work, + for compiling its database of transliterations. It is a pleasure to + acknowledge our gratitude to the following scholars: +

V.1. George Smith (26 March 1840 – 19 August 1876)

-
- +

+ In one of his last diaries, dated August 1876, George Smith states: “I + intended to work it out but desire now that my antiquities and notes may + be thrown open to all students[.] I have done my duty thoroughly” (Add + MS 30425 f. 28a). Smith’s notebooks are kept at the British Library; a + provisional catalogue of them was prepared by E. Jiménez. All notebooks + containing copies of cuneiform tablets (VII, XI, XII, XIV, and XVII) + have been digitized with funds provided by a Sofia Kovalevskaja Award + (Alexander von Humboldt Stiftung). The tablets were copied by Smith + before they were given museum numbers, so their identification is often + challenging. Those that could be identified are displayed in the + Fragmentarium, e.g. DT.1. +

V.2. Johann Strassmaier, S.J. (15 May 1846 – 11 January 1920)

-
- +

+ The two collections of Strassmaier’s copies (I and II) were reunited in + the Pontifical Biblical Institute by W. R. Mayer in the early 1980s, + combining what J. Schaumberger had left to the Biblicum after his death + in 1955 with portions of the collections kept in Gars am Inn and in The + British Museum. Two different catalogues of the copies were prepared by + Mayer, who also collated a large number of the tablets in the British + Museum. The collections were digitized in the Pontifical Biblical + Institute in 2019, courtesy of W. R. Mayer and of its Rector M. F. + Kolarcik. +

V.3. Carl Bezold (18 May 1859 – 21 November 1922)

- -

- +

V.4. Friedrich W. Geers (24 January 1885 – 29 January 1955)

@@ -254,15 +348,29 @@ export default function AboutProject( Collection of Geers’s copies once at the Oriental Institute
- -

- + +

+ Geers’ copies have been digitized from the copy once in the Oriental + Institute of The University of Chicago, kindly donated by Prof. Martha + T. Roth to the Institut für Assyriologie und Hethitologie of Munich + University. +

V.5. Erica Reiner (4 August 1924 – 31 December 2005)

- -

- +

V.6. W. G. Lambert (26 February 1926 – 9 November 2011)

-
- - +

V.7. Riekele Borger (24 May 1929 – 27 December 2010)

@@ -317,11 +463,28 @@ export default function AboutProject( R. Borger and W. G. Lambert in the British Museum (courtesy J. Taylor)
- + -

V.8. Aaron Shaffer (2 January 1933 – 5 April 2004)

- - -

+ +

+ Shaffer’s large collection of photographs, many of them of Ur tablets, + are in the possession of Nathan Wasserman, who has catalogued and + digitized them and generously shared them with the eBL. +

V.9. Erle Leichty (7 August 1933 – 19 September 2016)

- -

- +

- -

{' '} - +

+ Leichty must have imagined that his notebooks would one day be used for + the digital reconstruction of cuneiform literature, since in one of his + notebooks he writes: “many r[igh]t sides of omens too fragmentary to + identify but might be good for computer search” (EL NB 911, see the + adjoining image). +

+

+ The transliterations of Erle Leichty are used here with the generous + permission of Steve Tinney, Associate Curator of the Babylonian Section + (Penn Museum of Archaeology and Anthropology). Thanks are expressed to + Phil Jones and his team, who were responsible for the scanning of part + of them. +

V.10. Stephen J. Lieberman (1943 – 1992)

- -

- + +

V.11. A. Kirk Grayson

-

V.12. Werner R. Mayer, S.J.

@@ -391,11 +612,34 @@ export default function AboutProject( Transliteration by W. R. Mayer
- +

V.13. Markham J. Geller

-

V.14. Simo Parpola

@@ -409,18 +653,19 @@ export default function AboutProject( Rm.468
-

V.15. Irving L. Finkel

@@ -433,10 +678,19 @@ export default function AboutProject( List of “joins” in a notebook by I. L. Finkel
- +

+ Irving L. Finkel is a leading authority in the field of Mesopotamian + scholarship, whose areas of expertise encompass a wide range of + subjects, from astronomical diaries to ancient board games. Finkel has + served as an Assistant Keeper at the British Museum’s Department of the + Middle East for many years. Finkel’s many significant contributions to + Assyriology stem from his discoveries of valuable tablets and fragments + in the museum’s collection, with which he is uniquely acquainted. The + decades of meticulous work Finkel has devoted to Assyriology are evident + in his notebooks, which include lists of “joins” discovered by him, as + well as careful, accurate transliterations of hundreds of medical and + magical texts. +

V.16. Andrew R. George

-

V.17. Ulla Koch

-

V.18. Jeremiah L. Peterson

-

V.19. Uri Gabbay

- ) diff --git a/src/about/ui/project.tsx b/src/about/ui/project.tsx index fefd0bfcf..565b920e3 100644 --- a/src/about/ui/project.tsx +++ b/src/about/ui/project.tsx @@ -39,11 +39,31 @@ export default function AboutProject(

List of Participants

diff --git a/src/about/ui/signs.tsx b/src/about/ui/signs.tsx index 8ecd5e25f..b41d44ebe 100644 --- a/src/about/ui/signs.tsx +++ b/src/about/ui/signs.tsx @@ -1,15 +1,13 @@ import React from 'react' -import { Markdown } from 'common/Markdown' -import Markup from 'markup/ui/markup' -import MarkupService from 'markup/application/MarkupService' +import { Markdown, MarkdownParagraph } from 'common/Markdown' import fossey from 'about/ui/static/fossey.jpg' import meszl from 'about/ui/static/meszl.jpg' -export default function AbouSigns(markupService: MarkupService): JSX.Element { +export default function AboutSigns(): JSX.Element { return ( <> - -

I. Sign information

- -

- -

-

II. Mesopotamisches Zeichenlexikon

@@ -46,46 +46,48 @@ export default function AbouSigns(markupService: MarkupService): JSX.Element { Borger, Mesopotamisches Zeichenlexikon
- -

- {' '} - different color - -

- + {' '} + + different color + + +

+ + -

-

III. Fossey, Manuel d’assyriologie II

@@ -98,41 +100,37 @@ export default function AbouSigns(markupService: MarkupService): JSX.Element { Fossey, Manuel d’assyriologie II
- -

-

IV. Palaeography

- -

- +

+ The tool for tagging images of cuneiform tablets that is at the core of + the palaeography section was implemented by J. Laasonen and Y. Cobanoglu + in the framework of the project “Searching through Ancient Libraries: + New Statistical Indexing Methods for 2D Images of Cuneiform Documents” + (Y. Cohen, E. Jiménez, Sh. Gordin), financed by a Call for Joint + Research Project on Data Science between Ludwig-Maximilians-Universität + München (LMU) and Tel Aviv University (TAU). +

+

+ The entire eBL team has contributed to the tagging of tablets, but the + labor of N. Wenner, L. Sáenz, M. Fadhil, and S. Cohen should be singled + out. More tablets are being tagged daily. Furthermore, a system for + automatically labeling photographs has been implemented and is + undergoing refinement. +

) } diff --git a/src/bibliography/application/BibliographyService.test.ts b/src/bibliography/application/BibliographyService.test.ts index 0d1f9a988..1808677f3 100644 --- a/src/bibliography/application/BibliographyService.test.ts +++ b/src/bibliography/application/BibliographyService.test.ts @@ -6,6 +6,7 @@ jest.mock('bibliography/infrastructure/BibliographyRepository', () => { return function () { return { find: jest.fn(), + findMany: jest.fn(), search: jest.fn(), update: jest.fn(), create: jest.fn(), @@ -20,6 +21,9 @@ const bibliographyService = new BibliographyService(bibliographyRepository) const testData: TestData[] = [ new TestData('find', ['RN2020'], bibliographyRepository.find, [resultStub]), + new TestData('findMany', [['RN2020']], bibliographyRepository.findMany, [ + [resultStub], + ]), new TestData('update', [resultStub], bibliographyRepository.update, [ resultStub, ]), diff --git a/src/bibliography/application/BibliographyService.ts b/src/bibliography/application/BibliographyService.ts index ab4fb5438..176f5e171 100644 --- a/src/bibliography/application/BibliographyService.ts +++ b/src/bibliography/application/BibliographyService.ts @@ -21,6 +21,10 @@ export default class BibliographyService implements BibliographySearch { return this.bibliographyRepository.find(id) } + findMany(ids: readonly string[]): Promise { + return this.bibliographyRepository.findMany(ids) + } + update(entry: BibliographyEntry): Promise { return this.bibliographyRepository.update(entry) } diff --git a/src/bibliography/infrastructure/BibliographyRepository.test.ts b/src/bibliography/infrastructure/BibliographyRepository.test.ts index 3e937eeb1..3659c874b 100644 --- a/src/bibliography/infrastructure/BibliographyRepository.test.ts +++ b/src/bibliography/infrastructure/BibliographyRepository.test.ts @@ -3,6 +3,7 @@ import { testDelegation, TestData } from 'test-support/utils' import BibliographyRepository from './BibliographyRepository' import BibliographyEntry from 'bibliography/domain/BibliographyEntry' import ApiClient from 'http/ApiClient' +import { stringify } from 'query-string' jest.mock('http/ApiClient') @@ -25,6 +26,20 @@ const testData: TestData[] = [ [`/bibliography/${encodeURIComponent(id)}`, false], Promise.resolve(resultStub) ), + new TestData( + 'findMany', + [[id]], + apiClient.fetchJson, + [entry], + [ + `/bibliography/list?${stringify( + { ids: [id] }, + { arrayFormat: 'comma' } + )}`, + false, + ], + Promise.resolve([resultStub]) + ), new TestData( 'search', [query], diff --git a/src/bibliography/infrastructure/BibliographyRepository.ts b/src/bibliography/infrastructure/BibliographyRepository.ts index 39ff474b7..84942da67 100644 --- a/src/bibliography/infrastructure/BibliographyRepository.ts +++ b/src/bibliography/infrastructure/BibliographyRepository.ts @@ -1,6 +1,7 @@ import BibliographyEntry from 'bibliography/domain/BibliographyEntry' import Promise from 'bluebird' import ApiClient from 'http/ApiClient' +import { stringify } from 'query-string' function createEntry(cslData) { return new BibliographyEntry(cslData) @@ -19,6 +20,15 @@ export default class BibliographyRepository { .then(createEntry) } + findMany(ids: readonly string[]): Promise { + return this.apiClient + .fetchJson( + `/bibliography/list?${stringify({ ids }, { arrayFormat: 'comma' })}`, + false + ) + .then((result) => result.map(createEntry)) + } + search(query: string): Promise { return this.apiClient .fetchJson(`/bibliography?query=${encodeURIComponent(query)}`, false) diff --git a/src/common/Markdown.tsx b/src/common/Markdown.tsx index 6b7635312..4125ecfd3 100644 --- a/src/common/Markdown.tsx +++ b/src/common/Markdown.tsx @@ -31,3 +31,9 @@ export function Markdown({ ) } + +export function MarkdownParagraph( + props: Omit +): JSX.Element { + return +} diff --git a/src/corpus/application/TextService.test.ts b/src/corpus/application/TextService.test.ts index e9c174ff2..f1c00a78f 100644 --- a/src/corpus/application/TextService.test.ts +++ b/src/corpus/application/TextService.test.ts @@ -23,6 +23,7 @@ import { ChapterDisplay } from 'corpus/domain/chapter' import textLineFixture, { textLineDto } from 'test-support/lines/text-line' import { chapterDisplayDtoFactory } from 'test-support/chapter-fixtures' import { + bibliographyEntryFactory, cslDataFactory, referenceDtoFactory, referenceFactory, @@ -582,8 +583,28 @@ test('inject ChapterDisplay', async () => { } } - const translationReference = referenceFactory.build() - const intertextReference = referenceFactory.build() + const translationReference = referenceFactory.build( + {}, + { + associations: { + document: bibliographyEntryFactory.build( + {}, + { associations: { id: 'XY1' } } + ), + }, + } + ) + const intertextReference = referenceFactory.build( + {}, + { + associations: { + document: bibliographyEntryFactory.build( + {}, + { associations: { id: 'XY2' } } + ), + }, + } + ) const chapterWithReferences = produce(chapterDisplay, (draft) => { draft.lines[0].translation[0].parts = [ createInjectedPart(translationReference), @@ -607,11 +628,11 @@ test('inject ChapterDisplay', async () => { ] }) apiClient.fetchJson.mockReturnValue(Bluebird.resolve(chapterWithReferences)) - bibliographyServiceMock.find.mockReturnValueOnce( - Bluebird.resolve(translationReference.document) + bibliographyServiceMock.findMany.mockReturnValueOnce( + Bluebird.resolve([translationReference.document]) ) - bibliographyServiceMock.find.mockReturnValueOnce( - Bluebird.resolve(intertextReference.document) + bibliographyServiceMock.findMany.mockReturnValueOnce( + Bluebird.resolve([intertextReference.document]) ) await expect(testService.findChapterDisplay(chapterId)).resolves.toEqual( injectedChapter @@ -620,12 +641,12 @@ test('inject ChapterDisplay', async () => { `${chapterUrl}/display`, false ) - expect(bibliographyServiceMock.find).toHaveBeenCalledWith( - translationReference.id - ) - expect(bibliographyServiceMock.find).toHaveBeenCalledWith( - intertextReference.id - ) + expect(bibliographyServiceMock.findMany).toHaveBeenCalledWith([ + translationReference.id, + ]) + expect(bibliographyServiceMock.findMany).toHaveBeenCalledWith([ + intertextReference.id, + ]) }) test('listAllTexts', async () => { diff --git a/src/corpus/ui/__snapshots__/ManuscriptPopover.test.tsx.snap b/src/corpus/ui/__snapshots__/ManuscriptPopover.test.tsx.snap index 2274020e1..b9e17f48c 100644 --- a/src/corpus/ui/__snapshots__/ManuscriptPopover.test.tsx.snap +++ b/src/corpus/ui/__snapshots__/ManuscriptPopover.test.tsx.snap @@ -14,7 +14,7 @@ exports[`Show manuscript line details 1`] = ` - Estrada & Wolfe, 2068: 7477711662481408-4847418310918144 + Estrada & Wolfe, 2069: 7477711662481408-4847418310918144 [ l. 4'.2., 3'. ] diff --git a/src/fragmentarium/application/FragmentService.test.ts b/src/fragmentarium/application/FragmentService.test.ts index 7c4ccc04f..6a474dbf4 100644 --- a/src/fragmentarium/application/FragmentService.test.ts +++ b/src/fragmentarium/application/FragmentService.test.ts @@ -40,7 +40,7 @@ jest.mock('./LemmatizationFactory') jest.mock('bibliography/application/BibliographyService', () => { return function () { - return { find: jest.fn(), search: jest.fn() } + return { find: jest.fn(), findMany: jest.fn(), search: jest.fn() } } }) @@ -229,6 +229,9 @@ describe('methods returning fragment', () => { bibliographyService.find.mockImplementation((id: string) => Promise.reject(new Error(`${id} not found.`)) ) + bibliographyService.findMany.mockImplementation((ids: string[]) => + Promise.reject(new Error(`${ids} not found.`)) + ) silenceConsoleErrors() }) diff --git a/src/fragmentarium/ui/front-page/__snapshots__/LatestTransliterations.test.tsx.snap b/src/fragmentarium/ui/front-page/__snapshots__/LatestTransliterations.test.tsx.snap index d14edfa3a..cf2f15e6d 100644 --- a/src/fragmentarium/ui/front-page/__snapshots__/LatestTransliterations.test.tsx.snap +++ b/src/fragmentarium/ui/front-page/__snapshots__/LatestTransliterations.test.tsx.snap @@ -71,9 +71,9 @@ exports[`Snapshot 1`] = ` , ) @@ -108,7 +108,7 @@ exports[`Snapshot 1`] = ` - Fanti & Carr, 2036: 8970824935538688-3796097900216320 + Fanti & Carr, 2037: 8970824935538688-3796097900216320 [ l. 4'.2., 2. ] @@ -123,7 +123,7 @@ exports[`Snapshot 1`] = ` - Hall & Reid, 2089: 7020923936833536-4895425479835648 + Hall & Reid, 2090: 7020923936833536-4895425479835648 [ l. 4'.2., 3'. ] @@ -5906,7 +5906,7 @@ exports[`Snapshot 1`] = ` - White & Manca, 2070: 6525764484726784-1000123435843584 + White & Manca, 2071: 6525764484726784-1000123435843584 [ l. 3'., 2. ] @@ -5925,7 +5925,7 @@ exports[`Snapshot 1`] = ` - Martinez & Robin, 2112: 5946678584541184-5595938733162496 + Martinez & Robin, 2113: 5946678584541184-5595938733162496 [ l. 3'., 4'.2. ] diff --git a/src/fragmentarium/ui/search/__snapshots__/FragmentariumSearch.test.tsx.snap b/src/fragmentarium/ui/search/__snapshots__/FragmentariumSearch.test.tsx.snap index 48d4a8c96..53ed16af9 100644 --- a/src/fragmentarium/ui/search/__snapshots__/FragmentariumSearch.test.tsx.snap +++ b/src/fragmentarium/ui/search/__snapshots__/FragmentariumSearch.test.tsx.snap @@ -773,7 +773,7 @@ exports[`Searching fragments by transliteration Displays corpus results when cli - Giles & Alvarez, 2086: 5582194326110208-1406653725409280 + Giles & Alvarez, 2087: 5582194326110208-1406653725409280 [ l. 1., 3'. ] @@ -792,7 +792,7 @@ exports[`Searching fragments by transliteration Displays corpus results when cli - Shaw & Robert, 2045: 6150545542742016-5917511180615680 + Shaw & Robert, 2046: 6150545542742016-5917511180615680 [ l. 2., 1. ] @@ -6565,7 +6565,7 @@ exports[`Searching fragments by transliteration Displays corpus results when cli - Harrison & Palmieri, 2028: 5188341634957312-4059361584349184 + Harrison & Palmieri, 2029: 5188341634957312-4059361584349184 [ l. 1., 2. ] @@ -6584,7 +6584,7 @@ exports[`Searching fragments by transliteration Displays corpus results when cli - Wise & Hudson, 2039: 1529496131862528-4383736143544320 + Wise & Hudson, 2040: 1529496131862528-4383736143544320 [ l. 4'.2., 2. ] diff --git a/src/index.tsx b/src/index.tsx index c1f8aab07..8998d7064 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -24,7 +24,9 @@ import { scopeString, useAuthentication } from 'auth/Auth' import SignService from 'signs/application/SignService' import SignRepository from 'signs/infrastructure/SignRepository' import AfoRegisterRepository from 'afo-register/infrastructure/AfoRegisterRepository' -import MarkupService from 'markup/application/MarkupService' +import MarkupService, { + CachedMarkupService, +} from 'markup/application/MarkupService' import AfoRegisterService from 'afo-register/application/AfoRegisterService' import './index.sass' import { FindspotService } from 'fragmentarium/application/FindspotService' @@ -80,6 +82,10 @@ function InjectedApp(): JSX.Element { ) const signService = new SignService(signsRepository) const markupService = new MarkupService(apiClient, bibliographyService) + const cachedMarkupService = new CachedMarkupService( + apiClient, + bibliographyService + ) const afoRegisterService = new AfoRegisterService(afoRegisterRepository) const findspotService = new FindspotService(findspotRepository) return ( @@ -91,6 +97,7 @@ function InjectedApp(): JSX.Element { bibliographyService={bibliographyService} textService={textService} markupService={markupService} + cachedMarkupService={cachedMarkupService} afoRegisterService={afoRegisterService} findspotService={findspotService} /> diff --git a/src/markup/application/MarkupService.ts b/src/markup/application/MarkupService.ts index 0d5520b23..7cc9fb1d5 100644 --- a/src/markup/application/MarkupService.ts +++ b/src/markup/application/MarkupService.ts @@ -6,9 +6,11 @@ import { MarkupPart } from 'transliteration/domain/markup' import { stringify } from 'query-string' export default class MarkupService { - private readonly referenceInjector: ReferenceInjector + protected readonly referenceInjector: ReferenceInjector + protected urlPath = 'markup' + constructor( - private readonly apiClient: ApiClient, + protected readonly apiClient: ApiClient, bibliographyService: BibliographyService ) { this.referenceInjector = new ReferenceInjector(bibliographyService) @@ -17,7 +19,7 @@ export default class MarkupService { fromString(text: string): Bluebird { return this.apiClient .fetchJson( - `/markup?${stringify({ + `/${this.urlPath}?${stringify({ text: text, })}`, false @@ -42,3 +44,7 @@ export default class MarkupService { return this.referenceInjector.injectReferencesToMarkup(parts) } } + +export class CachedMarkupService extends MarkupService { + protected urlPath = 'cached-markup' +} diff --git a/src/router/aboutRoutes.tsx b/src/router/aboutRoutes.tsx index 5de6741fa..2479796ef 100644 --- a/src/router/aboutRoutes.tsx +++ b/src/router/aboutRoutes.tsx @@ -1,16 +1,16 @@ import React, { ReactNode } from 'react' import { Redirect, Route, RouteComponentProps } from 'react-router-dom' import About, { TabId, tabIds } from 'about/ui/about' -import MarkupService from 'markup/application/MarkupService' +import { CachedMarkupService } from 'markup/application/MarkupService' import { sitemapDefaults } from 'router/sitemap' import { HeadTagsService } from 'router/head' export default function AboutRoutes({ sitemap, - markupService, + cachedMarkupService, }: { sitemap: boolean - markupService: MarkupService + cachedMarkupService: CachedMarkupService }): JSX.Element[] { return [ diff --git a/src/router/router.tsx b/src/router/router.tsx index b4694ac8d..d90d3e3b0 100644 --- a/src/router/router.tsx +++ b/src/router/router.tsx @@ -8,7 +8,9 @@ import FragmentService from 'fragmentarium/application/FragmentService' import FragmentSearchService from 'fragmentarium/application/FragmentSearchService' import BibliographyService from 'bibliography/application/BibliographyService' import TextService from 'corpus/application/TextService' -import MarkupService from 'markup/application/MarkupService' +import MarkupService, { + CachedMarkupService, +} from 'markup/application/MarkupService' import SignService from 'signs/application/SignService' import AfoRegisterService from 'afo-register/application/AfoRegisterService' @@ -33,6 +35,7 @@ export interface Services { textService: TextService signService: SignService markupService: MarkupService + cachedMarkupService: CachedMarkupService afoRegisterService: AfoRegisterService findspotService: FindspotService } diff --git a/src/router/sitemap.test.tsx b/src/router/sitemap.test.tsx index 289a6ce6c..46126fa15 100644 --- a/src/router/sitemap.test.tsx +++ b/src/router/sitemap.test.tsx @@ -6,7 +6,9 @@ import WordService from 'dictionary/application/WordService' import FragmentService from 'fragmentarium/application/FragmentService' import FragmentSearchService from 'fragmentarium/application/FragmentSearchService' import TextService from 'corpus/application/TextService' -import MarkupService from 'markup/application/MarkupService' +import MarkupService, { + CachedMarkupService, +} from 'markup/application/MarkupService' import AfoRegisterService from 'afo-register/application/AfoRegisterService' import Bluebird from 'bluebird' import { Services } from './router' @@ -47,6 +49,9 @@ beforeEach(() => { const markupService = new (MarkupService as jest.Mock< jest.Mocked >)() + const cachedMarkupService = new (CachedMarkupService as jest.Mock< + jest.Mocked + >)() const afoRegisterService = new (AfoRegisterService as jest.Mock< jest.Mocked @@ -76,6 +81,7 @@ beforeEach(() => { fragmentSearchService: fragmentSearchService, textService: textService, markupService: markupService, + cachedMarkupService: cachedMarkupService, afoRegisterService: afoRegisterService, } }) diff --git a/src/test-support/AppDriver.tsx b/src/test-support/AppDriver.tsx index a58ff68ed..30d04625a 100644 --- a/src/test-support/AppDriver.tsx +++ b/src/test-support/AppDriver.tsx @@ -27,7 +27,9 @@ import { Promise } from 'bluebird' import { eblNameProperty, AuthenticationContext } from 'auth/Auth' import SignRepository from 'signs/infrastructure/SignRepository' import SignService from 'signs/application/SignService' -import MarkupService from 'markup/application/MarkupService' +import MarkupService, { + CachedMarkupService, +} from 'markup/application/MarkupService' import AfoRegisterRepository from 'afo-register/infrastructure/AfoRegisterRepository' import AfoRegisterService from 'afo-register/application/AfoRegisterService' import { FindspotService } from 'fragmentarium/application/FindspotService' @@ -59,6 +61,7 @@ function createApp(api): JSX.Element { const afoRegisterRepository = new AfoRegisterRepository(api) const signService = new SignService(signsRepository) const markupService = new MarkupService(api, bibliographyService) + const cachedMarkupService = new CachedMarkupService(api, bibliographyService) const afoRegisterService = new AfoRegisterService(afoRegisterRepository) const findspotService = new FindspotService(findspotRepository) return ( @@ -70,6 +73,7 @@ function createApp(api): JSX.Element { bibliographyService={bibliographyService} textService={textService} markupService={markupService} + cachedMarkupService={cachedMarkupService} afoRegisterService={afoRegisterService} findspotService={findspotService} /> diff --git a/src/test-support/bibliography-fixtures.ts b/src/test-support/bibliography-fixtures.ts index b948f442f..5998c715a 100644 --- a/src/test-support/bibliography-fixtures.ts +++ b/src/test-support/bibliography-fixtures.ts @@ -37,11 +37,11 @@ const authorFactory = Factory.define< export const cslDataFactory = Factory.define< CslData, { chance: Chance.Chance } ->(({ transientParams }) => { +>(({ transientParams, associations }) => { const chance = transientParams.chance ?? defaultChance const issuedDate = chance.date() return { - id: chance.guid(), + id: associations.id ?? chance.guid(), title: chance.sentence(), type: chance.pickone(['article-journal', 'paper-conference']), issued: { @@ -65,10 +65,13 @@ export const cslDataWithContainerTitleShortFactory = cslDataFactory.params({ export const bibliographyEntryFactory = Factory.define< BibliographyEntry, CslData & { chance: Chance.Chance } ->(({ transientParams }) => { +>(({ transientParams, associations }) => { const chance = transientParams.chance ?? defaultChance return new BibliographyEntry( - cslDataFactory.build(transientParams, { transient: { chance } }) + cslDataFactory.build(transientParams, { + transient: { chance }, + associations, + }) ) }) diff --git a/src/transliteration/application/ReferenceInjector.test.ts b/src/transliteration/application/ReferenceInjector.test.ts index 935ca3ce1..1f1a9cb60 100644 --- a/src/transliteration/application/ReferenceInjector.test.ts +++ b/src/transliteration/application/ReferenceInjector.test.ts @@ -4,7 +4,7 @@ import { Text } from 'transliteration/domain/text' import Promise from 'bluebird' import { bibliographyEntryFactory } from 'test-support/bibliography-fixtures' import Reference from 'bibliography/domain/Reference' -import { MarkupPart } from 'transliteration/domain/markup' +import { MarkupPart, TextPart } from 'transliteration/domain/markup' import { NoteLine } from 'transliteration/domain/note-line' import { ReferenceDto } from 'bibliography/domain/referenceDto' @@ -16,11 +16,15 @@ const MockBibliographyService = BibliographyService as jest.Mock< const bibliographyServiceMock = new MockBibliographyService() const referenceInjector = new ReferenceInjector(bibliographyServiceMock) +const referenceId = 'RN1' describe('ReferenceInjector', () => { - const entry = bibliographyEntryFactory.build() + const entry = bibliographyEntryFactory.build( + {}, + { associations: { id: referenceId } } + ) const referenceDto: ReferenceDto = { - id: 'RN1', + id: referenceId, type: 'DISCUSSION', pages: '5', notes: '', @@ -30,6 +34,14 @@ describe('ReferenceInjector', () => { reference: referenceDto, type: 'BibliographyPart', } + const stringPart: TextPart = { + text: 'Lorem ipsum', + type: 'StringPart', + } + const emphasisPart: TextPart = { + text: 'Lorem ipsum', + type: 'EmphasisPart', + } const reference = new Reference('DISCUSSION', '5', '', [], entry) const injectedParts = [ { @@ -44,6 +56,9 @@ describe('ReferenceInjector', () => { beforeEach(() => { bibliographyServiceMock.find.mockReturnValueOnce(Promise.resolve(entry)) + bibliographyServiceMock.findMany.mockReturnValueOnce( + Promise.resolve([entry]) + ) }) it('injects references to text', async () => { @@ -58,8 +73,10 @@ describe('ReferenceInjector', () => { it('injects references to MarkupParts', async () => { return referenceInjector - .injectReferencesToMarkup([bibliographyPart]) - .then((parts) => expect(parts).toEqual(injectedParts)) + .injectReferencesToMarkup([emphasisPart, bibliographyPart, stringPart]) + .then((parts) => + expect(parts).toEqual([emphasisPart, ...injectedParts, stringPart]) + ) }) it('injects references to OldLineNumbers', async () => { diff --git a/src/transliteration/application/ReferenceInjector.ts b/src/transliteration/application/ReferenceInjector.ts index 4bb4e8233..44fbcaa21 100644 --- a/src/transliteration/application/ReferenceInjector.ts +++ b/src/transliteration/application/ReferenceInjector.ts @@ -3,7 +3,7 @@ import Promise from 'bluebird' import Reference from 'bibliography/domain/Reference' import BibliographyService from 'bibliography/application/BibliographyService' import { NoteLine } from 'transliteration/domain/note-line' -import { BibliographyPart, MarkupPart } from 'transliteration/domain/markup' +import { MarkupPart } from 'transliteration/domain/markup' import { AbstractLine } from 'transliteration/domain/abstract-line' import { ReferenceDto } from 'bibliography/domain/referenceDto' import TranslationLine from 'transliteration/domain/translation-line' @@ -12,6 +12,8 @@ import { isBibliographyPart } from 'transliteration/domain/type-guards' import { OldLineNumber } from 'transliteration/domain/line-number' import { OldLineNumberDto } from 'corpus/application/dtos' import { Introduction, Notes } from 'fragmentarium/domain/fragment' +import _ from 'lodash' +import BibliographyEntry from 'bibliography/domain/BibliographyEntry' function isMarkupLine( line: Draft @@ -44,27 +46,45 @@ export default class ReferenceInjector { }) } + private mergeEntries( + parts: readonly MarkupPart[], + entries: readonly BibliographyEntry[] + ): MarkupPart[] { + const entryMap = _.keyBy(entries, 'id') + + return parts.map((part) => { + if (isBibliographyPart(part)) { + const dto = part.reference + const reference = new Reference( + dto.type, + dto.pages, + dto.notes, + dto.linesCited, + entryMap[dto.id] + ) + return { ...part, reference } + } + + return part + }) + } + injectReferencesToMarkup( parts: readonly MarkupPart[] ): Promise { - return Promise.all( - parts.map( - (part): Promise => - isBibliographyPart(part) - ? this.createReference(part.reference as ReferenceDto) - .then( - (reference): BibliographyPart => ({ - ...part, - reference, - }) - ) - .catch((error) => { - console.error(error) - return part - }) - : Promise.resolve(part) - ) - ) + const ids = parts + .filter(isBibliographyPart) + .map((part) => part.reference.id) + + return _.isEmpty(ids) + ? Promise.resolve(parts as MarkupPart[]) + : this.bibliographyService + .findMany(ids) + .then((entries) => this.mergeEntries(parts, entries)) + .catch((error) => { + console.error(error) + return parts as MarkupPart[] + }) } injectReferencesToIntroduction( diff --git a/src/transliteration/ui/__snapshots__/markup.test.tsx.snap b/src/transliteration/ui/__snapshots__/markup.test.tsx.snap index b3a8aa722..df48a0dc2 100644 --- a/src/transliteration/ui/__snapshots__/markup.test.tsx.snap +++ b/src/transliteration/ui/__snapshots__/markup.test.tsx.snap @@ -40,7 +40,7 @@ exports[`Markup 1`] = ` - Dickinson & Falciani, 2062: 6831522153758720-8434983175716864 + Dickinson & Falciani, 2063: 6831522153758720-8434983175716864 [ l. 4'.2., 1. ]