# Nisaba Domain Proposal

## The Goddess: Nisaba (𒀭𒉀)

**Nisaba** is the Sumerian goddess of writing, learning, grain, and reeds — the
divine scribe who kept the accounts of the gods and whose temple was called
**É-zagin**, the "House of Lapis Lazuli," the world's earliest concept of a
library. She predates every other deity associated with writing: older than
Thoth, older than Seshat, older than Saraswati. She belongs to the civilization
that _invented_ writing itself.

### Why Nisaba?

1. **Inventor of Cuneiform** — Nisaba is credited with the invention of
   cuneiform script, the earliest writing system in human history. A platform
   dedicated to analyzing humanity's oldest texts should bear the name of the
   goddess who made textuality possible.

2. **The House of Knowledge** — Her temple was conceived as a repository of all
   wisdom, the prototype of every library and archive that followed. Nisaba is
   the domain that gathers every tradition's texts under one scholarly roof.

3. **The Reed Stylus** — Her sacred symbol is the reed (_gi_), the instrument
   that pressed cuneiform into wet clay. The reed connects writing to the earth:
   knowledge is not ethereal but material, requiring tools, substrate, and
   craft. This grounds the platform in the physical reality of manuscripts and
   scribal traditions.

4. **Scribe of the Gods** — Nisaba kept the records of the divine assembly,
   performing the role of accountant, cataloger, and archivist. She represents
   the meticulous, systematic work of textual criticism: collation, apparatus
   generation, variant classification.

5. **Grain and Knowledge** — Uniquely, Nisaba was both goddess of grain
   (agriculture) and goddess of writing. This dual patronage reflects how
   civilization and literacy co-evolved — you cannot have written culture
   without the agricultural surplus to support scribes. The platform similarly
   bridges the raw material (ancient texts) with the cultivated output
   (scholarly analysis).

6. **Pre-Babel Unity** — As a Sumerian deity predating the mythological
   fragmentation of languages and traditions, Nisaba represents the universal
   knowledge that the platform seeks to reconnect. Before traditions diverged
   into separate canons and theological systems, there was a common human
   impulse to record wisdom. Nisaba embodies that primordial unity.

7. **The Measuring Rod** — Like the Egyptian Seshat's measuring cord, Nisaba
   wielded surveying tools — the lapis lazuli tablet and the holy measuring rod.
   This represents the precise, quantitative nature of textual scholarship:
   word-level alignment, stemmatic distance, collation accuracy.

8. **Daughter of An** — As daughter of the sky god An (the supreme deity of the
   Sumerian pantheon), Nisaba bridges heaven and earth — divine wisdom made
   accessible through the written word. This mirrors the platform's mission:
   making the most profound insights of every tradition accessible through
   rigorous scholarly tools.

---

## Domain Overview

### Mission Statement

**Nisaba** is the domain for **Ancient Text Analysis & Cross-Tradition Scholarly
Research**. It provides state-of-the-art tools for analyzing ancient texts
across all world traditions, comparing translations, performing textual
criticism, and discovering the deep connections between philosophical and
religious traditions throughout human history.

The mission is to create the most comprehensive, AI-powered scholarly platform
for ancient text analysis — enabling researchers to work with texts from every
major tradition (Sumerian, Egyptian, Hebrew, Greek, Sanskrit, Chinese, Arabic,
Pali, and beyond) in their original languages, compare translations with
precision, produce critical editions, and discover the universal patterns of
wisdom that connect humanity's oldest recorded thoughts.

### Vision

Ancient traditions across cultures independently arrived at the same ineffable
truths. The Tao Te Ching opens with "The Tao that can be spoken is not the
eternal Tao." Jesus taught in parables because direct propositional language
could not convey the kingdom of God. The Buddhist teaching of the "finger
pointing at the moon" warns against confusing the signifier with the signified.
The Upanishads describe Brahman as "_neti neti_" — "not this, not this" —
because the ultimate reality transcends all conceptual categories. The Sufi
tradition distinguishes _fana_ (annihilation of the self) as an experience that
no words can capture. Meister Eckhart wrote that "the most beautiful thing which
a person can say about God consists in that person's being silent from the
wisdom of the divine riches." The Kabbalistic _Ein Sof_ — the "without end" — is
God prior to all self-manifestation, about which nothing can be predicated.

These are not superficial parallels. They represent humanity's deepest thinkers
across millennia, separated by thousands of miles and centuries of time,
converging on the same recognition: that the most fundamental truth about
existence is beyond the reach of language.

Nisaba provides the tools to trace these connections through rigorous
scholarship, not speculation. Every claim of parallel or influence must be
grounded in textual evidence, philological analysis, chronological plausibility,
and verifiable citation. The platform serves scholars who want to _prove_
connections, not merely assert them.

---

## Core Technology Pillars

### 1. Ancient Language Engine (`@nisaba/languages`)

The foundation of any ancient text analysis platform: comprehensive support for
the world's ancient writing systems and languages, providing morphological
analysis, transliteration, tokenization, and lexicon integration.

#### 1.1 Writing System Support

- **Cuneiform scripts**
  - Sumerian cuneiform (logographic + syllabic, ~600 common signs)
  - Akkadian cuneiform (Old Babylonian, Standard Babylonian, Neo-Assyrian)
  - Hittite cuneiform
  - Elamite cuneiform
  - Ugaritic cuneiform (alphabetic)
  - Sign list integration (Borger MZL, aBZL, CDLI sign values)
  - ATF (ASCII Transliteration Format) parsing and generation

- **Egyptian scripts**
  - Hieroglyphic Egyptian (Middle, Late, Ptolemaic)
  - Hieratic (with paleographic dating support)
  - Demotic
  - Coptic (all dialects: Sahidic, Bohairic, Akhmimic, Fayyumic, Lycopolitan)
  - Manuel de Codage (MdC) encoding support
  - Gardiner sign list integration with JSesh-compatible rendering

- **Semitic scripts**
  - Biblical Hebrew (Tiberian vocalization, Babylonian, Palestinian)
  - Aramaic (Imperial, Biblical, Syriac — Estrangela, Serto, Eastern)
  - Arabic (Classical, Quranic with tajweed markers, Andalusi)
  - Ge'ez/Ethiopic (with Amharic extensions)
  - Phoenician, Ugaritic alphabetic, Moabite, Samaritan
  - Paleo-Hebrew script

- **South Asian scripts**
  - Sanskrit (Devanagari, IAST, Harvard-Kyoto, SLP1 transliteration)
  - Pali (Devanagari, Roman, Sinhala, Thai, Burmese, Khmer)
  - Prakrit languages (Ardhamagadhi, Shauraseni, Maharashtri)
  - Tamil Brahmi, Grantha, Telugu-Kannada
  - Tibetan (Wylie transliteration support)

- **East Asian scripts**
  - Classical Chinese (Literary Chinese / 文言文)
  - Classical Japanese (kanbun, man'yogana)
  - Classical Korean (hanmun, idu)

- **Greco-Roman scripts**
  - Ancient Greek (with polytonic accentuation, dialectal variants)
  - Latin (Classical, Medieval, Ecclesiastical orthography)
  - Linear B (Mycenaean Greek)
  - Etruscan

- **Other ancient scripts**
  - Old Persian cuneiform
  - Avestan (Gathic, Younger Avestan)
  - Old Church Slavonic (Glagolitic, Early Cyrillic)
  - Sogdian, Tocharian, Kharoshthi
  - Runic (Elder Futhark, Younger Futhark, Anglo-Saxon Futhorc)

#### 1.2 Morphological Analysis

- **Paradigm-based parsers**
  - Hebrew: full verb paradigm (Qal through Hitpael, all stems) with weak root
    detection, pronominal suffix decomposition, construct chain analysis
  - Greek: full nominal/verbal paradigm parsing, augment detection, contract
    verb resolution, middle/passive distinction, participle agreement
  - Latin: all five declensions, four conjugations, deponent detection, ablative
    absolute identification
  - Sanskrit: sandhi decomposition (external and internal), compound analysis
    (tatpurusha, dvandva, bahuvrihi, avyayibhava), vibhakti parsing
  - Arabic: root-pattern morphology, form I-X identification, broken plural
    detection, idafa chain analysis

- **Tokenization strategies**
  - Language-specific tokenizers (Hebrew clitic separation, Greek enclitic
    handling, Sanskrit sandhi splitting, Arabic proclitics/enclitics)
  - Configurable token granularity (morpheme, word, phrase, clause)
  - Position-preserving tokenization (byte offsets maintained for standoff
    annotation alignment)

- **Lemmatization**
  - Dictionary-form resolution for all supported languages
  - Disambiguation using morphological context and bigram statistics
  - Multiple lexicon fallback chains per language

#### 1.3 Lexicon Integration

- **Standard reference lexica**
  - BDB (Brown-Driver-Briggs) — Biblical Hebrew & Aramaic
  - HALOT (Koehler-Baumgartner) — Hebrew & Aramaic (license permitting)
  - BDAG (Bauer-Danker) — NT Greek (reference only, license-aware)
  - LSJ (Liddell-Scott-Jones) — Classical Greek
  - Lewis & Short — Latin
  - Monier-Williams — Sanskrit
  - PTS Pali-English Dictionary — Pali
  - CAD (Chicago Assyrian Dictionary) — Akkadian
  - PSD (Pennsylvania Sumerian Dictionary) — Sumerian
  - ePSD2 (electronic PSD) — Sumerian
  - Lane's Arabic-English Lexicon — Classical Arabic
  - Wehr (Hans Wehr) — Arabic (modern reference)

- **Lexicon features**
  - Unified lookup API across all lexica
  - Semantic domain grouping (Louw-Nida style)
  - Cross-language cognate linking (Proto-Semitic, PIE roots)
  - Frequency data integration (per-corpus word frequency rankings)
  - Extended definitions with usage examples from canonical texts

#### 1.4 Transliteration Engine

- **Bidirectional transliteration** between native script and romanization
  schemes for every supported language
- **Multiple romanization schemes** per language (e.g., Hebrew: academic, SBL,
  simplified; Sanskrit: IAST, Harvard-Kyoto, SLP1, Velthuis; Arabic: DIN 31635,
  ALA-LC, Buckwalter)
- **Scholarly convention compliance** — output matches the standard expected in
  peer-reviewed journals (e.g., SBL Handbook of Style, Chicago Manual of Style)
- **Round-trip fidelity** — transliterate to Roman and back without data loss

---

### 2. Translation Comparison Engine (`@nisaba/translations`)

Tools for placing multiple translations side by side, detecting divergences,
analyzing translation choices, and tracking how interpretation has evolved over
time.

#### 2.1 Display Modes

- **Side-by-side view** — Two or more translations in parallel columns,
  synchronized by verse, line, or paragraph
- **Synoptic view** — Horizontal layout showing all versions of a passage
  simultaneously, with visual alignment markers
- **Interlinear view** — Source language with morphological parsing, gloss, and
  one or more translation lines beneath each word
- **Reverse interlinear** — Translation text with source language words and
  morphological data above each translated word
- **Parallel text** — Left-right original and translation, sentence-aligned

#### 2.2 Alignment Algorithms

- **Statistical alignment**
  - Gale-Church sentence alignment (length-based)
  - IBM Model 1-5 word alignment (adapted for ancient languages)
  - Hidden Markov alignment models
  - Phrase-level alignment using bilingual concordances

- **Neural alignment**
  - Transformer-based cross-lingual alignment using multilingual embeddings
  - Fine-tuned models for ancient language pairs (e.g., Greek-English,
    Hebrew-English, Sanskrit-English)
  - Attention-based word alignment extraction from translation models

- **Manual alignment** — Scholar-driven alignment with approval/rejection of
  automatic suggestions, exportable as parallel corpus for model training

#### 2.3 Divergence Detection

- **Semantic divergence scoring** — Quantified difference between translations
  at word, phrase, clause, and sentence levels
- **Theological divergence flagging** — Automatic detection of translation
  choices that reflect doctrinal positions (e.g., _almah_ → "virgin" vs. "young
  woman" in Isaiah 7:14; _pistis Christou_ → "faith in Christ" vs. "faithfulness
  of Christ" in Galatians 2:16)
- **Omission/addition detection** — Identifying material present in one
  translation but absent in another
- **Paraphrase vs. literal scoring** — Quantifying where a translation falls on
  the formal-dynamic equivalence spectrum (Nida's terminology)
- **Dynamic comparison** — Select any combination of translations for
  comparison; not limited to predefined pairs

#### 2.4 Translation History Timeline

- **Chronological translation tracking** — Visualize how a passage has been
  translated across history (e.g., Wycliffe → Tyndale → KJV → RSV → NRSV → ESV
  for English Bible translations)
- **Influence mapping** — Detect where later translations borrowed phrasing from
  earlier ones
- **Cultural context annotations** — Notes on the historical/theological context
  influencing each translation's choices

---

### 3. Textual Criticism Engine (`@nisaba/criticism`)

A complete workflow for the practice of textual criticism: registering
manuscripts, collating witnesses, classifying variants, building stemmata,
generating critical apparatus, and producing critical editions.

#### 3.1 Manuscript Witness Registry

- **Witness metadata** — Siglum, date, provenance, script type, material
  (papyrus, parchment, paper, clay, stone), dimensions, current repository,
  catalog number, digitization status
- **Witness classification** — Majuscule/minuscule (Greek), scrolls/codices,
  text families (Alexandrian, Byzantine, Western, Caesarean for NT)
- **Hierarchical witness organization** — Support for groups (e.g., family
  groups f1, f13 in NT criticism), versional witnesses (LXX, Vulgate, Peshitta,
  Coptic), patristic citations
- **IIIF manifest linking** — Link witnesses to their digital facsimiles via
  IIIF (International Image Interoperability Framework) manifests for
  side-by-side text and image viewing

#### 3.2 Collation

- **Automatic collation** — CollateX-compatible algorithm implementation in
  TypeScript (Dekker's variant graph model), supporting:
  - Token-based alignment with fuzzy matching for orthographic variants
  - Transposition detection
  - Custom normalization rules per language (e.g., itacism in Greek, _matres
    lectionis_ variation in Hebrew)
  - Block alignment for larger structural variants

- **Manual collation interface** — Scholar-reviewed collation with accept/reject
  controls, custom variant unit boundaries, uncertain reading markers

- **Collation output formats**
  - Variant graph (interactive visualization)
  - Alignment table (traditional columnar display)
  - TEI-XML apparatus entries (positive, negative, and mixed apparatus)
  - JSON collation interchange format

#### 3.3 Variant Classification

- **Automatic classification** — ML-assisted categorization of variants:
  - Orthographic (spelling differences with no semantic impact)
  - Morphological (different grammatical forms, same lexeme)
  - Lexical (synonym substitution)
  - Syntactic (word order changes)
  - Semantic (meaning-affecting variants)
  - Substantial (additions, omissions, transpositions of clauses)
  - Nonsense (scribal errors producing non-words)

- **Scribal error taxonomy** — Classification by probable cause:
  - Haplography, dittography, homoioteleuton, homoioarcton
  - Metathesis, itacism, confusion of similar letters
  - Harmonization (assimilation to parallel passages)
  - Lectio difficilior preservation tracking
  - Deliberate theological alteration detection

#### 3.4 Stemmatic Analysis

- **Phylogenetic methods** — Applying computational biology algorithms to
  manuscript traditions:
  - Maximum parsimony (Fitch algorithm)
  - Maximum likelihood estimation
  - Bayesian phylogenetics (adapted from MrBayes/BEAST approaches)
  - NeighborNet for visualizing conflicting signals (reticulation)

- **Contamination detection** — Identifying manuscript traditions that
  cross-pollinated (mixture), using:
  - Consistency index analysis
  - Split decomposition
  - Coherence-Based Genealogical Method (CBGM) compatibility analysis

- **Traditional stemmatic reconstruction** — Support for Lachmannian method with
  error genealogy, conjunctive/separative error identification, and archetype
  reconstruction

- **Stemma visualization** — Interactive tree diagrams with confidence
  indicators, alternative stemma proposals, and export to Newick/Nexus format

#### 3.5 Critical Apparatus Generation

- **Apparatus format support**
  - Positive apparatus (lists all witnesses for each reading)
  - Negative apparatus (lists only witnesses that diverge from base text)
  - Mixed apparatus (Nestle-Aland style)
  - Leiden conventions (for epigraphic texts)
  - Sigla and abbreviation management

- **Apparatus entry composition**
  - Automatic generation from collation data
  - Manual refinement with scholarly judgments
  - Witness grouping and citation shorthand (e.g., "Majority Text" notation)
  - Cross-reference linking between apparatus entries

- **Print-quality output** — Typography-aware rendering of apparatus with proper
  Unicode support for all scripts, superscript sigla, and traditional apparatus
  layout conventions

#### 3.6 Lacuna Tracking

- **Physical lacuna registry** — Documenting physical damage to manuscripts:
  extent, probable cause, any partial legibility
- **Reconstructed readings** — Proposed restorations with confidence levels,
  supporting evidence from parallel witnesses or formulaic patterns
- **Lacuna visualization** — Showing gaps in the text with overlay of proposed
  restorations and their supporting evidence

---

### 4. Canonical Text Management (`@nisaba/canon`)

Reference systems for the world's major canonical text collections, enabling
precise citation and cross-referencing across traditions.

#### 4.1 Biblical Canon Systems

- **Protestant canon** — 66 books (39 OT + 27 NT), chapter/verse reference
  system
- **Catholic canon** — 73 books (includes Tobit, Judith, 1-2 Maccabees, Wisdom,
  Sirach, Baruch, additions to Daniel and Esther)
- **Orthodox canons** — Greek Orthodox (includes 1 Esdras, Prayer of Manasseh,
  Psalm 151, 3 Maccabees, 4 Maccabees), Ethiopian Orthodox (broader canon
  including 1 Enoch, Jubilees)
- **Hebrew Bible (Tanakh)** — Torah/Nevi'im/Ketuvim ordering, verse numbering
  differences from Christian OT
- **Septuagint (LXX)** — Rahlfs numbering, chapter/verse mapping to MT
- **Versification mapping** — Automated conversion between versification systems
  (MT ↔ LXX ↔ English, Psalm numbering differences, etc.)

#### 4.2 Quranic Reference System

- **Surah/ayah** numbering (114 surahs)
- **Juz, hizb, rub** divisions
- **Qira'at** (variant readings) tracking for the 10 canonical readings (Hafs,
  Warsh, Qalun, etc.)
- **Asbab al-nuzul** (occasions of revelation) linking

#### 4.3 Buddhist Canon Systems

- **Pali Canon (Tipitaka)**
  - PTS (Pali Text Society) page numbering
  - Thai, Burmese, Sinhalese edition numbering
  - Sutta/Nikaya reference (e.g., DN 22, MN 10, SN 56.11)
  - Vinaya reference system
  - Abhidhamma reference system

- **Chinese Buddhist Canon**
  - Taishō Tripiṭaka (大正新脩大藏經) — T. volume/page/column/line
  - CBETA reference system
  - Dunhuang manuscript numbering

- **Tibetan Buddhist Canon**
  - Kangyur/Tengyur classification
  - Derge (sDe dge) edition numbering
  - Peking, Narthang, Cone edition cross-referencing
  - Tohoku catalog numbers

#### 4.4 Hindu Scripture Reference Systems

- **Vedic literature**
  - Rigveda: mandala/sukta/mantra
  - Samaveda, Yajurveda (Shukla/Krishna), Atharvaveda
  - Brahmanas, Aranyakas, Upanishads (Mukhya and minor)

- **Epic literature**
  - Mahabharata: parva/chapter/verse (critical edition numbering, Vulgate
    numbering)
  - Ramayana: kanda/sarga/shloka (critical edition, Vulgate)
  - Bhagavad Gita: chapter/verse (adhyaya/shloka)

- **Puranic and Sutra literature**
  - Major Puranas reference system
  - Yoga Sutras: pada/sutra
  - Brahma Sutras: adhyaya/pada/sutra
  - Dharmasutras and Dharmashastras

#### 4.5 Jewish Textual Reference Systems

- **Talmud** — Tractate/folio/amud (e.g., Berakhot 6a)
- **Mishnah** — Seder/tractate/chapter/mishnah
- **Tosefta** — Tractate/chapter/halakha
- **Midrash** — Collection/parasha/section
- **Zohar** — Section/page reference
- **Responsa** — Author/collection/number

#### 4.6 Classical Text Reference Systems

- **Greek texts**
  - Stephanus pages (Plato)
  - Bekker pages (Aristotle)
  - Diels-Kranz numbering (Pre-Socratics)
  - Standard line numbering (Homer, tragedy, comedy)

- **Latin texts**
  - Standard chapter/section (Cicero, Seneca)
  - Book/chapter/section (Livy, Tacitus)
  - Line numbering (Vergil, Ovid, Horace)

- **Other classical systems**
  - Avesta: yasna/ha/paragraph
  - Confucian Analects: book/chapter
  - Daodejing: chapter
  - I Ching: hexagram/line

#### 4.7 Cross-System Reference Resolution

- **Canonical URI scheme** — Uniform resource identifiers for any passage in any
  tradition: `nisaba://tradition/work/reference` (e.g.,
  `nisaba://bible/gen/1:1`, `nisaba://quran/2:255`, `nisaba://pali/dn/22`,
  `nisaba://gita/2/47`)
- **CTS/CITE compatibility** — Compliance with the Canonical Text Services
  protocol for interoperability with Perseus and other digital humanities
  infrastructure
- **Bidirectional mapping** — Convert between reference systems (e.g., LXX Psalm
  50 ↔ MT Psalm 51 ↔ English Psalm 51)

---

### 5. Paleographic Analysis (`@nisaba/paleography`)

Machine learning-assisted analysis of manuscript hands, script styles, and
physical features of written artifacts, supporting dating, provenance
estimation, and scribal identification.

#### 5.1 Script Classification

- **Writing system identification** — ML classifier for identifying script type
  from manuscript images (cuneiform, hieroglyphic, Hebrew square script, Greek
  uncial/minuscule, Devanagari, etc.)
- **Period classification** — Estimating the date range of a manuscript based on
  script features (e.g., distinguishing Hasmonean from Herodian Hebrew hands in
  Dead Sea Scrolls)
- **Regional classification** — Identifying scribal schools and regional
  traditions by distinctive letterform features

#### 5.2 Letterform Analysis

- **Feature extraction** — Quantitative measurement of letterform features:
  stroke angle, aspect ratio, serif presence, ligature patterns, ductus (stroke
  order and direction)
- **Statistical comparison** — Comparing letterform measurements across
  manuscripts for scribal hand identification and grouping
- **Evolution tracking** — Tracing how specific letterforms evolved over
  centuries within a writing tradition

#### 5.3 Scribal Hand Identification

- **Writer identification** — ML models trained on known scribal hands to
  identify whether multiple manuscripts were written by the same scribe
- **Collaborative vs. single scribe** — Detecting hand changes within a single
  manuscript (section boundaries, later additions, corrections)
- **Scribal habit profiling** — Cataloging the spelling preferences,
  abbreviation patterns, and error tendencies of identified scribes

#### 5.4 Damaged Text Enhancement

- **Multispectral imaging integration** — Ingesting multispectral image data
  (infrared, ultraviolet, X-ray fluorescence) for reading faded or erased text
  (palimpsests)
- **AI-assisted reading** — ML models trained on fragmentary texts to suggest
  probable letter readings for damaged or partially legible characters
- **Confidence scoring** — Per-character confidence levels for automated
  readings, integrated into the textual criticism workflow

#### 5.5 Dating Estimation

- **Multi-factor dating** — Combining paleographic features, orthographic
  conventions, material analysis data, and radiocarbon calibration curves
- **Probability distributions** — Date estimates expressed as probability
  distributions rather than point estimates (e.g., "70% probability between
  150-50 BCE")
- **Calibration against dated manuscripts** — Using securely dated manuscripts
  as calibration anchors for the dating model

---

### 6. Philological Analysis (`@nisaba/philology`)

Advanced linguistic analysis tools for deep scholarly work with texts:
etymology, semantic fields, discourse patterns, intertextuality, and statistical
linguistics.

#### 6.1 Etymology Tracking

- **Cross-language cognate chains** — Tracing words across language families:
  - Proto-Semitic roots → Hebrew, Aramaic, Arabic, Akkadian, Ugaritic, Ge'ez
  - Proto-Indo-European roots → Sanskrit, Greek, Latin, Avestan, Old Persian
  - Sino-Tibetan root relationships
  - Egyptian-Coptic etymological continuity

- **Semantic drift visualization** — Showing how word meanings shifted across
  languages and centuries (e.g., Hebrew _ruach_ → "wind/breath/spirit" → Greek
  _pneuma_ → Latin _spiritus_)

- **Loanword detection** — Identifying borrowed words across language boundaries
  (e.g., Sumerian loanwords in Akkadian, Persian loanwords in Biblical Hebrew,
  Sanskrit loanwords in Pali)

#### 6.2 Semantic Field Analysis

- **Domain mapping** — Grouping words into semantic domains following
  established frameworks (Louw-Nida for NT Greek, Semantic Dictionary of
  Biblical Hebrew approach)
- **Cross-linguistic semantic fields** — Comparing how different languages
  partition the same conceptual space (e.g., the range of Hebrew _chesed_ vs.
  Greek _agape/philia/eros_ vs. Sanskrit _prema/bhakti/karuna_)
- **Collocational analysis** — Identifying statistically significant word
  co-occurrences and fixed phrases
- **Metaphor mapping** — Systematic cataloging of conceptual metaphors across
  traditions (Lakoff-Johnson framework applied to ancient texts)

#### 6.3 Hapax Legomena Detection

- **Hapax identification** — Automatic flagging of words occurring only once in
  a corpus (hapax legomena) or only twice (dis legomena)
- **Cross-corpus checking** — Determining if a hapax in one corpus occurs in
  related corpora (e.g., a NT hapax that appears in LXX or Pseudepigrapha)
- **Meaning estimation** — AI-assisted meaning proposals for hapax legomena
  based on morphological analysis, cognate languages, and context

#### 6.4 Word Frequency & Statistical Linguistics

- **Corpus frequency analysis** — Word frequency lists, type-token ratios,
  vocabulary richness metrics (Yule's K, Simpson's D, hapax percentage)
- **Authorship attribution** — Stylometric analysis using function word
  frequencies, sentence length distributions, and vocabulary overlap (supporting
  disputed authorship questions, e.g., Pauline epistles, Isaianic unity)
- **Register analysis** — Distinguishing prose from poetry, narrative from
  discourse, legal from prophetic, based on statistical profiles

#### 6.5 Discourse Analysis

- **Chiastic structure detection** — Automatic identification of chiasmus
  (A-B-B'-A' patterns) in texts, a common literary device in Semitic and Greek
  literature
- **Ring composition** — Detecting Homeric ring composition and similar
  large-scale structural patterns
- **Inclusio detection** — Identifying framing devices where a passage begins
  and ends with the same word or phrase
- **Discourse boundary markers** — Automatic segmentation using discourse
  markers, topic shifts, participant changes, and temporal indicators
- **Narrative analysis** — Character tracking, speech/narration distinction,
  reported speech nesting

#### 6.6 Intertextuality Detection

- **Quotation detection** — Identifying explicit quotations of earlier texts in
  later ones (e.g., OT quotations in the NT, Vedic citations in Upanishads)
- **Allusion detection** — Identifying probable but inexact references to
  earlier texts, using shared vocabulary clusters, thematic parallels, and
  structural similarities
- **Echo detection** — Identifying faint thematic or verbal resonances that may
  or may not represent conscious literary dependence
- **Influence scoring** — Quantifying the probability and strength of
  intertextual connections, with confidence levels and supporting evidence
- **Dependency direction** — Analyzing which text is the source and which the
  dependent, using chronological, linguistic, and contextual evidence

---

### 7. Comparative Traditions Framework (`@nisaba/comparative`)

The distinctive capability that separates Nisaba from all existing tools:
systematic, evidence-based comparison of concepts, practices, narratives, and
insights across the world's philosophical and religious traditions.

#### 7.1 Cross-Tradition Concept Mapping

- **Concept equivalence registry** — Curated, scholar-reviewed mappings of
  analogous concepts across traditions, with nuanced similarity ratings:
  - **Ineffability of the ultimate**: Tao (道, Taoism) ~ Brahman (ब्रह्मन्,
    Hinduism) ~ Sunyata (शून्यता, Buddhism) ~ Ein Sof (אין סוף, Kabbalah) ~
    Theologia Negativa (Christianity) ~ Fana (فناء, Sufism)
  - **Liberation/salvation**: Moksha ~ Nirvana ~ Theosis ~ Salvation ~ Fana ~ Wu
    Wei
  - **Universal ethical principle**: Golden Rule (Confucius, Hillel, Jesus,
    Muhammad, Buddhist precepts)
  - **Logos/cosmic order**: Logos (λόγος) ~ Rta/Dharma (ऋत/धर्म) ~ Ma'at (𓅓𓂣𓏏) ~
    Tao (道) ~ Torah (תורה)
  - **Self-transcendence**: Anatta ~ Fana ~ Kenosis ~ Bittul HaYesh ~ Wu Wei

- **Similarity taxonomy** — Each mapping classified by type:
  - Genetic (historical influence or common source)
  - Typological (independent parallel development)
  - Analogical (structural similarity without semantic identity)
  - Contested (scholars disagree on the relationship)

- **Evidence requirements** — Every concept mapping must cite primary sources,
  scholarly literature, and specify the level of scholarly consensus

#### 7.2 Parallel Passage Detection

- **Cross-tradition parallel finder** — Algorithms for detecting thematically
  parallel passages across traditions:
  - Semantic similarity using multilingual embeddings
  - Motif-based matching using a controlled vocabulary of narrative motifs
    (Thompson Motif-Index compatible)
  - Structural parallel detection (similar narrative arcs, argument patterns)

- **Cultural context weighting** — Adjusting similarity scores based on the
  historical plausibility of influence:
  - Known trade routes and cultural contact
  - Chronological ordering (earlier text cannot borrow from later)
  - Geographic proximity
  - Linguistic relatedness

- **Parallel quality classification**
  - Verbatim parallel (direct translation or quotation)
  - Close parallel (same content, different expression)
  - Thematic parallel (same theme, different treatment)
  - Structural parallel (same literary structure, different content)
  - Typological parallel (independent development of similar ideas)

#### 7.3 Motif & Theme Tracking

- **Universal motif catalog** — Comprehensive database of cross-cultural motifs:
  - Creation narratives (ex nihilo, cosmic egg, world parents, emergence)
  - Flood narratives (Gilgamesh/Atrahasis, Genesis, Manu, Deucalion, Yu)
  - Descent to the underworld (Inanna, Orpheus, Aeneas, Izanagi)
  - Divine sacrifice (Purusha, Odin, Christ, Osiris)
  - The teacher's last words (Buddha's parinirvana, Socrates' Phaedo, Jesus's
    farewell discourse)
  - Ineffability of the divine (see Vision section above)
  - The perennial "via negativa" across traditions

- **Motif attestation tracking** — For each motif, tracking every known
  attestation with date, tradition, text reference, and scholarly commentary

- **Theme evolution timelines** — Visualizing how a theme (e.g., "the soul after
  death") developed across traditions and centuries

#### 7.4 Influence Network Mapping

- **Historical influence graph** — Directed graph showing documented and
  proposed channels of influence between traditions:
  - Zoroastrian → Jewish → Christian → Islamic eschatology
  - Greek philosophy → Hellenistic Judaism → Christian theology
  - Upanishadic thought → Buddhist philosophy → East Asian Buddhism
  - Neoplatonism → Christian mysticism → Islamic philosophy (falsafa)
  - Silk Road exchanges between Buddhist, Manichaean, Nestorian, and Islamic
    traditions

- **Evidence-graded edges** — Each influence claim graded by evidence:
  - Documented (explicit citation or acknowledged borrowing)
  - Strong (scholarly consensus with textual evidence)
  - Probable (majority scholarly view with circumstantial evidence)
  - Possible (proposed by some scholars, debated)
  - Speculative (proposed but lacking strong evidence)

#### 7.5 Synoptic Cross-Tradition Views

- **Synoptic reader** — Side-by-side display of thematically parallel passages
  from multiple traditions, with scholarly commentary on the parallels
- **Configurable comparison sets** — Scholar-defined groups of texts for
  comparison (e.g., "creation accounts," "afterlife descriptions," "meditation
  instructions")
- **Annotation layer for parallels** — Collaborative annotation system for
  noting and discussing cross-tradition parallels

---

### 8. Open-Source Corpora Integration (`@nisaba/corpora`)

Connectors to the world's major digital text repositories, enabling Nisaba to
serve as a unified interface to humanity's textual heritage.

#### 8.1 Classical & Ancient Near Eastern Corpora

- **Perseus Digital Library** — Greek and Latin texts with morphological data,
  English translations, and commentary
- **ETCSL (Electronic Text Corpus of Sumerian Literature)** — Complete Sumerian
  literary corpus with transliteration and translation
- **CDLI (Cuneiform Digital Library Initiative)** — Cuneiform tablet catalog
  with ATF transliterations and images
- **ORACC (Open Richly Annotated Cuneiform Corpus)** — Annotated cuneiform texts
  across multiple projects
- **TLG (Thesaurus Linguae Graecae)** — Comprehensive Greek text database
  (license-aware integration)
- **PHI (Packard Humanities Institute)** — Latin texts and Greek inscriptions
- **Corpus Inscriptionum Latinarum (CIL)** — Latin inscriptions
- **Digital Corpus of Literary Papyri (DCLP)** — Papyrological texts

#### 8.2 Biblical & Jewish Corpora

- **SWORD modules** — CrossWire Bible Society module format (dozens of Bible
  translations, original language texts, lexica, commentaries)
- **USFM/USX** — United Bible Societies standard for Bible text markup
- **OSIS** — Open Scripture Information Standard XML
- **Dead Sea Scrolls Digital Library** — Israel Antiquities Authority digital
  images and transcriptions
- **Sefaria** — Jewish texts (Talmud, Midrash, Halakha, Kabbalah) via open API
- **CAL (Comprehensive Aramaic Lexicon)** — Aramaic text corpus and lexicon
- **ETCBC (Eep Talstra Centre for Bible and Computer)** — Morphologically
  analyzed Hebrew Bible database

#### 8.3 South & East Asian Corpora

- **SuttaCentral** — Pali, Chinese, Sanskrit, and Tibetan Buddhist texts with
  translations and parallels
- **CBETA (Chinese Buddhist Electronic Text Association)** — Complete Chinese
  Buddhist canon
- **SARIT (Search and Retrieval of Indic Texts)** — Sanskrit and Prakrit texts
  in TEI-XML
- **Digital Corpus of Sanskrit** — University of Heidelberg Sanskrit texts
- **GRETIL (Göttingen Register of Electronic Texts in Indian Languages)** —
  Broad collection of Indic texts
- **Thesaurus Literaturae Buddhicae (TLB)** — Tibetan Buddhist texts
- **SAT (SAT Daizōkyō Text Database)** — Japanese Buddhist text database
- **CTP (Chinese Text Project)** — Pre-modern Chinese texts (Confucian, Taoist,
  Legalist, etc.)
- **Kanripo** — Kanbun texts

#### 8.4 Islamic Corpora

- **OpenITI (Open Islamicate Texts Initiative)** — Arabic and Persian texts,
  machine-readable, with mARkdown format
- **Quranic Arabic Corpus** — Morphologically analyzed Quran with syntactic
  treebank
- **Altafsir.com data** — Classical Quranic commentaries (tafsir)
- **Kitab Project** — Text reuse detection across Arabic literary tradition
- **HathiTrust Arabic collection** — Digitized Arabic print books

#### 8.5 Integration Standards

- **TEI-XML import/export** — Full TEI P5 support, including EpiDoc for
  epigraphic texts
- **IIIF integration** — International Image Interoperability Framework for
  manuscript images (Presentation API v3, Image API v3)
- **CTS/CITE protocol** — Canonical Text Services for interoperability with the
  digital humanities ecosystem
- **Linked Open Data** — RDF export, SPARQL endpoint compatibility, alignment
  with Pelagios, Pleiades, PeriodO
- **Custom connector framework** — Extensible plugin architecture for adding new
  corpus integrations

---

### 9. Annotation & Commentary System (`@nisaba/annotations`)

A flexible, multi-layer annotation system inspired by the layered commentary
traditions of rabbinic Judaism (Mishnah → Gemara → Rashi → Tosafot) and medieval
scholastic glossing.

#### 9.1 Standoff Annotation Architecture

- **W3C Web Annotation Data Model** — Full compliance with the W3C standard for
  interoperable annotations
- **Standoff markup** — Annotations stored separately from base text, referenced
  by character offset ranges, enabling multiple overlapping annotation layers
  without markup conflict
- **Annotation types** — Extensible type system including:
  - Textual notes (commentary, explanation, cross-reference)
  - Linguistic annotations (morphological, syntactic, semantic)
  - Translation annotations (gloss, paraphrase, formal translation)
  - Critical annotations (variant readings, emendation proposals)
  - Comparative annotations (cross-tradition parallel markers)
  - Structural annotations (discourse markers, chiastic boundaries)
  - Pedagogical annotations (difficulty level, prerequisite knowledge)

#### 9.2 Layered Commentary Model

- **Talmudic layering paradigm** — Supporting the pattern where commentary
  begets commentary:
  - Base text layer (the primary text being studied)
  - First commentary layer (direct commentary on the base text)
  - Super-commentary layer (commentary on the commentary)
  - Marginalia layer (informal notes, questions, references)
  - Modern scholarly layer (contemporary academic commentary)

- **Historical layering** — Displaying how commentary has accumulated over
  centuries, with each layer dated and attributed

- **Scholastic gloss system** — Medieval-style interlinear and marginal gloss
  placement, supporting the visual conventions of manuscript glossing traditions

#### 9.3 Collaborative Annotation

- **Real-time collaborative editing** — Multiple scholars annotating
  simultaneously with conflict resolution (CRDT-based)
- **Annotation review workflow** — Draft → Review → Published pipeline with peer
  review capabilities
- **Permission model** — Private annotations, team-shared annotations, and
  publicly published annotations
- **Discussion threads** — Threaded conversations attached to specific
  annotations for scholarly debate

#### 9.4 Export Formats

- **W3C Web Annotation (OA/WADM)** — Standard JSON-LD export
- **TEI-XML** — Annotations embedded in or linked to TEI documents
- **Hypothesis-compatible** — Integration with the Hypothesis open annotation
  platform
- **PDF annotation** — Export annotations as PDF markup for print review
- **Custom JSON** — Structured export for downstream analysis

---

### 10. Digital Critical Edition Tools (`@nisaba/editions`)

A complete publishing pipeline for producing digital and print-ready critical
editions of texts, the gold standard of textual scholarship.

#### 10.1 Edition Project Management

- **Project lifecycle** — Create, manage, and version critical edition projects
  with multiple collaborators
- **Base text selection** — Tools for selecting and justifying the base text
  (editio princeps, best manuscript, reconstructed archetype, eclectic text)
- **Witness management** — Linking the edition to its collation data and
  manuscript registry from `@nisaba/criticism`

#### 10.2 Apparatus Entry

- **Apparatus composition interface** — Visual tool for creating apparatus
  entries, with:
  - Lemma selection from base text
  - Variant reading entry with witness sigla
  - Scholarly judgment annotations (preferred reading, uncertainty markers)
  - Cross-reference to other apparatus entries
  - Links to full collation data

- **Apparatus types**
  - Textual apparatus (variant readings)
  - Source apparatus (Quellenapparat — identifying sources and parallels)
  - Commentary apparatus (references to scholarly discussion)
  - Translation apparatus (significant translation differences)

#### 10.3 Export & Publishing

- **TEI-XML export** — Full TEI P5 critical edition encoding, including `<app>`,
  `<rdg>`, `<wit>`, `<lem>` elements
- **EpiDoc export** — TEI-based encoding for epigraphic and papyrological
  editions
- **Print-ready PDF** — LaTeX-quality typesetting with:
  - Critical edition conventions (apparatus at page bottom, line numbering,
    section headers)
  - Multi-script support (Hebrew, Greek, Arabic, Devanagari in the same page)
  - Proper apparatus typography (sigla, brackets, dashes)
  - Configurable page layout (single column, double column, facing pages)
- **HTML digital edition** — Interactive web-based edition with clickable
  apparatus, manuscript image integration, and dynamic filtering

#### 10.4 Collaborative Editing Workflows

- **Role-based access** — Editor-in-chief, section editors, apparatus editors,
  reviewers
- **Version control** — Full version history for every element of the edition
  (base text, apparatus, introduction, notes)
- **Semantic versioning** — Major/minor/patch versioning for published editions
  (e.g., v2.1.0 indicates second major edition, first revision, no patches)
- **Review pipeline** — Structured review process with approval gates for
  publication

---

### 11. Temporal-Geographic Mapping (`@nisaba/geotemporal`)

Spatial and temporal tools for understanding the physical and chronological
context of texts, manuscripts, traditions, and scholarly figures.

#### 11.1 Manuscript Provenance Tracking

- **Provenance chains** — Tracking the ownership and location history of
  manuscripts from creation to current repository
- **Scriptoria mapping** — Locating known writing centers and their
  characteristic productions
- **Trade and transmission routes** — Visualizing how manuscripts traveled
  between centers of learning

#### 11.2 Tradition Spread Visualization

- **Diffusion maps** — Animated maps showing how traditions spread
  geographically over time:
  - Buddhism from northeast India through Central Asia to China, Korea, Japan
  - Christianity from Palestine through the Roman Empire and beyond
  - Islam from Arabia through the Middle East, North Africa, Central Asia,
    Southeast Asia
  - Greek philosophy from Ionia through Athens to Alexandria and the Islamic
    world

- **Center-of-gravity analysis** — Tracking where the intellectual center of a
  tradition was located at different periods

#### 11.3 Archaeological & Geographic Integration

- **Pleiades gazetteer** — Integration with the Pleiades ancient world gazetteer
  for precise place identification
- **PeriodO** — Integration for standardized historical period definitions
- **Historical atlas** — Period-accurate boundary maps (not projecting modern
  national boundaries onto the ancient world)
- **Excavation context** — Linking texts (especially inscriptions, tablets,
  papyri) to their archaeological findspots

#### 11.4 Timeline Engine

- **Multi-calendar support** — Display dates in multiple calendar systems
  simultaneously:
  - Gregorian / Julian
  - Hebrew calendar
  - Islamic (Hijri) calendar
  - Buddhist calendar
  - Hindu calendars (Vikram Samvat, Shaka Samvat)
  - Egyptian calendar
  - Athenian calendar
  - Chinese traditional calendar
  - Seleucid era, Olympiad dating

- **Fuzzy dating** — Support for imprecise dates common in ancient studies:
  - "ca. 500 BCE" (approximately)
  - "6th-5th century BCE" (range)
  - "Pre-exilic" (relative to an event)
  - "Ptolemaic period" (named period)
  - Terminus post quem / ante quem

- **Synchronized timelines** — Multiple parallel timelines showing
  contemporaneous events across traditions

#### 11.5 Spatial Search

- **Geographic queries** — "Find all texts composed within 100km of Alexandria
  between 300 BCE and 200 CE"
- **Tradition overlay** — Map showing the geographic extent of a tradition at a
  given date, overlaid with known text production sites
- **Route-based search** — Search along trade routes (Silk Road, Via Maris,
  King's Highway) for cultural contact evidence

---

### 12. AI Scholarly Assistant (`@nisaba/assistant`)

An AI-powered research assistant specifically trained for the domain of ancient
text analysis, providing translation assistance, commentary drafting, variant
evaluation, and research guidance — always grounded in verifiable sources.

#### 12.1 AI Translation Assistance

- **Morphological explanation** — For any word in an ancient text, providing
  full morphological parsing with plain-language explanation of every
  grammatical feature
- **Translation options** — Presenting multiple translation possibilities for
  ambiguous words/phrases with scholarly justification for each
- **Contextual disambiguation** — Using surrounding context and parallel
  passages to recommend the most likely meaning
- **Translation drafting** — AI-assisted first-draft translation of unpublished
  or under-studied texts, with confidence markers and notes on uncertain
  readings

#### 12.2 Commentary Draft Generation

- **Grounded commentary** — AI-generated commentary drafts that:
  - Cite specific scholarly sources (verified via Sophia RAG pipeline)
  - Reference parallel passages with precise citations
  - Explain textual variants and their implications
  - Discuss philological issues (etymology, semantic range, hapax legomena)
  - Never fabricate citations or make unsourced claims

- **Style templates** — Commentary in various scholarly styles:
  - Exegetical (verse-by-verse analysis)
  - Thematic (topic-organized discussion)
  - Historical-critical (source analysis, Sitz im Leben)
  - Comparative (cross-tradition perspective)
  - Philological (language-focused)

#### 12.3 Variant Evaluation

- **Internal evidence analysis** — AI assessment of variant readings using
  traditional text-critical criteria:
  - Lectio difficilior potior (the harder reading is preferred)
  - Lectio brevior (shorter reading preferred, with exceptions)
  - Scribal tendency analysis (harmonization, clarification)
  - Conformity to author's style and vocabulary

- **External evidence analysis** — Evaluating manuscript support:
  - Geographic distribution of witnesses
  - Chronological range of attestation
  - Quality and independence of witnesses
  - Agreement of versional and patristic evidence

#### 12.4 Research Question Formulation

- **Research gap identification** — AI analysis of existing scholarship to
  identify under-explored questions and potential research directions
- **Bibliography discovery** — Finding relevant scholarly literature using
  Sophia's knowledge base and external bibliographic databases
- **Methodology suggestion** — Recommending appropriate analytical methods for
  specific research questions

#### 12.5 Linguistic Dating Analysis

- **Vocabulary dating** — Assessing the probable date of composition based on
  vocabulary (e.g., late Biblical Hebrew features vs. early)
- **Syntactic dating** — Using grammatical features characteristic of specific
  periods
- **Orthographic dating** — Analyzing spelling conventions as chronological
  indicators
- **Statistical confidence** — Providing probability distributions for estimated
  dates of composition

#### 12.6 Domain-Specific Prompt Library

- **Curated prompts** — Pre-built, expert-reviewed prompt templates for common
  scholarly tasks:
  - "Parse this Hebrew/Greek/Sanskrit passage morphologically"
  - "Compare these two translations and identify significant divergences"
  - "Evaluate the textual variants at this passage"
  - "Identify possible intertextual allusions in this passage"
  - "Draft a philological note on this hapax legomenon"
  - "Trace this concept across traditions"
  - "Summarize the scholarly debate on this passage"

---

### 13. Import/Export Standards (`@nisaba/standards`)

Comprehensive support for scholarly data exchange standards, ensuring Nisaba can
interoperate with every major digital humanities platform and tool.

#### 13.1 Text Encoding Standards

- **TEI-XML (P5)** — Full support for the Text Encoding Initiative standard, the
  lingua franca of digital humanities:
  - Header metadata (teiHeader)
  - Structural encoding (div, p, l, lg, sp, stage)
  - Critical apparatus (app, lem, rdg, wit, witDetail)
  - Named entity markup (persName, placeName, orgName)
  - Linguistic annotation (w, pc, s with morphological attributes)
  - Manuscript description (msDesc)
  - Bibliographic data (bibl, biblStruct)

- **EpiDoc** — TEI-based encoding for ancient documents, especially inscriptions
  and papyri:
  - Leiden convention rendering
  - Apparatus criticus
  - Physical description of text-bearing objects
  - Translation and commentary

- **OSIS (Open Scripture Information Standard)** — XML encoding for Bible texts
  with cross-reference support

- **USFM/USX** — United Bible Societies formats for Bible translation data

#### 13.2 Reference & Citation Standards

- **CTS/CITE** — Canonical Text Services and Collections, Indices, Texts, and
  Extensions protocol for stable text references
- **BibTeX/RIS/CSL** — Import/export of bibliographic data in all major citation
  manager formats
- **Zotero integration** — Direct import/export with Zotero libraries via Zotero
  API

#### 13.3 Linked Data Standards

- **RDF/SPARQL** — Export knowledge graph data as RDF triples, queryable via
  SPARQL endpoint
- **JSON-LD** — Linked Data in JSON format for web integration
- **Pelagios/Recogito** — Interoperability with the Pelagios network for
  geo-historical annotation
- **Wikidata alignment** — Entity matching with Wikidata items for
  disambiguation and enrichment

#### 13.4 Image Standards

- **IIIF** — International Image Interoperability Framework:
  - Presentation API v3 (manifest generation for manuscript viewers)
  - Image API v3 (deep zoom, region extraction, format conversion)
  - Content Search API (search within annotations on images)
  - Integration with Mirador, Universal Viewer, and other IIIF clients

#### 13.5 Annotation Standards

- **W3C Web Annotation** — Full compliance with the Web Annotation Data Model
  and Web Annotation Protocol
- **Hypothesis compatibility** — Export/import with the Hypothesis annotation
  platform

---

### 14. Scholarly Workspace (`@nisaba/workspace`)

The user-facing research environment that brings together all of Nisaba's
capabilities into a unified, configurable workspace for scholars.

#### 14.1 Research Project Management

- **Project containers** — Organize research into projects with shared
  resources, team members, and permissions
- **Project templates** — Pre-configured setups for common research types:
  - Critical edition project
  - Translation project
  - Comparative study
  - Philological analysis
  - Survey of manuscript tradition
- **Progress tracking** — Research milestones, task assignment, and
  collaboration dashboards

#### 14.2 Configurable Reading Environment

- **Split-pane layout** — Configurable multi-pane workspace showing text,
  translation, apparatus, commentary, lexicon, images simultaneously
- **Morphological popups** — Hover over any word in an ancient text to see full
  parsing, glosses, and lexicon entries
- **Lexicon panel** — Persistent side panel with full dictionary entries, linked
  to the cursor position in the text
- **Keyboard navigation** — Full keyboard control for power users (vim-style
  keybindings available)
- **Theme and typography** — Configurable fonts (including specialist scholarly
  fonts for ancient scripts), theme (light/dark), and font size

#### 14.3 Cross-Corpora Search

- **Unified search** — Single search interface across all loaded corpora,
  supporting:
  - Lemma-aware search (find all inflected forms of a root)
  - Morphology-aware search (find all aorist passive participles)
  - Semantic search (find passages about "divine mercy" across languages)
  - Regex search with script-aware character classes
  - Boolean operators (AND, OR, NOT, NEAR/n)
  - Field-restricted search (author, title, tradition, date range)

- **Search result enrichment** — Results displayed with:
  - Morphological parsing of matched terms
  - Context preview with highlighted matches
  - Tradition and date metadata
  - Relevance scoring explanation

#### 14.4 Personal Library

- **Document upload** — Upload personal texts in supported formats (TEI-XML,
  plain text, PDF, DOCX, EPUB) for integration into the research environment
- **Collection organization** — Folders, tags, and smart collections
- **Reading lists** — Curated reading lists with progress tracking
- **Bookmarks and highlights** — Personal markup of any text in any corpus

#### 14.5 Export Pipeline

- **PDF export** — Publication-quality PDF with:
  - Critical apparatus (if applicable)
  - Footnotes and endnotes
  - Multi-script support
  - Configurable citation style

- **DOCX export** — Microsoft Word format for submission to journals and
  publishers
- **LaTeX export** — For scholars who work in LaTeX, including BibTeX
  bibliography and critical edition macros (reledmac/reledpar)
- **HTML export** — Standalone web page or embedded widget

#### 14.6 Citation Manager Integration

- **Sophia citation system** — Direct integration with Sophia's citation
  infrastructure (`@sophia/schemas` — citation schemas) for source management,
  bibliography generation, and citation verification
- **External citation managers** — Import/export with Zotero, Mendeley, EndNote
  via BibTeX, RIS, and CSL-JSON
- **Inline citation insertion** — Insert properly formatted citations into
  documents directly from the citation manager

---

## Technology Stack

### Core Technologies

- **Language**: TypeScript (primary), Rust compiled to WASM (morphological
  parsers, collation algorithms, and other performance-critical paths)
- **Runtime**: Node.js with WASM modules for performance-critical operations
- **Database**: PostgreSQL with `nisaba` schema (separate from Sophia), pgvector
  for local embeddings where needed
- **Cache**: Redis for session data, search result caching, and
  frequently-accessed reference data
- **Vector Search**: Via Sophia/Qdrant integration for semantic search across
  corpora
- **Schema Validation**: Zod for runtime type checking of all API boundaries
- **Testing**: Vitest for unit and integration tests
- **Build**: Nx with esbuild/swc, integrated WASM build via wasm-pack for Rust
  modules
- **XML Processing**: `fast-xml-parser` for TEI-XML, OSIS, and other XML formats
- **Collation**: Custom TypeScript implementation of Dekker's variant graph
  algorithm (CollateX-compatible)

### AI Model Integration

- **LLM access**: Via shared `@oshun/ai` library (OpenAI, Anthropic)
- **Embeddings**: Multilingual embedding models via Sophia pipeline (optimized
  for ancient language vocabulary)
- **Custom fine-tuning**: Provision for fine-tuned models on domain-specific
  tasks (morphological parsing, dating estimation, scribal hand identification)
- **RAG pipeline**: Sophia's document ingestion and retrieval infrastructure
  with Nisaba-specific chunking strategies

### Platform Support

- **Web**: Next.js application via the Oshun web platform
- **API**: RESTful API for programmatic access to all Nisaba capabilities
- **CLI**: Command-line tools for batch processing (corpus import, collation,
  export)

---

## Library Structure

```
libs/nisaba/
|
+-- core/                                 # Core domain types, constants, utilities
|   +-- src/
|   |   +-- types/                        # Shared type definitions
|   |   +-- constants/                    # Script codes, language codes, tradition IDs
|   |   +-- utils/                        # Common utility functions
|   |   +-- errors/                       # Domain-specific error types
|   |   +-- index.ts
|   +-- package.json
|   +-- project.json
|   +-- tsconfig.json
|
+-- schemas/                              # Zod schemas for all Nisaba data models
|   +-- src/
|   |   +-- manuscript.ts                 # Manuscript/witness schemas
|   |   +-- variant.ts                    # Textual variant schemas
|   |   +-- collation.ts                  # Collation result schemas
|   |   +-- apparatus.ts                  # Critical apparatus schemas
|   |   +-- annotation.ts                 # Annotation data model schemas
|   |   +-- edition.ts                    # Critical edition schemas
|   |   +-- reference.ts                  # Canonical reference schemas
|   |   +-- tradition.ts                  # Tradition/concept mapping schemas
|   |   +-- corpus.ts                     # Corpus metadata schemas
|   |   +-- paleography.ts               # Paleographic analysis schemas
|   |   +-- geotemporal.ts               # Geographic/temporal schemas
|   |   +-- index.ts
|   +-- package.json
|   +-- project.json
|   +-- tsconfig.json
|
+-- database/                             # Prisma schema, migrations, seeds
|   +-- prisma/
|   |   +-- schema.prisma                 # Nisaba database schema
|   |   +-- migrations/
|   |   +-- seed.ts                       # Reference data seeding
|   +-- src/
|   |   +-- client.ts                     # Prisma client configuration
|   |   +-- index.ts
|   +-- package.json
|   +-- project.json
|   +-- tsconfig.json
|
+-- languages/                            # Ancient Language Engine
|   +-- src/
|   |   +-- scripts/                      # Writing system definitions
|   |   |   +-- cuneiform.ts              # Cuneiform sign lists and encoding
|   |   |   +-- egyptian.ts               # Egyptian hieroglyphic encoding
|   |   |   +-- hebrew.ts                 # Hebrew script handling
|   |   |   +-- greek.ts                  # Greek script handling
|   |   |   +-- sanskrit.ts               # Sanskrit/Devanagari handling
|   |   |   +-- arabic.ts                 # Arabic script handling
|   |   |   +-- pali.ts                   # Pali multi-script support
|   |   |   +-- chinese.ts               # Classical Chinese handling
|   |   |   +-- latin.ts                  # Latin script handling
|   |   |   +-- tibetan.ts               # Tibetan script handling
|   |   |   +-- coptic.ts                # Coptic script handling
|   |   |   +-- syriac.ts                # Syriac script handling
|   |   |   +-- avestan.ts               # Avestan script handling
|   |   |   +-- index.ts
|   |   +-- morphology/                   # Morphological parsers
|   |   |   +-- hebrew-parser.ts          # Hebrew morphological analysis
|   |   |   +-- greek-parser.ts           # Greek morphological analysis
|   |   |   +-- latin-parser.ts           # Latin morphological analysis
|   |   |   +-- sanskrit-parser.ts        # Sanskrit morphological analysis
|   |   |   +-- arabic-parser.ts          # Arabic morphological analysis
|   |   |   +-- akkadian-parser.ts        # Akkadian morphological analysis
|   |   |   +-- sumerian-parser.ts        # Sumerian morphological analysis
|   |   |   +-- pali-parser.ts            # Pali morphological analysis
|   |   |   +-- coptic-parser.ts          # Coptic morphological analysis
|   |   |   +-- index.ts
|   |   +-- tokenization/                 # Language-specific tokenizers
|   |   |   +-- tokenizer.ts              # Base tokenizer interface
|   |   |   +-- hebrew-tokenizer.ts       # Hebrew clitic separation
|   |   |   +-- greek-tokenizer.ts        # Greek enclitic handling
|   |   |   +-- sanskrit-tokenizer.ts     # Sanskrit sandhi splitting
|   |   |   +-- arabic-tokenizer.ts       # Arabic proclitic/enclitic handling
|   |   |   +-- chinese-tokenizer.ts      # Classical Chinese segmentation
|   |   |   +-- index.ts
|   |   +-- transliteration/              # Transliteration engine
|   |   |   +-- engine.ts                 # Core transliteration logic
|   |   |   +-- schemes/                  # Romanization scheme definitions
|   |   |   +-- index.ts
|   |   +-- lexicon/                      # Lexicon integration
|   |   |   +-- interface.ts              # Unified lexicon lookup API
|   |   |   +-- bdb.ts                    # BDB integration
|   |   |   +-- lsj.ts                    # LSJ integration
|   |   |   +-- monier-williams.ts        # Monier-Williams integration
|   |   |   +-- lewis-short.ts            # Lewis & Short integration
|   |   |   +-- cad.ts                    # CAD integration
|   |   |   +-- psd.ts                    # PSD/ePSD2 integration
|   |   |   +-- pali-dict.ts              # PTS Pali dictionary integration
|   |   |   +-- lane.ts                   # Lane's Arabic lexicon integration
|   |   |   +-- index.ts
|   |   +-- index.ts
|   +-- rust/                             # Rust WASM modules for performance
|   |   +-- morphology/                   # High-performance morphological parsers
|   |   +-- sandhi/                       # Sanskrit sandhi decomposition
|   |   +-- Cargo.toml
|   +-- package.json
|   +-- project.json
|   +-- tsconfig.json
|
+-- translations/                         # Translation Comparison Engine
|   +-- src/
|   |   +-- display/                      # Display mode implementations
|   |   |   +-- side-by-side.ts           # Side-by-side view
|   |   |   +-- synoptic.ts              # Synoptic view
|   |   |   +-- interlinear.ts           # Interlinear view
|   |   |   +-- reverse-interlinear.ts   # Reverse interlinear view
|   |   |   +-- index.ts
|   |   +-- alignment/                    # Alignment algorithms
|   |   |   +-- gale-church.ts           # Sentence alignment
|   |   |   +-- word-alignment.ts        # Word-level alignment
|   |   |   +-- neural-alignment.ts      # Transformer-based alignment
|   |   |   +-- manual-alignment.ts      # Scholar-driven alignment
|   |   |   +-- index.ts
|   |   +-- divergence/                   # Divergence detection
|   |   |   +-- semantic.ts              # Semantic divergence scoring
|   |   |   +-- theological.ts           # Theological divergence flagging
|   |   |   +-- structural.ts            # Omission/addition detection
|   |   |   +-- equivalence.ts           # Formal/dynamic equivalence scoring
|   |   |   +-- index.ts
|   |   +-- history/                      # Translation history
|   |   |   +-- timeline.ts              # Chronological tracking
|   |   |   +-- influence.ts             # Influence mapping
|   |   |   +-- index.ts
|   |   +-- index.ts
|   +-- package.json
|   +-- project.json
|   +-- tsconfig.json
|
+-- criticism/                            # Textual Criticism Engine
|   +-- src/
|   |   +-- witnesses/                    # Manuscript witness registry
|   |   |   +-- registry.ts              # Witness CRUD and metadata
|   |   |   +-- classification.ts        # Witness classification
|   |   |   +-- iiif.ts                  # IIIF manifest linking
|   |   |   +-- index.ts
|   |   +-- collation/                    # Collation engine
|   |   |   +-- variant-graph.ts         # Dekker's variant graph
|   |   |   +-- alignment.ts            # Token alignment
|   |   |   +-- normalization.ts         # Language-specific normalization
|   |   |   +-- transposition.ts         # Transposition detection
|   |   |   +-- output.ts               # Collation output formats
|   |   |   +-- index.ts
|   |   +-- variants/                     # Variant classification
|   |   |   +-- classifier.ts            # ML-assisted classification
|   |   |   +-- scribal-errors.ts        # Scribal error taxonomy
|   |   |   +-- index.ts
|   |   +-- stemma/                       # Stemmatic analysis
|   |   |   +-- phylogenetics.ts         # Phylogenetic methods
|   |   |   +-- contamination.ts         # Contamination detection
|   |   |   +-- lachmann.ts              # Traditional stemmatic method
|   |   |   +-- visualization.ts         # Stemma rendering
|   |   |   +-- index.ts
|   |   +-- apparatus/                    # Critical apparatus
|   |   |   +-- generator.ts             # Apparatus generation
|   |   |   +-- formats.ts              # Apparatus format support
|   |   |   +-- typography.ts            # Print-quality rendering
|   |   |   +-- index.ts
|   |   +-- lacunae/                      # Lacuna tracking
|   |   |   +-- registry.ts              # Lacuna documentation
|   |   |   +-- reconstruction.ts        # Proposed restorations
|   |   |   +-- index.ts
|   |   +-- index.ts
|   +-- package.json
|   +-- project.json
|   +-- tsconfig.json
|
+-- canon/                                # Canonical Text Management
|   +-- src/
|   |   +-- systems/                      # Reference system definitions
|   |   |   +-- bible.ts                 # Biblical canon systems
|   |   |   +-- quran.ts                # Quranic reference system
|   |   |   +-- buddhist.ts             # Buddhist canon systems
|   |   |   +-- hindu.ts                # Hindu scripture references
|   |   |   +-- jewish.ts               # Jewish textual references
|   |   |   +-- classical.ts            # Greco-Roman reference systems
|   |   |   +-- other.ts                # Other tradition references
|   |   |   +-- index.ts
|   |   +-- resolution/                   # Reference resolution
|   |   |   +-- parser.ts               # Reference string parsing
|   |   |   +-- resolver.ts             # Cross-system resolution
|   |   |   +-- uri.ts                  # Canonical URI scheme
|   |   |   +-- cts.ts                  # CTS/CITE compatibility
|   |   |   +-- versification.ts        # Versification mapping
|   |   |   +-- index.ts
|   |   +-- index.ts
|   +-- package.json
|   +-- project.json
|   +-- tsconfig.json
|
+-- paleography/                          # Paleographic Analysis
|   +-- src/
|   |   +-- classification/               # Script and period classification
|   |   |   +-- script-classifier.ts     # Writing system identification
|   |   |   +-- period-classifier.ts     # Date range estimation
|   |   |   +-- regional-classifier.ts   # Regional tradition identification
|   |   |   +-- index.ts
|   |   +-- letterforms/                  # Letterform analysis
|   |   |   +-- features.ts             # Feature extraction
|   |   |   +-- comparison.ts           # Statistical comparison
|   |   |   +-- evolution.ts            # Evolution tracking
|   |   |   +-- index.ts
|   |   +-- scribal/                      # Scribal hand identification
|   |   |   +-- identification.ts        # Writer identification models
|   |   |   +-- hand-changes.ts          # Hand change detection
|   |   |   +-- habits.ts               # Scribal habit profiling
|   |   |   +-- index.ts
|   |   +-- enhancement/                  # Damaged text enhancement
|   |   |   +-- multispectral.ts         # Multispectral imaging integration
|   |   |   +-- ai-reading.ts           # AI-assisted reading
|   |   |   +-- confidence.ts           # Confidence scoring
|   |   |   +-- index.ts
|   |   +-- dating/                       # Dating estimation
|   |   |   +-- multi-factor.ts          # Multi-factor dating model
|   |   |   +-- calibration.ts          # Calibration against dated MSS
|   |   |   +-- index.ts
|   |   +-- index.ts
|   +-- package.json
|   +-- project.json
|   +-- tsconfig.json
|
+-- philology/                            # Philological Analysis
|   +-- src/
|   |   +-- etymology/                    # Etymology tracking
|   |   |   +-- cognates.ts             # Cross-language cognate chains
|   |   |   +-- semantic-drift.ts       # Semantic drift visualization
|   |   |   +-- loanwords.ts            # Loanword detection
|   |   |   +-- index.ts
|   |   +-- semantics/                    # Semantic field analysis
|   |   |   +-- domains.ts              # Semantic domain mapping
|   |   |   +-- collocations.ts         # Collocational analysis
|   |   |   +-- metaphors.ts            # Metaphor mapping
|   |   |   +-- index.ts
|   |   +-- statistics/                   # Statistical linguistics
|   |   |   +-- frequency.ts            # Word frequency analysis
|   |   |   +-- hapax.ts                # Hapax legomena detection
|   |   |   +-- authorship.ts           # Stylometric authorship attribution
|   |   |   +-- register.ts             # Register analysis
|   |   |   +-- index.ts
|   |   +-- discourse/                    # Discourse analysis
|   |   |   +-- chiastic.ts             # Chiastic structure detection
|   |   |   +-- ring-composition.ts     # Ring composition detection
|   |   |   +-- inclusio.ts             # Inclusio detection
|   |   |   +-- boundaries.ts           # Discourse boundary markers
|   |   |   +-- narrative.ts            # Narrative analysis
|   |   |   +-- index.ts
|   |   +-- intertextuality/             # Intertextuality detection
|   |   |   +-- quotations.ts           # Quotation detection
|   |   |   +-- allusions.ts            # Allusion detection
|   |   |   +-- echoes.ts               # Echo detection
|   |   |   +-- scoring.ts              # Influence scoring
|   |   |   +-- direction.ts            # Dependency direction analysis
|   |   |   +-- index.ts
|   |   +-- index.ts
|   +-- package.json
|   +-- project.json
|   +-- tsconfig.json
|
+-- comparative/                          # Comparative Traditions Framework
|   +-- src/
|   |   +-- concepts/                     # Cross-tradition concept mapping
|   |   |   +-- registry.ts             # Concept equivalence registry
|   |   |   +-- taxonomy.ts             # Similarity taxonomy
|   |   |   +-- evidence.ts             # Evidence requirements
|   |   |   +-- index.ts
|   |   +-- parallels/                    # Parallel passage detection
|   |   |   +-- detector.ts             # Cross-tradition parallel finder
|   |   |   +-- context-weighting.ts    # Cultural context weighting
|   |   |   +-- classification.ts       # Parallel quality classification
|   |   |   +-- index.ts
|   |   +-- motifs/                       # Motif & theme tracking
|   |   |   +-- catalog.ts              # Universal motif catalog
|   |   |   +-- attestations.ts         # Motif attestation tracking
|   |   |   +-- timelines.ts            # Theme evolution timelines
|   |   |   +-- index.ts
|   |   +-- influence/                    # Influence network mapping
|   |   |   +-- graph.ts                # Historical influence graph
|   |   |   +-- evidence-grading.ts     # Evidence-graded edges
|   |   |   +-- index.ts
|   |   +-- synoptic/                     # Synoptic cross-tradition views
|   |   |   +-- reader.ts               # Synoptic reader
|   |   |   +-- comparison-sets.ts      # Configurable comparison sets
|   |   |   +-- index.ts
|   |   +-- index.ts
|   +-- package.json
|   +-- project.json
|   +-- tsconfig.json
|
+-- corpora/                              # Open-Source Corpora Integration
|   +-- src/
|   |   +-- connectors/                   # Corpus connectors
|   |   |   +-- perseus.ts              # Perseus Digital Library
|   |   |   +-- etcsl.ts                # Sumerian literary corpus
|   |   |   +-- cdli.ts                 # Cuneiform Digital Library
|   |   |   +-- oracc.ts                # Open Richly Annotated Cuneiform
|   |   |   +-- suttacentral.ts         # Buddhist texts
|   |   |   +-- cbeta.ts                # Chinese Buddhist canon
|   |   |   +-- sarit.ts                # Sanskrit/Prakrit texts
|   |   |   +-- openiti.ts              # Arabic/Persian texts
|   |   |   +-- sefaria.ts              # Jewish texts
|   |   |   +-- ctp.ts                  # Chinese Text Project
|   |   |   +-- gretil.ts               # Indic texts
|   |   |   +-- sword.ts                # SWORD Bible modules
|   |   |   +-- dss.ts                  # Dead Sea Scrolls
|   |   |   +-- cal.ts                  # Comprehensive Aramaic Lexicon
|   |   |   +-- etcbc.ts                # Hebrew Bible morphological data
|   |   |   +-- index.ts
|   |   +-- formats/                      # Format parsers
|   |   |   +-- tei.ts                   # TEI-XML parser
|   |   |   +-- atf.ts                   # ATF (cuneiform) parser
|   |   |   +-- usfm.ts                 # USFM/USX parser
|   |   |   +-- osis.ts                 # OSIS XML parser
|   |   |   +-- markdown.ts             # OpenITI mARkdown parser
|   |   |   +-- sword-module.ts         # SWORD module reader
|   |   |   +-- index.ts
|   |   +-- pipeline/                     # Ingestion pipeline
|   |   |   +-- ingester.ts             # Corpus ingestion orchestrator
|   |   |   +-- chunking.ts             # Nisaba-specific chunking strategies
|   |   |   +-- metadata.ts             # Metadata extraction
|   |   |   +-- index.ts
|   |   +-- index.ts
|   +-- package.json
|   +-- project.json
|   +-- tsconfig.json
|
+-- annotations/                          # Annotation & Commentary System
|   +-- src/
|   |   +-- model/                        # Annotation data model
|   |   |   +-- standoff.ts             # Standoff annotation storage
|   |   |   +-- types.ts                # Annotation type system
|   |   |   +-- layers.ts               # Commentary layer management
|   |   |   +-- index.ts
|   |   +-- collaborative/                # Collaborative annotation
|   |   |   +-- crdt.ts                 # CRDT-based conflict resolution
|   |   |   +-- workflow.ts             # Review workflow
|   |   |   +-- permissions.ts          # Permission model
|   |   |   +-- discussions.ts          # Discussion threads
|   |   |   +-- index.ts
|   |   +-- export/                       # Export formats
|   |   |   +-- wadm.ts                 # W3C Web Annotation export
|   |   |   +-- tei.ts                  # TEI-XML annotation export
|   |   |   +-- hypothesis.ts           # Hypothesis compatibility
|   |   |   +-- pdf.ts                  # PDF annotation export
|   |   |   +-- index.ts
|   |   +-- index.ts
|   +-- package.json
|   +-- project.json
|   +-- tsconfig.json
|
+-- editions/                             # Digital Critical Edition Tools
|   +-- src/
|   |   +-- project/                      # Edition project management
|   |   |   +-- manager.ts              # Project lifecycle
|   |   |   +-- base-text.ts            # Base text selection
|   |   |   +-- witnesses.ts            # Witness linking
|   |   |   +-- index.ts
|   |   +-- apparatus/                    # Apparatus composition
|   |   |   +-- editor.ts               # Apparatus entry interface
|   |   |   +-- types.ts                # Apparatus type definitions
|   |   |   +-- cross-references.ts     # Cross-reference linking
|   |   |   +-- index.ts
|   |   +-- export/                       # Export & publishing
|   |   |   +-- tei.ts                  # TEI-XML critical edition export
|   |   |   +-- epidoc.ts              # EpiDoc export
|   |   |   +-- pdf.ts                  # Print-ready PDF generation
|   |   |   +-- html.ts                 # Interactive HTML edition
|   |   |   +-- index.ts
|   |   +-- collaboration/                # Collaborative editing
|   |   |   +-- roles.ts               # Role-based access
|   |   |   +-- versioning.ts          # Semantic edition versioning
|   |   |   +-- review.ts              # Review pipeline
|   |   |   +-- index.ts
|   |   +-- index.ts
|   +-- package.json
|   +-- project.json
|   +-- tsconfig.json
|
+-- geotemporal/                          # Temporal-Geographic Mapping
|   +-- src/
|   |   +-- provenance/                   # Manuscript provenance
|   |   |   +-- chains.ts               # Provenance chain tracking
|   |   |   +-- scriptoria.ts           # Scriptoria mapping
|   |   |   +-- transmission.ts         # Transmission route visualization
|   |   |   +-- index.ts
|   |   +-- diffusion/                    # Tradition spread
|   |   |   +-- maps.ts                 # Animated diffusion maps
|   |   |   +-- center-of-gravity.ts    # Intellectual center tracking
|   |   |   +-- index.ts
|   |   +-- gazetteer/                    # Geographic integration
|   |   |   +-- pleiades.ts             # Pleiades gazetteer
|   |   |   +-- periodo.ts              # PeriodO integration
|   |   |   +-- atlas.ts                # Historical atlas
|   |   |   +-- archaeology.ts          # Excavation context linking
|   |   |   +-- index.ts
|   |   +-- timeline/                     # Timeline engine
|   |   |   +-- calendars.ts            # Multi-calendar support
|   |   |   +-- fuzzy-dating.ts         # Fuzzy date handling
|   |   |   +-- synchronized.ts         # Synchronized parallel timelines
|   |   |   +-- index.ts
|   |   +-- search/                       # Spatial search
|   |   |   +-- geographic.ts           # Geographic queries
|   |   |   +-- overlay.ts              # Tradition overlay
|   |   |   +-- routes.ts               # Route-based search
|   |   |   +-- index.ts
|   |   +-- index.ts
|   +-- package.json
|   +-- project.json
|   +-- tsconfig.json
|
+-- assistant/                            # AI Scholarly Assistant
|   +-- src/
|   |   +-- translation/                  # AI translation assistance
|   |   |   +-- morphological.ts         # Morphological explanation
|   |   |   +-- options.ts              # Translation option generation
|   |   |   +-- disambiguation.ts       # Contextual disambiguation
|   |   |   +-- drafting.ts             # Translation drafting
|   |   |   +-- index.ts
|   |   +-- commentary/                   # Commentary generation
|   |   |   +-- generator.ts            # Grounded commentary drafting
|   |   |   +-- styles.ts               # Commentary style templates
|   |   |   +-- index.ts
|   |   +-- criticism/                    # Variant evaluation
|   |   |   +-- internal-evidence.ts    # Internal evidence analysis
|   |   |   +-- external-evidence.ts    # External evidence analysis
|   |   |   +-- index.ts
|   |   +-- research/                     # Research assistance
|   |   |   +-- gap-analysis.ts         # Research gap identification
|   |   |   +-- bibliography.ts         # Bibliography discovery
|   |   |   +-- methodology.ts          # Methodology suggestion
|   |   |   +-- index.ts
|   |   +-- dating/                       # Linguistic dating
|   |   |   +-- vocabulary.ts           # Vocabulary dating
|   |   |   +-- syntactic.ts            # Syntactic dating
|   |   |   +-- orthographic.ts         # Orthographic dating
|   |   |   +-- index.ts
|   |   +-- prompts/                      # Domain-specific prompt library
|   |   |   +-- parsing.ts              # Morphological parsing prompts
|   |   |   +-- comparison.ts           # Translation comparison prompts
|   |   |   +-- criticism.ts            # Textual criticism prompts
|   |   |   +-- philology.ts            # Philological analysis prompts
|   |   |   +-- comparative.ts          # Comparative tradition prompts
|   |   |   +-- index.ts
|   |   +-- index.ts
|   +-- package.json
|   +-- project.json
|   +-- tsconfig.json
|
+-- standards/                            # Import/Export Standards
|   +-- src/
|   |   +-- tei/                          # TEI-XML support
|   |   |   +-- parser.ts               # TEI P5 parser
|   |   |   +-- generator.ts            # TEI P5 generator
|   |   |   +-- epidoc.ts              # EpiDoc support
|   |   |   +-- index.ts
|   |   +-- scripture/                    # Scripture format support
|   |   |   +-- osis.ts                 # OSIS parser/generator
|   |   |   +-- usfm.ts                # USFM parser/generator
|   |   |   +-- usx.ts                 # USX parser/generator
|   |   |   +-- sword.ts               # SWORD module support
|   |   |   +-- index.ts
|   |   +-- reference/                    # Reference standards
|   |   |   +-- cts.ts                  # CTS/CITE protocol
|   |   |   +-- index.ts
|   |   +-- citation/                     # Citation formats
|   |   |   +-- bibtex.ts              # BibTeX import/export
|   |   |   +-- ris.ts                 # RIS import/export
|   |   |   +-- csl.ts                 # CSL-JSON import/export
|   |   |   +-- zotero.ts              # Zotero API integration
|   |   |   +-- index.ts
|   |   +-- linked-data/                  # Linked Open Data
|   |   |   +-- rdf.ts                  # RDF export
|   |   |   +-- sparql.ts              # SPARQL endpoint
|   |   |   +-- jsonld.ts              # JSON-LD support
|   |   |   +-- wikidata.ts            # Wikidata alignment
|   |   |   +-- index.ts
|   |   +-- image/                        # Image standards
|   |   |   +-- iiif.ts                 # IIIF support
|   |   |   +-- index.ts
|   |   +-- annotation/                   # Annotation standards
|   |   |   +-- wadm.ts                # W3C Web Annotation
|   |   |   +-- hypothesis.ts          # Hypothesis compatibility
|   |   |   +-- index.ts
|   |   +-- index.ts
|   +-- package.json
|   +-- project.json
|   +-- tsconfig.json
|
+-- workspace/                            # Scholarly Workspace
|   +-- src/
|   |   +-- projects/                     # Research project management
|   |   |   +-- manager.ts              # Project CRUD
|   |   |   +-- templates.ts            # Project templates
|   |   |   +-- tracking.ts            # Progress tracking
|   |   |   +-- index.ts
|   |   +-- reader/                       # Reading environment
|   |   |   +-- layout.ts              # Split-pane layout
|   |   |   +-- morphological-popup.ts  # Morphological popups
|   |   |   +-- lexicon-panel.ts       # Lexicon panel
|   |   |   +-- index.ts
|   |   +-- search/                       # Cross-corpora search
|   |   |   +-- unified.ts             # Unified search interface
|   |   |   +-- lemma-aware.ts         # Lemma-aware search
|   |   |   +-- morphology-aware.ts    # Morphology-aware search
|   |   |   +-- semantic.ts            # Semantic search
|   |   |   +-- index.ts
|   |   +-- library/                      # Personal library
|   |   |   +-- upload.ts              # Document upload
|   |   |   +-- collections.ts         # Collection organization
|   |   |   +-- reading-lists.ts       # Reading lists
|   |   |   +-- bookmarks.ts           # Bookmarks and highlights
|   |   |   +-- index.ts
|   |   +-- export/                       # Export pipeline
|   |   |   +-- pdf.ts                  # PDF export
|   |   |   +-- docx.ts                # DOCX export
|   |   |   +-- latex.ts               # LaTeX export
|   |   |   +-- html.ts                # HTML export
|   |   |   +-- index.ts
|   |   +-- citations/                    # Citation manager integration
|   |   |   +-- sophia-integration.ts   # Sophia citation system
|   |   |   +-- external.ts            # External citation managers
|   |   |   +-- inline.ts              # Inline citation insertion
|   |   |   +-- index.ts
|   |   +-- index.ts
|   +-- package.json
|   +-- project.json
|   +-- tsconfig.json
|
+-- client/                               # Client-side SDK and API client
|   +-- src/
|   |   +-- api/                          # API client
|   |   +-- hooks/                        # React hooks for Nisaba features
|   |   +-- index.ts
|   +-- package.json
|   +-- project.json
|   +-- tsconfig.json
```

**Total Estimated Library Count**: 174 modules across 18 top-level libraries.

---

## Integration with Existing Domains

### Primary Dependency: Sophia

Nisaba builds on top of Sophia's research infrastructure. Sophia provides the
document ingestion, vector search, knowledge graph, citation management,
embedding, and quality evaluation capabilities that Nisaba extends with
domain-specific functionality.

#### Document Pipeline Integration

- **Sophia's document ingestion** (`@sophia/schemas` — `ResearchDocumentSchema`)
  serves as the base for all documents entering Nisaba. Nisaba uses Sophia's
  `DocumentTypeSchema` which already includes `tei-xml`, `scripture`,
  `ancient-text`, and `commentary` types.
- **Nisaba-specific chunking** — Nisaba provides custom chunking strategies that
  plug into Sophia's pipeline via `ProcessingInfoSchema.chunkingStrategy`:
  - Verse-aware chunking (for poetry and scripture)
  - Pericope-aware chunking (for narrative texts)
  - Section-aware chunking (for prose treatises)
  - Parallel-preserving chunking (keeping synoptic parallels aligned)

#### Knowledge Graph Extension

- **Sophia's entity types** (`@sophia/schemas` — `EntityTypeSchema`) include
  `Tradition`, `Text`, `Concept`, `Practice`, `Figure`, `Place`, `School`,
  `Doctrine`, `Event`, `Term`, `Symbol`, `Ritual`, `Artifact`, `Organization`,
  and `Custom`. Nisaba uses the `Custom` type to represent manuscript-specific
  entities without modifying Sophia's schema:
  - `Custom` with metadata: `Manuscript` (physical manuscript witness)
  - `Custom` with metadata: `Witness` (textual witness in critical apparatus)
  - `Custom` with metadata: `ReadingVariant` (a variant reading at a specific
    locus)
  - `Custom` with metadata: `ScribalHand` (an identified scribal hand)
  - `Custom` with metadata: `TextFamily` (a group of related manuscripts)

- **Sophia's relation types** (`RelationType` in Prisma schema) include
  `REFERENCES`, `QUOTES`, `CITES`, `RELATED_TO`, `SIMILAR_TO`, `DERIVED_FROM`,
  `PART_OF`, which Nisaba uses for intertextuality and influence tracking. The
  `CUSTOM` relation type supports Nisaba-specific relationships like
  `COPIED_FROM`, `DESCENDED_FROM`, `CONTAMINATED_BY`.

#### Citation System

- **Sophia's citation infrastructure** (`@sophia/schemas` —
  `CitationStyleSchema`, `SourceTypeSchema`, `SourceSchema`,
  `BibliographySchema`) provides the foundation for Nisaba's scholarly citation
  needs. Sophia already supports `SourceType` values including `scripture`,
  `ancient-text`, `commentary`, `manuscript`, `encyclopedia`, and `dictionary`.
- **Nisaba extends citation rendering** with tradition-specific styles (SBL for
  biblical studies, Indological conventions for Sanskrit studies, Orientalist
  conventions for Arabic studies) while using Sophia's `CitationStyleSchema` for
  standard academic styles.

#### Vector Search & Embeddings

- **Sophia's Qdrant integration** provides semantic search across Nisaba's
  corpora using multilingual embeddings
- **Nisaba configures embedding models** optimized for ancient language
  vocabulary (higher weight on scholarly translations and morphological forms
  rather than modern language usage)

#### Event Publishing

- Nisaba publishes domain events that follow Sophia's event schema patterns
  (e.g., `DocumentIngestedEventSchema`, `EntityExtractedEventSchema`) for
  integration with other domains

### Secondary Integrations

#### Iris Integration

- **Conversational scholarly interface** — Iris's conversation engine can serve
  as a natural language interface to Nisaba's research capabilities
- **Multi-turn research dialogue** — Scholars can ask complex questions that
  require multiple Nisaba operations (e.g., "Compare how the concept of divine
  mercy is expressed in Psalm 103, Surah Al-Fatiha, and the Dhammapada")
- **Voice interaction** — Iris's voice capabilities enable hands-free text
  consultation while working with physical manuscripts

#### Hathor Integration

- **Historical worldbuilding** — Nisaba's geotemporal data (historical maps,
  period boundaries, cultural contexts) feeds historically accurate
  worldbuilding in Hathor
- **Authentic cultural representation** — Nisaba's tradition data ensures that
  worldbuilding involving historical cultures draws on accurate scholarship

#### Kuanyin Integration

- **Buddhist text synergy** — Kuanyin's dharma analytics and Buddhist tradition
  expertise can inform Nisaba's handling of Buddhist canonical texts
- **Meditation instruction lineage** — Tracking the transmission of meditation
  practices through textual evidence in Buddhist literature

#### Themis Integration

- **Collaborative governance** — Themis governance features manage collaborative
  scholarly projects (critical edition teams, annotation review boards)
- **Academic integrity** — Plagiarism detection and proper attribution
  enforcement for scholarly outputs

### Dependency Rules

```
# Nisaba CAN depend on:
@sophia/schemas        # Document, entity, citation schemas
@sophia/database       # Sophia's database client for shared data
@sophia/search         # Vector search and RAG pipeline
@oshun/ai              # LLM integration
@oshun/database        # Core database utilities
@oshun/events          # Event publishing

# Nisaba CANNOT depend on:
@iris/*                # Iris depends on Nisaba, not the reverse
@hathor/*              # Hathor consumes Nisaba data, not the reverse
@kuanyin/*             # Kuanyin integrates with Nisaba at the API level
@themis/*              # Themis provides governance hooks, not dependencies
```

---

## Differentiation: Why Nisaba Will Be Industry-Leading

### 1. Multi-Tradition by Design

Every existing tool in this space was built for a single tradition and later
(sometimes) extended to others. Logos, Accordance, and BibleWorks are
fundamentally Christian Bible study tools. The TLG is Greek-only. The CBETA is
Buddhist-only. Nisaba is architected from the ground up to treat every tradition
as a first-class citizen, with shared infrastructure for concepts that all
traditions need (canonical references, morphological analysis, textual
criticism) and tradition-specific modules where needed.

### 2. AI-Native Scholarly Tools

No competing product has LLM-powered scholarly capabilities. Nisaba integrates
AI for translation assistance, commentary generation, variant evaluation,
research question formulation, and cross-tradition parallel detection — always
grounded in verifiable sources, never fabricating citations. This is not a
chatbot bolted onto a text database; it is AI deeply integrated into the
scholarly workflow.

### 3. Open Architecture & Standards Compliance

Nisaba speaks every standard in the digital humanities ecosystem: TEI-XML,
EpiDoc, CTS/CITE, IIIF, W3C Web Annotation, RDF/SPARQL, OSIS, USFM, and more.
Data goes in and comes out through open standards, preventing vendor lock-in.
This contrasts sharply with Logos and Accordance, which use proprietary formats
that trap scholarly work.

### 4. Full Textual Criticism Workflow

No consumer or even professional tool offers the complete textual criticism
pipeline: manuscript registry → collation → variant classification → stemmatic
analysis → apparatus generation → critical edition publishing. Scholars
currently use a patchwork of tools (CollateX for collation, phylogenetic
software for stemmata, LaTeX for typesetting). Nisaba unifies the entire
workflow.

### 5. Cross-Tradition Concept Mapping

This capability is unique to Nisaba. No existing tool systematically maps
concepts across religious and philosophical traditions with scholarly rigor. The
concept mapping system, with its evidence requirements, similarity taxonomy, and
influence network, enables a new kind of scholarship that has been discussed in
comparative religion for decades but never had adequate tooling.

### 6. Real-Time Collaborative Scholarship

Logos and Accordance are single-user desktop applications. Nisaba is built for
collaborative research: real-time co-annotation, shared critical edition
projects, team-based collation review, and discussion threads attached to
specific textual loci. This reflects how scholarship actually works — as a
communal enterprise.

### 7. Unified Multi-Corpus Search

Scholars currently search Perseus for Greek, Sefaria for Jewish texts,
SuttaCentral for Buddhist texts, and OpenITI for Arabic texts in separate
browser tabs. Nisaba provides a single search interface across all integrated
corpora, with lemma-aware and morphology-aware search that understands the
linguistic structure of each language.

### 8. Rigorous Evidence Standards

Unlike popular-level books that draw superficial parallels between traditions,
Nisaba enforces evidence standards on every comparative claim: primary source
citations, scholarly literature references, similarity taxonomy classification,
chronological plausibility checks, and influence directionality analysis. The
platform serves scholarship, not speculation.

---

## Competitive Landscape & Gap Analysis

| Feature                         | Nisaba                  | Logos Bible Software   | Accordance      | Perseus Digital Library | Thesaurus Linguae Graecae | SuttaCentral | Sefaria         | OpenITI   |
| ------------------------------- | ----------------------- | ---------------------- | --------------- | ----------------------- | ------------------------- | ------------ | --------------- | --------- |
| Multi-tradition support         | ✓                       | Limited                | Limited         | Greek/Latin             | Greek only                | Buddhist     | Jewish          | Islamic   |
| Ancient language morphology     | ✓ (20+ scripts)         | Hebrew, Greek, Aramaic | Hebrew, Greek   | Greek, Latin            | Greek                     | Pali         | Hebrew, Aramaic | Arabic    |
| Translation comparison          | ✓                       | ✓                      | ✓               | Partial                 | ✗                         | ✓            | Partial         | ✗         |
| Textual criticism workflow      | ✓ (full pipeline)       | Basic variants         | Basic variants  | ✗                       | ✗                         | ✗            | ✗               | ✗         |
| Collation engine                | ✓ (CollateX-compatible) | ✗                      | ✗               | ✗                       | ✗                         | ✗            | ✗               | ✗         |
| Stemmatic analysis              | ✓                       | ✗                      | ✗               | ✗                       | ✗                         | ✗            | ✗               | ✗         |
| Critical apparatus generation   | ✓                       | ✗                      | ✗               | ✗                       | ✗                         | ✗            | ✗               | ✗         |
| Cross-tradition concept mapping | ✓                       | ✗                      | ✗               | ✗                       | ✗                         | Partial      | ✗               | ✗         |
| Influence network mapping       | ✓                       | ✗                      | ✗               | ✗                       | ✗                         | ✗            | ✗               | ✗         |
| AI-powered scholarly assistant  | ✓                       | ✗                      | ✗               | ✗                       | ✗                         | ✗            | ✗               | ✗         |
| Collaborative annotation        | ✓ (real-time)           | ✗                      | ✗               | ✗                       | ✗                         | ✗            | ✓               | ✗         |
| Paleographic analysis           | ✓ (ML-based)            | ✗                      | ✗               | ✗                       | ✗                         | ✗            | ✗               | ✗         |
| Philological tools              | ✓ (comprehensive)       | Basic                  | Basic           | Partial                 | Partial                   | ✗            | ✗               | Partial   |
| Digital critical editions       | ✓ (full pipeline)       | ✗                      | ✗               | ✗                       | ✗                         | ✗            | ✗               | ✗         |
| Geotemporal mapping             | ✓                       | Partial                | Partial         | Partial                 | ✗                         | ✗            | ✗               | ✗         |
| Open standards (TEI, CTS, IIIF) | ✓ (comprehensive)       | Proprietary            | Proprietary     | Partial                 | Partial                   | ✓            | ✓               | ✓         |
| Web-based / collaborative       | ✓                       | Desktop + cloud        | Desktop         | ✓                       | ✓                         | ✓            | ✓               | ✓         |
| Intertextuality detection       | ✓ (ML-assisted)         | Cross-reference        | Cross-reference | ✗                       | ✗                         | ✓            | ✓               | ✓ (Kitab) |
| Multi-corpus unified search     | ✓                       | ✓ (own library)        | ✓ (own library) | ✗                       | ✗                         | ✗            | ✗               | ✗         |

**Key differentiator summary**: No existing tool combines multi-tradition
support, full textual criticism workflow, AI-native scholarly assistance,
cross-tradition concept mapping, and open standards compliance. Logos and
Accordance are powerful but tradition-locked and proprietary. Perseus and TLG
are open but language-limited. SuttaCentral, Sefaria, and OpenITI are
tradition-specific. Nisaba is the first platform designed to serve comparative
and cross-tradition scholarship at scale.

---

## Implementation Phases

### Phase 1: Foundation (Core, Schemas, Languages, Canon)

- Core domain types, constants, error types, and utility functions
- Zod schemas for all Nisaba data models (manuscript, variant, collation,
  apparatus, annotation, edition, reference, tradition, corpus, paleography,
  geotemporal)
- Database schema (Prisma) with migrations and seed data
- Writing system support for the six highest-priority language families (Hebrew,
  Greek, Latin, Sanskrit/Pali, Arabic, Sumerian/Akkadian)
- Morphological parsers for Hebrew, Greek, and Latin (TypeScript with Rust WASM
  for performance-critical paths)
- Transliteration engine with initial romanization schemes
- Lexicon integration framework with BDB, LSJ, and Lewis & Short connectors
- Canonical reference systems for Bible (Protestant, Catholic, Hebrew), Quran,
  Pali Canon (PTS numbering), Bhagavad Gita, and classical Greco-Roman texts
- Reference string parser and canonical URI scheme
- CTS/CITE protocol compliance layer

### Phase 2: Corpora Integration & Search

- TEI-XML parser/generator (full TEI P5 support)
- OSIS, USFM/USX, and SWORD module parsers
- ATF parser for cuneiform texts
- Corpus connectors for Perseus, ETCSL, CDLI, SuttaCentral, CBETA, Sefaria, and
  OpenITI
- Nisaba-specific chunking strategies for Sophia's ingestion pipeline
  (verse-aware, pericope-aware, section-aware)
- Unified cross-corpora search with lemma-aware and morphology-aware
  capabilities
- Integration with Sophia's vector search for semantic search across corpora
- Corpus metadata extraction and normalization

### Phase 3: Translation Comparison

- Side-by-side, synoptic, and interlinear display modes
- Gale-Church sentence alignment implementation
- Word-level alignment using bilingual concordances and IBM Model 1 adaptation
- Neural alignment using multilingual transformer embeddings
- Semantic divergence scoring
- Theological divergence flagging with configurable sensitivity rules
- Omission/addition detection and formal-dynamic equivalence scoring
- Translation history timeline for tracking interpretation changes over
  centuries

### Phase 4: Textual Criticism

- Manuscript witness registry with full metadata, classification, and IIIF
  manifest linking
- CollateX-compatible collation engine (Dekker's variant graph model in
  TypeScript)
- Language-specific normalization rules for collation (Hebrew, Greek, Latin,
  Arabic, Syriac, Coptic)
- Variant classification (automatic ML-assisted + manual scholar review)
- Scribal error taxonomy implementation
- Stemmatic analysis using phylogenetic methods (maximum parsimony, NeighborNet)
- Contamination detection (consistency index, split decomposition)
- Critical apparatus generation (positive, negative, mixed formats)
- Lacuna registry and reconstruction proposal system

### Phase 5: Annotations & Editions

- W3C Web Annotation Data Model implementation (standoff annotation storage)
- Annotation type system (textual, linguistic, translation, critical,
  comparative, structural, pedagogical)
- Layered commentary model (Talmudic-style layering paradigm)
- Collaborative annotation with CRDT-based conflict resolution
- Annotation review workflow (draft → review → published)
- Discussion threads attached to annotations
- Export to W3C WADM, TEI-XML, Hypothesis, and PDF
- Edition project management with base text selection and witness linking
- Apparatus composition interface with lemma selection and scholarly judgment
  annotations
- TEI-XML and EpiDoc critical edition export
- Print-ready PDF generation with critical edition typography
- Interactive HTML digital edition
- Collaborative editing workflows with role-based access and semantic versioning

### Phase 6: Philological Tools

- Cross-language cognate chain tracking (Proto-Semitic, PIE root families)
- Semantic drift visualization across languages and centuries
- Loanword detection algorithms
- Semantic domain mapping following Louw-Nida and SDBH frameworks
- Collocational analysis and metaphor mapping (Lakoff-Johnson framework)
- Hapax legomena detection with cross-corpus checking
- Word frequency analysis, type-token ratios, vocabulary richness metrics
- Stylometric authorship attribution using function word frequencies
- Register analysis (prose/poetry, narrative/discourse, legal/prophetic)
- Chiastic structure detection algorithm
- Ring composition and inclusio detection
- Discourse boundary marker identification
- Intertextuality detection (quotations, allusions, echoes) with influence
  scoring and dependency direction analysis

### Phase 7: Comparative Traditions & Geotemporal

- Cross-tradition concept equivalence registry with similarity taxonomy
  (genetic, typological, analogical, contested)
- Evidence requirements enforcement for concept mappings
- Cross-tradition parallel passage detection using semantic similarity, motif
  matching, and structural analysis
- Cultural context weighting for parallel quality assessment
- Universal motif catalog with attestation tracking
- Theme evolution timelines
- Historical influence network graph with evidence-graded edges
- Synoptic cross-tradition reader
- Manuscript provenance chain tracking
- Tradition spread visualization (animated diffusion maps)
- Pleiades gazetteer and PeriodO integration
- Historical atlas with period-accurate boundaries
- Timeline engine with multi-calendar support and fuzzy dating
- Spatial search (geographic queries, tradition overlay, route-based search)

### Phase 8: Paleography & Advanced Languages

- ML-based script classification models (writing system, period, region)
- Letterform feature extraction and statistical comparison
- Scribal hand identification using writer identification models
- Hand change detection within manuscripts
- Scribal habit profiling (spelling preferences, abbreviation patterns)
- Multispectral imaging integration for damaged text enhancement
- AI-assisted character reading with per-character confidence scoring
- Multi-factor paleographic dating with probability distributions
- Extended writing system support: Egyptian (hieroglyphic, hieratic, demotic),
  Coptic, Syriac, Ge'ez, Tibetan, Avestan, Old Church Slavonic, Linear B,
  Etruscan, Old Persian, runic scripts
- Extended morphological parsers: Sanskrit (with Rust WASM sandhi
  decomposition), Arabic, Akkadian, Sumerian, Pali, Coptic
- Extended lexicon integrations: HALOT, Monier-Williams, CAD, PSD/ePSD2, Lane,
  PTS Pali dictionary

### Phase 9: AI Scholarly Assistant

- AI translation assistance with morphological explanation and disambiguation
- Translation option generation with scholarly justification
- AI-assisted first-draft translation for under-studied texts
- Grounded commentary generation using Sophia RAG pipeline (verified citations,
  no fabrication)
- Commentary style templates (exegetical, thematic, historical-critical,
  comparative, philological)
- Internal and external evidence analysis for variant evaluation
- Research gap identification using existing scholarship analysis
- Bibliography discovery via Sophia knowledge base and external databases
- Methodology suggestion for research questions
- Linguistic dating analysis (vocabulary, syntactic, orthographic) with
  probability distributions
- Domain-specific curated prompt library for scholarly tasks

### Phase 10: Workspace & Polish

- Research project management with templates and progress tracking
- Configurable split-pane reading environment with morphological popups and
  lexicon panel
- Keyboard navigation with vim-style keybindings
- Theme and typography configuration (scholarly fonts for ancient scripts)
- Personal library (document upload, collection organization, reading lists,
  bookmarks)
- PDF export with critical apparatus and multi-script support
- DOCX and LaTeX export (including reledmac/reledpar for critical editions)
- HTML export (standalone and embeddable)
- Sophia citation system integration for bibliography generation and citation
  verification
- External citation manager integration (Zotero, Mendeley, EndNote)
- Inline citation insertion
- RDF/SPARQL export and Linked Open Data integration
- Wikidata entity alignment
- IIIF integration (Presentation API v3, Image API v3, Content Search API)
- Comprehensive end-to-end testing across all modules
- Performance optimization (search response times, collation speed, export
  throughput)
- Documentation for scholars (user guides, API reference, tutorials)

---

## Success Metrics

| Metric                           | Target                                                  | Measurement Method                                    |
| -------------------------------- | ------------------------------------------------------- | ----------------------------------------------------- |
| Ancient languages supported      | 20+ writing systems with morphological parsing          | Language module count and coverage testing            |
| Corpora integrated               | 15+ major digital text repositories                     | Connector count with successful ingestion tests       |
| Collation accuracy               | 95%+ agreement with expert manual collation             | Benchmark against published collation datasets        |
| Translation alignment precision  | 90%+ word-level alignment accuracy                      | Evaluation against gold-standard parallel corpora     |
| Cross-tradition concept mappings | 500+ curated, scholar-reviewed mappings                 | Registry count with evidence quality audit            |
| Critical apparatus correctness   | 98%+ accuracy vs. published critical editions           | Comparison with Nestle-Aland, BHS apparatus           |
| Search relevance (lemma-aware)   | NDCG@10 ≥ 0.85 for morphology-aware queries             | IR evaluation against labeled relevance judgments     |
| AI assistant citation accuracy   | 100% verifiable citations (zero fabrication)            | Automated citation verification pipeline              |
| TEI-XML round-trip fidelity      | Lossless import/export for TEI P5 documents             | Automated round-trip testing with reference documents |
| Concurrent collaborative users   | 50+ simultaneous annotators per project                 | Load testing with CRDT conflict resolution metrics    |
| Paleographic dating accuracy     | Within 100 years of expert consensus for 80%+           | Evaluation against securely dated manuscript corpus   |
| PDF export quality               | Indistinguishable from LaTeX-typeset critical editions  | Expert blind comparison study                         |
| Scholar adoption                 | 100 active research projects within 12 months of launch | Usage analytics and project creation tracking         |
| API response time (search)       | p95 < 500ms for cross-corpora lemma-aware search        | Latency monitoring in production                      |

---

## Team & Resource Estimates

### Core Team Structure

| Role                           | Count | Focus                                               |
| ------------------------------ | ----- | --------------------------------------------------- |
| Senior TypeScript Engineers    | 4     | Core infrastructure, search, workspace              |
| Rust/WASM Engineers            | 2     | Morphological parsers, collation performance        |
| ML/AI Engineers                | 2     | Paleographic models, alignment, scholarly assistant |
| Computational Linguists        | 2     | Ancient language parsers, philological tools        |
| Digital Humanities Specialists | 2     | TEI-XML, standards, critical edition workflows      |
| Full-Stack Engineers           | 2     | Workspace UI, collaborative features                |
| DevOps / Infrastructure        | 1     | Database, search infrastructure, CI/CD              |
| Product Manager                | 1     | Scholar needs, feature prioritization               |
| UX Designer                    | 1     | Scholarly workspace design, accessibility           |

### Advisory Board (Consulting)

| Expertise                | Purpose                                             |
| ------------------------ | --------------------------------------------------- |
| Biblical Studies (OT/NT) | Hebrew, Greek, Aramaic text handling validation     |
| Classical Studies        | Perseus integration, Greek/Latin philological tools |
| Assyriology              | Cuneiform language support validation               |
| Buddhist Studies         | Pali/Sanskrit/Chinese/Tibetan canon handling        |
| Islamic Studies          | Arabic text processing, Quranic studies features    |
| Judaic Studies           | Talmudic reference systems, Sefaria integration     |
| Indology                 | Sanskrit morphological parser validation            |
| Comparative Religion     | Cross-tradition concept mapping methodology         |
| Textual Criticism        | Collation, stemmatic analysis, apparatus generation |
| Digital Humanities       | TEI, IIIF, CTS standards compliance                 |

### Infrastructure Estimates

| Resource       | Specification                         | Purpose                                        |
| -------------- | ------------------------------------- | ---------------------------------------------- |
| PostgreSQL     | Dedicated instance, 500GB+ storage    | Nisaba schema, manuscript data, annotations    |
| Redis          | Shared cluster                        | Session data, search caching, reference data   |
| Qdrant         | Via Sophia                            | Vector search across corpora                   |
| Object Storage | 2TB+                                  | Manuscript images, IIIF tiles, corpus archives |
| GPU Compute    | 2× A100 (training), 1× L4 (inference) | Paleographic models, alignment models          |
| CDN            | Global                                | Manuscript image delivery, IIIF tiles          |

---

## Risk Analysis

### Technical Risks

| Risk                                                        | Probability | Impact | Mitigation                                                                                                              |
| ----------------------------------------------------------- | ----------- | ------ | ----------------------------------------------------------------------------------------------------------------------- |
| Morphological parser accuracy for under-resourced languages | High        | High   | Start with best-resourced languages (Hebrew, Greek, Latin); build modular architecture allowing progressive improvement |
| Copyright restrictions on commercial lexica (HALOT, BDAG)   | Medium      | Medium | Prioritize public-domain lexica (BDB, LSJ, Lewis & Short); provide integration API for users with their own licenses    |
| Scale of cuneiform sign list complexity                     | Medium      | Medium | Leverage existing digital Assyriology infrastructure (CDLI, ORACC, ePSD2)                                               |
| AI hallucination in scholarly assistant                     | Medium      | High   | Mandatory citation verification; never present AI output without source grounding; explicit confidence markers          |
| Stemmatic analysis computational cost for large traditions  | Low         | Medium | Progressive computation with caching; limit initial scope to manageable tradition sizes                                 |
| TEI-XML parsing edge cases across corpora                   | High        | Low    | Comprehensive test suite against real-world TEI documents from all integrated corpora                                   |

### Scholarly Risks

| Risk                                                 | Probability | Impact | Mitigation                                                                                            |
| ---------------------------------------------------- | ----------- | ------ | ----------------------------------------------------------------------------------------------------- |
| Cross-tradition comparisons perceived as superficial | Medium      | High   | Rigorous evidence requirements; similarity taxonomy with mandatory scholarly consensus classification |
| Insufficient domain expertise in team                | Medium      | High   | Advisory board of domain specialists; extensive user testing with scholars                            |
| Theological/political sensitivity of comparisons     | Medium      | Medium | Neutral scholarly framing; tradition-specific advisory reviewers; configurable sensitivity settings   |
| Scholar adoption resistance to AI tools              | Medium      | Medium | AI as assistant (never autonomous); full transparency of AI reasoning; ability to disable AI features |

---

## Sources & References

### Ancient Writing Systems

- [CDLI (Cuneiform Digital Library Initiative)](https://cdli.mpiwg-berlin.mpg.de/)
- [ETCSL (Electronic Text Corpus of Sumerian Literature)](https://etcsl.orinst.ox.ac.uk/)
- [ORACC (Open Richly Annotated Cuneiform Corpus)](http://oracc.museum.upenn.edu/)
- [JSesh - Hieroglyphic Editor](https://jsesh.qenherkhopeshef.org/)

### Digital Humanities Standards

- [TEI (Text Encoding Initiative)](https://tei-c.org/)
- [EpiDoc: Epigraphic Documents in TEI XML](https://epidoc.stoa.org/)
- [IIIF (International Image Interoperability Framework)](https://iiif.io/)
- [CTS/CITE Architecture](http://cite-architecture.org/)
- [W3C Web Annotation Data Model](https://www.w3.org/TR/annotation-model/)
- [Pelagios Network](https://pelagios.org/)
- [Pleiades Gazetteer](https://pleiades.stoa.org/)
- [PeriodO](https://perio.do/)

### Textual Criticism

- [CollateX - Software for Collating Textual Sources](https://collatex.net/)
- [Coherence-Based Genealogical Method (CBGM)](https://www.uni-muenster.de/INTF/cbgm.html)
- [SplitsTree - Phylogenetic Network Analysis](https://www.splitstree.org/)

### Biblical & Jewish Studies

- [Sefaria - A Living Library of Jewish Texts](https://www.sefaria.org/)
- [ETCBC - Hebrew Bible Morphological Database](https://www.etcbc.nl/)
- [SWORD Project - CrossWire Bible Society](https://crosswire.org/sword/)
- [Nestle-Aland Novum Testamentum Graece](https://www.nestle-aland.com/)

### Classical Studies

- [Perseus Digital Library](https://www.perseus.tufts.edu/)
- [Thesaurus Linguae Graecae (TLG)](http://stephanus.tlg.uci.edu/)
- [PHI (Packard Humanities Institute)](https://inscriptions.packhum.org/)

### Buddhist Studies

- [SuttaCentral - Early Buddhist Texts](https://suttacentral.net/)
- [CBETA (Chinese Buddhist Electronic Text Association)](https://www.cbeta.org/)
- [GRETIL - Göttingen Register of Electronic Texts in Indian Languages](http://gretil.sub.uni-goettingen.de/)
- [Digital Corpus of Sanskrit](https://www.sanskrit-lexicon.uni-koeln.de/)

### Islamic Studies

- [OpenITI (Open Islamicate Texts Initiative)](https://openiti.org/)
- [Quranic Arabic Corpus](https://corpus.quran.com/)
- [Kitab Project - Text Reuse in the Arabic Tradition](https://kitab-project.org/)

### Indic Studies

- [SARIT - Search and Retrieval of Indic Texts](https://sarit.indology.info/)
- [The Sanskrit Heritage Site](https://sanskrit.inria.fr/)
- [Monier-Williams Sanskrit-English Dictionary](https://www.sanskrit-lexicon.uni-koeln.de/)

### Comparative Religion & Philosophy

- [Stanford Encyclopedia of Philosophy](https://plato.stanford.edu/)
- [Internet Encyclopedia of Philosophy](https://iep.utm.edu/)

### Scholarly Software

- [Logos Bible Software](https://www.logos.com/)
- [Accordance Bible Software](https://www.accordancebible.com/)
- [Zotero - Reference Management](https://www.zotero.org/)
- [Hypothesis - Web Annotation](https://web.hypothes.is/)
- [Mirador - IIIF Viewer](https://projectmirador.org/)

### Goddess Reference

- [Nisaba — Ancient Mesopotamian Gods and Goddesses (ORACC)](http://oracc.museum.upenn.edu/amgg/listofdeities/nidaba/)
- [Electronic Text Corpus of Sumerian Literature: Hymns to Nisaba](https://etcsl.orinst.ox.ac.uk/)

---

## Conclusion

**Nisaba** represents the convergence of two great streams: the ancient human
impulse to record and transmit wisdom, and the modern computational power to
analyze that record at unprecedented scale. For the first time, a single
platform will allow a scholar to read the Tao Te Ching in Classical Chinese,
compare it with the Upanishads in Sanskrit and the Gospel of John in Koine
Greek, trace the etymological roots of key terms in each tradition, detect
structural parallels in their literary composition, map the historical channels
through which they might have influenced each other, and publish a critical
edition of the findings — all within one integrated research environment.

The name Nisaba is fitting beyond its Sumerian origins. She was the goddess who
connected the material (grain, reeds) with the intellectual (writing, counting,
knowledge). This platform similarly connects the material reality of manuscripts
— clay tablets pressed with reed styli, papyrus scrolls inked by scribes, palm
leaves etched with iron styluses — with the intellectual work of understanding
what those manuscripts mean, how they relate to each other, and what they tell
us about the deepest questions humans have asked.

Nisaba's vision is ultimately about what those ancient scribes were trying to
convey: that behind the diversity of languages, scripts, traditions, and
theological vocabularies, there are patterns of insight that recur with
remarkable consistency. The Tao that cannot be spoken, the Brahman that is _neti
neti_, the God beyond all names, the Emptiness that is also Fullness — these are
not identical claims, and scholarly rigor demands we respect their differences.
But the convergence is real, and it deserves tools worthy of its investigation.

_"She of the tablet, she of the stylus, she who measures the heavens and counts
the stars — Nisaba, who opens the House of Knowledge to all who seek."_
