# circse/lila_textlinker architecture

> Architecture diagram of the GitHub repository circse/lila_textlinker, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/circse/lila_textlinker
- Repository: https://github.com/circse/lila_textlinker

## Overview

LiLa Text Linker is a web application for processing Latin text, manually reviewing lemma links, and producing RDF editions integrated with the LiLa knowledge base. The visible GUI centers on text entry and token-level editing, with lemma lookup and lexical-resource exploration; backend servlets handle text processing and JSON/RDF output. The source index supports several Java call relationships, but excerpts do not expose the complete request flow or how generated output is delivered, so those links are omitted rather than inferred.

Main entry points: [`sources/text-linker-gui/src/Views/MainView.jsx`](https://github.com/circse/lila_textlinker/blob/main/sources/text-linker-gui/src/Views/MainView.jsx) (Text workspace), [`sources/text-linker-gui/src/utils/Sparql.js`](https://github.com/circse/lila_textlinker/blob/main/sources/text-linker-gui/src/utils/Sparql.js) (SPARQL client), [`sources/src/main/java/servlet/processText.java`](https://github.com/circse/lila_textlinker/blob/main/sources/src/main/java/servlet/processText.java) (Text processing servlet), [`sources/src/main/java/servlet/precess.java`](https://github.com/circse/lila_textlinker/blob/main/sources/src/main/java/servlet/precess.java) (Text linking servlet)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_gui["Text-linker GUI"]
  node_app["Application view<br/>[App.js]"]
  node_main["Text workspace<br/>[MainView.jsx]"]
  node_token["Token editor<br/>[Token.jsx]"]
  node_sentence["Sentence view<br/>[Sentence.jsx]"]
  node_ttlform["Edition form<br/>[TTLFormDialog.jsx]"]
end

subgraph group_processing["Text processing"]
  node_textservlet["Text processing servlet<br/>[processText.java]"]
  node_precess["Text linking servlet<br/>[precess.java]"]
  node_lemmabank["Lemma bank lookup"]
  node_network["Network helper<br/>[Network.java]"]
  node_conllfile["CoNLL-U file<br/>[ConllFile.java]"]
  node_conllsentence["CoNLL-U sentence<br/>[ConllSentence.java]"]
  node_conllword["CoNLL-U word<br/>[ConllWord.java]"]
  node_conllsupport["CoNLL-U validation<br/>[ValidFeatures.java]"]
  node_listener["Startup listener<br/>[Listener.java]"]
end

subgraph group_knowledge["LiLa knowledge access"]
  node_knowledgepanel["Lemma knowledge panel<br/>[LiLaKnowledge.jsx]"]
  node_spotlight["Lemma search<br/>[LemmaSpotlight.jsx]"]
  node_lexicons["Lexical resources"]
  node_lexiconviews["Lexicon views"]
  node_queries["SPARQL templates"]
  node_sparql["SPARQL client<br/>[Sparql.js]"]
end

subgraph group_output["Edition output"]
  node_jsonservlet["JSON export servlet<br/>[generateJSON.java]"]
  node_ttlservlet["RDF export servlet<br/>[generateTTL.java]"]
  node_ttlfunctions["RDF edition builder<br/>[TTLFunctions.java]"]
  node_loadttl["Endpoint loader"]
end

node_user(("Text editor"))
node_kb[("LiLa knowledge base")]
node_endpoint[("RDF endpoint")]

node_user -->|"edits text"| node_main
node_app -->|"renders"| node_main
node_main -->|"renders"| node_token
node_main -->|"renders"| node_sentence
node_main -->|"opens"| node_ttlform
node_main -->|"renders"| node_knowledgepanel
node_knowledgepanel -->|"renders"| node_spotlight
node_spotlight -->|"builds lookup"| node_queries
node_spotlight -->|"executes queries"| node_sparql
node_lexicons -->|"builds query"| node_queries
node_lexicons -->|"fetches entries"| node_sparql
node_lexicons -->|"dispatches entries"| node_lexiconviews
node_queries -->|"executes query"| node_sparql
node_sparql -->|"queries"| node_kb
node_textservlet -->|"loads lemmas"| node_lemmabank
node_textservlet -->|"uses network"| node_network
node_textservlet -->|"parses text"| node_conllfile
node_precess -->|"loads lemmas"| node_lemmabank
node_precess -->|"uses network"| node_network
node_precess -->|"parses text"| node_conllfile
node_conllfile -->|"creates sentences"| node_conllsentence
node_conllsentence -->|"manages words"| node_conllword
node_conllword -->|"validates features"| node_conllsupport
node_listener -->|"loads lemmas"| node_lemmabank
node_jsonservlet -->|"uses RDF functions"| node_ttlfunctions
node_ttlservlet -->|"uses RDF functions"| node_ttlfunctions
node_loadttl -->|"uses RDF functions"| node_ttlfunctions
node_loadttl -.->|"loads RDF"| node_endpoint

click node_app "https://github.com/circse/lila_textlinker/blob/main/sources/text-linker-gui/src/App.js"
click node_main "https://github.com/circse/lila_textlinker/blob/main/sources/text-linker-gui/src/Views/MainView.jsx"
click node_token "https://github.com/circse/lila_textlinker/blob/main/sources/text-linker-gui/src/components/Token.jsx"
click node_sentence "https://github.com/circse/lila_textlinker/blob/main/sources/text-linker-gui/src/components/Sentence.jsx"
click node_ttlform "https://github.com/circse/lila_textlinker/blob/main/sources/text-linker-gui/src/components/TTLFormDialog.jsx"
click node_knowledgepanel "https://github.com/circse/lila_textlinker/blob/main/sources/text-linker-gui/src/components/LiLaKnowledge.jsx"
click node_spotlight "https://github.com/circse/lila_textlinker/blob/main/sources/text-linker-gui/src/components/LemmaSpotlight.jsx"
click node_lexicons "https://github.com/circse/lila_textlinker/blob/main/sources/text-linker-gui/src/LiLaObjectsFacets/LiLaLexicalResources.jsx"
click node_lexiconviews "https://github.com/circse/lila_textlinker/tree/main/sources/text-linker-gui/src/LiLaObjectsFacets/LexicalResources"
click node_queries "https://github.com/circse/lila_textlinker/blob/main/sources/text-linker-gui/src/utils/SparqlQueriesTemplate.js"
click node_sparql "https://github.com/circse/lila_textlinker/blob/main/sources/text-linker-gui/src/utils/Sparql.js"
click node_textservlet "https://github.com/circse/lila_textlinker/blob/main/sources/src/main/java/servlet/processText.java"
click node_precess "https://github.com/circse/lila_textlinker/blob/main/sources/src/main/java/servlet/precess.java"
click node_lemmabank "https://github.com/circse/lila_textlinker/blob/main/sources/src/main/java/utils/CollectLemmaBank.java"
click node_network "https://github.com/circse/lila_textlinker/blob/main/sources/src/main/java/utils/Network.java"
click node_conllfile "https://github.com/circse/lila_textlinker/blob/main/sources/src/main/java/utils/conllu/ConllFile.java"
click node_conllsentence "https://github.com/circse/lila_textlinker/blob/main/sources/src/main/java/utils/conllu/ConllSentence.java"
click node_conllword "https://github.com/circse/lila_textlinker/blob/main/sources/src/main/java/utils/conllu/ConllWord.java"
click node_conllsupport "https://github.com/circse/lila_textlinker/blob/main/sources/src/main/java/utils/conllu/ValidFeatures.java"
click node_jsonservlet "https://github.com/circse/lila_textlinker/blob/main/sources/src/main/java/servlet/generateJSON.java"
click node_ttlservlet "https://github.com/circse/lila_textlinker/blob/main/sources/src/main/java/servlet/generateTTL.java"
click node_ttlfunctions "https://github.com/circse/lila_textlinker/blob/main/sources/src/main/java/utils/TTLFunctions.java"
click node_loadttl "https://github.com/circse/lila_textlinker/blob/main/sources/src/main/java/servlet/loadTTLToEndpoint.java"
click node_listener "https://github.com/circse/lila_textlinker/blob/main/sources/src/main/java/servlet/Listener.java"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_main,node_token,node_sentence,node_ttlform toneBlue
class node_textservlet,node_precess,node_lemmabank,node_network,node_conllfile,node_conllsentence,node_conllword,node_conllsupport,node_listener,node_kb,node_endpoint toneAmber
class node_knowledgepanel,node_spotlight,node_lexicons,node_lexiconviews,node_queries,node_sparql toneMint
class node_jsonservlet,node_ttlservlet,node_ttlfunctions,node_loadttl toneRose
class node_user toneIndigo
```

## Components

### Text-linker GUI

- [Application view](https://github.com/circse/lila_textlinker/blob/main/sources/text-linker-gui/src/App.js): `sources/text-linker-gui/src/App.js`
- [Text workspace](https://github.com/circse/lila_textlinker/blob/main/sources/text-linker-gui/src/Views/MainView.jsx): `sources/text-linker-gui/src/Views/MainView.jsx`
- [Token editor](https://github.com/circse/lila_textlinker/blob/main/sources/text-linker-gui/src/components/Token.jsx): `sources/text-linker-gui/src/components/Token.jsx`
- [Sentence view](https://github.com/circse/lila_textlinker/blob/main/sources/text-linker-gui/src/components/Sentence.jsx): `sources/text-linker-gui/src/components/Sentence.jsx`
- [Edition form](https://github.com/circse/lila_textlinker/blob/main/sources/text-linker-gui/src/components/TTLFormDialog.jsx): `sources/text-linker-gui/src/components/TTLFormDialog.jsx`

### Text processing

- [Text processing servlet](https://github.com/circse/lila_textlinker/blob/main/sources/src/main/java/servlet/processText.java): `sources/src/main/java/servlet/processText.java`
- [Text linking servlet](https://github.com/circse/lila_textlinker/blob/main/sources/src/main/java/servlet/precess.java): `sources/src/main/java/servlet/precess.java`
- [Lemma bank lookup](https://github.com/circse/lila_textlinker/blob/main/sources/src/main/java/utils/CollectLemmaBank.java): `sources/src/main/java/utils/CollectLemmaBank.java`
- [Network helper](https://github.com/circse/lila_textlinker/blob/main/sources/src/main/java/utils/Network.java): `sources/src/main/java/utils/Network.java`
- [CoNLL-U file](https://github.com/circse/lila_textlinker/blob/main/sources/src/main/java/utils/conllu/ConllFile.java): `sources/src/main/java/utils/conllu/ConllFile.java`
- [CoNLL-U sentence](https://github.com/circse/lila_textlinker/blob/main/sources/src/main/java/utils/conllu/ConllSentence.java): `sources/src/main/java/utils/conllu/ConllSentence.java`
- [CoNLL-U word](https://github.com/circse/lila_textlinker/blob/main/sources/src/main/java/utils/conllu/ConllWord.java): `sources/src/main/java/utils/conllu/ConllWord.java`
- [CoNLL-U validation](https://github.com/circse/lila_textlinker/blob/main/sources/src/main/java/utils/conllu/ValidFeatures.java): `sources/src/main/java/utils/conllu/ValidFeatures.java`
- [Startup listener](https://github.com/circse/lila_textlinker/blob/main/sources/src/main/java/servlet/Listener.java): `sources/src/main/java/servlet/Listener.java`

### LiLa knowledge access

- [Lemma knowledge panel](https://github.com/circse/lila_textlinker/blob/main/sources/text-linker-gui/src/components/LiLaKnowledge.jsx): `sources/text-linker-gui/src/components/LiLaKnowledge.jsx`
- [Lemma search](https://github.com/circse/lila_textlinker/blob/main/sources/text-linker-gui/src/components/LemmaSpotlight.jsx): `sources/text-linker-gui/src/components/LemmaSpotlight.jsx`
- [Lexical resources](https://github.com/circse/lila_textlinker/blob/main/sources/text-linker-gui/src/LiLaObjectsFacets/LiLaLexicalResources.jsx): `sources/text-linker-gui/src/LiLaObjectsFacets/LiLaLexicalResources.jsx`
- [Lexicon views](https://github.com/circse/lila_textlinker/tree/main/sources/text-linker-gui/src/LiLaObjectsFacets/LexicalResources): `sources/text-linker-gui/src/LiLaObjectsFacets/LexicalResources`
- [SPARQL templates](https://github.com/circse/lila_textlinker/blob/main/sources/text-linker-gui/src/utils/SparqlQueriesTemplate.js): `sources/text-linker-gui/src/utils/SparqlQueriesTemplate.js`
- [SPARQL client](https://github.com/circse/lila_textlinker/blob/main/sources/text-linker-gui/src/utils/Sparql.js): `sources/text-linker-gui/src/utils/Sparql.js`

### Edition output

- [JSON export servlet](https://github.com/circse/lila_textlinker/blob/main/sources/src/main/java/servlet/generateJSON.java): `sources/src/main/java/servlet/generateJSON.java`
- [RDF export servlet](https://github.com/circse/lila_textlinker/blob/main/sources/src/main/java/servlet/generateTTL.java): `sources/src/main/java/servlet/generateTTL.java`
- [RDF edition builder](https://github.com/circse/lila_textlinker/blob/main/sources/src/main/java/utils/TTLFunctions.java): `sources/src/main/java/utils/TTLFunctions.java`
- [Endpoint loader](https://github.com/circse/lila_textlinker/blob/main/sources/src/main/java/servlet/loadTTLToEndpoint.java): `sources/src/main/java/servlet/loadTTLToEndpoint.java`

### Other components

- **Text editor**
- **LiLa knowledge base**
- **RDF endpoint**

## Connections

- Text editor → Text workspace: edits text
- Application view → Text workspace: renders (evidence: `sources/text-linker-gui/src/App.js`)
- Text workspace → Token editor: renders (evidence: `sources/text-linker-gui/src/Views/MainView.jsx`)
- Text workspace → Sentence view: renders (evidence: `sources/text-linker-gui/src/Views/MainView.jsx`)
- Text workspace → Edition form: opens (evidence: `sources/text-linker-gui/src/Views/MainView.jsx`)
- Text workspace → Lemma knowledge panel: renders (evidence: `sources/text-linker-gui/src/Views/MainView.jsx`)
- Lemma knowledge panel → Lemma search: renders (evidence: `sources/text-linker-gui/src/components/LiLaKnowledge.jsx`)
- Lemma search → SPARQL templates: builds lookup (evidence: `sources/text-linker-gui/src/components/LemmaSpotlight.jsx`)
- Lemma search → SPARQL client: executes queries (evidence: `sources/text-linker-gui/src/components/LemmaSpotlight.jsx`)
- Lexical resources → SPARQL templates: builds query (evidence: `sources/text-linker-gui/src/LiLaObjectsFacets/LiLaLexicalResources.jsx`)
- Lexical resources → SPARQL client: fetches entries (evidence: `sources/text-linker-gui/src/LiLaObjectsFacets/LiLaLexicalResources.jsx`)
- Lexical resources → Lexicon views: dispatches entries (evidence: `sources/text-linker-gui/src/LiLaObjectsFacets/LiLaLexicalResources.jsx`)
- SPARQL templates → SPARQL client: executes query (evidence: `sources/text-linker-gui/src/utils/SparqlQueriesTemplate.js`)
- SPARQL client → LiLa knowledge base: queries (evidence: `sources/text-linker-gui/src/utils/Sparql.js`)
- Text processing servlet → Lemma bank lookup: loads lemmas (evidence: `sources/src/main/java/servlet/processText.java`)
- Text processing servlet → Network helper: uses network (evidence: `sources/src/main/java/servlet/processText.java`)
- Text processing servlet → CoNLL-U file: parses text (evidence: `sources/src/main/java/servlet/processText.java`)
- Text linking servlet → Lemma bank lookup: loads lemmas (evidence: `sources/src/main/java/servlet/precess.java`)
- Text linking servlet → Network helper: uses network (evidence: `sources/src/main/java/servlet/precess.java`)
- Text linking servlet → CoNLL-U file: parses text (evidence: `sources/src/main/java/servlet/precess.java`)
- CoNLL-U file → CoNLL-U sentence: creates sentences (evidence: `sources/src/main/java/utils/conllu/ConllFile.java`)
- CoNLL-U sentence → CoNLL-U word: manages words (evidence: `sources/src/main/java/utils/conllu/ConllSentence.java`)
- CoNLL-U word → CoNLL-U validation: validates features (evidence: `sources/src/main/java/utils/conllu/ConllWord.java`)
- Startup listener → Lemma bank lookup: loads lemmas (evidence: `sources/src/main/java/servlet/Listener.java`)
- JSON export servlet → RDF edition builder: uses RDF functions (evidence: `sources/src/main/java/servlet/generateJSON.java`)
- RDF export servlet → RDF edition builder: uses RDF functions (evidence: `sources/src/main/java/servlet/generateTTL.java`)
- Endpoint loader → RDF edition builder: uses RDF functions (evidence: `sources/src/main/java/servlet/loadTTLToEndpoint.java`)
- Endpoint loader → RDF endpoint: loads RDF
