This guide explains how to create Transmissions applications - complete data processing workflows that solve specific problems.
A Transmissions app is a directory containing:
my-app/
├── transmissions.ttl # Required: Pipeline definitions
├── config.ttl # Optional: Configuration data
├── about.md # Optional: Documentation
└── data/ # Optional: Working directory for files
Apps live under src/apps/
. For this example, we'll create a text processing app:
mkdir -p src/apps/text-processor
cd src/apps/text-processor
This file defines your processing pipelines:
# src/apps/text-processor/transmissions.ttl
@prefix : <http://purl.org/stuff/transmissions/> .
# Main processing pipeline
:text-processor a :EntryTransmission ;
:pipe (
:read-input
:process-text
:write-output
) .
# Read input file
:read-input a :FileReader ;
:settings :inputSettings .
# Transform the text
:process-text a :StringReplace ;
:settings :replaceSettings .
# Write result
:write-output a :FileWriter ;
:settings :outputSettings .
# Configuration sets
:inputSettings a :ConfigSet ;
:filename "input.txt" .
:replaceSettings a :ConfigSet ;
:find "old" ;
:replace "new" .
:outputSettings a :ConfigSet ;
:filename "output.txt" .
For reusable configuration data:
# src/apps/text-processor/config.ttl
@prefix : <http://purl.org/stuff/transmissions/> .
:appConfig a :ConfigSet ;
:inputDirectory "data/input" ;
:outputDirectory "data/output" ;
:logLevel "debug" .
# Text Processor App
Processes text files by replacing specified strings.
## Usage
```bash
./trans text-processor
data/input.txt
data/output.txt
## Running Your App
Execute your app with:
```bash
./trans text-processor
Pass messages via command line:
./trans text-processor -m '{"filename": "custom.txt"}'
Process data through a sequence of steps:
:linear-app a :EntryTransmission ;
:pipe (:step1 :step2 :step3) .
Use Choice for branching logic:
:conditional-app a :EntryTransmission ;
:pipe (
:setup-data
:make-choice
:handle-result
) .
:make-choice a :Choice ;
:settings [
:testProperty "type" ;
:testOperator "equals" ;
:testValue "premium" ;
:trueProperty "processing" ;
:trueValue "premium-flow" ;
:falseProperty "processing" ;
:falseValue "standard-flow"
] .
Use GOTO for complex workflows:
:main-flow a :EntryTransmission ;
:pipe (
:validate-input
:route-to-processor
) .
:route-to-processor a :GOTO ;
:settings [
:gotoTarget "data-processor"
] .
:data-processor a :Transmission ;
:pipe (
:process-data
:format-output
) .
Use ForEach for arrays:
:batch-processor a :EntryTransmission ;
:pipe (
:load-batch
:process-each
:collect-results
) .
:process-each a :ForEach ;
:settings [
:arrayProperty "items" ;
:itemProperty "currentItem"
] .
Settings defined directly in transmissions.ttl:
:processor a :FileReader ;
:settings [
:filename "data.json" ;
:encoding "utf8"
] .
Reusable configuration objects:
:processor a :FileReader ;
:settings :fileConfig .
:fileConfig a :ConfigSet ;
:filename "data.json" ;
:encoding "utf8" .
Reference config.ttl data:
# In transmissions.ttl
:processor a :FileReader ;
:settings :globalFileConfig .
# In config.ttl
:globalFileConfig a :ConfigSet ;
:filename "shared-data.json" .
Use message properties for dynamic config:
:dynamic-processor a :FileReader ;
:settings [
:filename "{{filename}}" ; # Replaced with message.filename
:path "{{inputPath}}" # Replaced with message.inputPath
] .
Add validation to catch errors early:
:robust-app a :EntryTransmission ;
:pipe (
:validate-input
:process-safely
:handle-errors
) .
Use Choice for error handling:
:error-handler a :Choice ;
:settings [
:testProperty "error" ;
:testOperator "exists" ;
:trueProperty "goto" ;
:trueValue "error-recovery" ;
:falseProperty "goto" ;
:falseValue "normal-flow"
] .
# Test with default settings
./trans my-app
# Test with custom message
./trans my-app -m '{"test": true}'
# Test with verbose output
./trans my-app -v
Add your app to tests/integration/apps.json
:
{
"command": "./trans my-app",
"label": "my-app",
"description": "Test my custom app",
"requiredMatchCount": 1
}
Create focused test apps for specific scenarios:
src/apps/test/my-app-basic/ # Basic functionality
src/apps/test/my-app-errors/ # Error conditions
src/apps/test/my-app-edge/ # Edge cases
Your app will integrate seamlessly with the Transmissions framework, gaining access to all built-in processors and the powerful RDF-based configuration system.