Skip to content

Commit 83272ef

Browse files
committed
maybe better
1 parent c10e53b commit 83272ef

File tree

1 file changed

+43
-1
lines changed

1 file changed

+43
-1
lines changed

CLAUDE.md

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,46 @@ The following libraries should be preferred to alternatives when their functiona
4343
- templating : nunjucks
4444
- markdown : marked
4545

46-
Read `docs/overview.md` for a description of core features of the Transmissions framework.
46+
## Transmissions Framework
47+
48+
### Architecture Overview
49+
50+
Transmissions is a message-driven pipeline framework where:
51+
- **Messages** flow through pipelines of processors
52+
- **Processors** transform messages and emit them to the next processor
53+
- **Pipelines** are defined in RDF/Turtle configuration files
54+
55+
### Key Concepts
56+
57+
**Message Flow:**
58+
- Messages are JavaScript objects that flow through processors
59+
- Each processor receives a message, processes it, and emits it via `this.emit('message', message)`
60+
- Processors can add/modify fields on the message object
61+
- The `done` flag is used by spawning processors (ForEach, Fork, DirWalker) to indicate completion
62+
63+
**Configuration:**
64+
- `transmissions.ttl` - Defines the pipeline structure and processor connections
65+
- `config.ttl` - Contains processor settings and configuration values
66+
- Configuration uses RDF/Turtle syntax with `:pipe` defining processor sequence
67+
68+
**Path Access:**
69+
- Use `JSONUtils.get(object, "path.to.field")` for reading nested properties
70+
- Use `JSONUtils.set(object, "path.to.field", value)` for setting nested properties
71+
- Supports array indices: `"field[0].property"` or `"field.array[2]"`
72+
73+
**Common Patterns:**
74+
- `getProperty(ns.trn.propertyName, defaultValue)` - Gets config values, checks message first then config
75+
- Templates use Nunjucks with `{{variable}}` syntax
76+
- SPARQL queries use `PREFIX` declarations and support graph operations
77+
78+
**Processor Types:**
79+
- **Flow:** ForEach, Fork, Choice, Accumulate - control message flow
80+
- **SPARQL:** SPARQLSelect, SPARQLUpdate - interact with RDF stores
81+
- **Transform:** Restructure, PathOps - modify message structure
82+
- **I/O:** FileReader, FileWriter, HttpClient - external interactions
83+
- **Note:** Many more processors exist in `src/processors/`. Always search for existing processors before creating new ones. Use `Glob` to find processors: `src/processors/**/*.js`
84+
85+
**Debugging:**
86+
- Run with `-v` flag for verbose output: `./trans -v app-name`
87+
- Use `LOG_LEVEL=debug` for detailed logging
88+
- Add `:SM` (ShowMessage) processor in pipeline to inspect messages

0 commit comments

Comments
 (0)