Converts ISO 20022 camt.053 bank statement XML files into RDF using konstrukt.
Tested with camt.053.001.04 account statements from PostFinance Switzerland.
Load XML
↓
SPARQL CONSTRUCT → clean ISO 20022 RDF → output/camt.nt
↓
SPARQL CONSTRUCT → OLAP cube observations → output/cube.nt
Stage 2 (queries/01-camt-to-rdf/) produces named RDF nodes for Statements, Entries, and Balances with all key fields from the camt.053 structure.
Stage 3 (queries/02-rdf-to-cube/) derives one cube:Observation per entry using the cube.link vocabulary, suited for aggregation and analytics.
# Default: loads from input/
./run.sh
# Custom input directory
./run.sh /path/to/statements/Load output/camt.nt and/or output/cube.nt into any SPARQL endpoint. A QLever setup is included in qlever/:
cd qlever
qlever index --overwrite-existing
qlever startSample queries and an interactive notebook are in docs/QUERIES.sparqlbook — open with the SPARQL Notebook VS Code extension. The raw .rq files are in docs/sparql/.
Run the smoke test to verify all queries return results:
./smoke-test.sh| Prefix | Namespace |
|---|---|
iso20022: |
http://example.org/iso20022# |
cube: |
https://cube.link/ |
dim: |
https://example.org/dimension/ |
| Resource | IRI |
|---|---|
| Statement | http://example.org/statement/{stmtId} |
| Entry | http://example.org/entry/{acctSvcrRef} |
| Balance | http://example.org/balance/{stmtId}/{balType} |
| Observation | https://example.org/observation/{acctSvcrRef} |
- konstrukt in
$PATH envsubst(standard on macOS/Linux)
Schema files available from the official ISO 20022 message definitions catalogue at https://www.iso20022.org/iso-20022-message-definitions. The input files use camt.053.001.04.