ShExStatements converts CSV-like statements and spreadsheet files into Shape Expressions (ShEx).
WASM(in-browser conversion via Pyodide)Docker(frontend + backend services)Python(CLI and legacy Flask web app)
Clone and install:
git clone https://github.com/johnsamuelwrites/ShExStatements.git
cd ShExStatements
python3 -m venv .venv
source .venv/bin/activate
pip3 install .Run CLI conversion:
./shexstatements.sh examples/language.csvUse a different delimiter:
./shexstatements.sh examples/languagedelimsemicolon.csv --delim ";"Skip CSV header:
./shexstatements.sh --skipheader examples/header/languageheader.csvConvert spreadsheet files:
./shexstatements.sh examples/language.ods
./shexstatements.sh examples/language.xls
./shexstatements.sh examples/language.xlsxRun legacy Flask UI:
./shexstatements.sh -rLegacy UI URL: http://127.0.0.1:5000/
From repository root:
cd docker
docker compose upServices:
- Frontend:
http://localhost:3000 - Backend API:
http://localhost:8000 - Swagger UI:
http://localhost:8000/docs
Development mode:
cd docker
docker compose -f docker-compose.yml -f docker-compose.dev.yml upThe frontend can convert in the browser with runtime mode set to wasm (for example in GitHub Pages builds).
In WASM mode:
- Text conversion is done fully in-browser.
- File conversion supports
.csv,.xlsx,.xls, and.ods. - Python packages are installed in Pyodide at runtime.
Typical row structure:
@node|property|value|cardinality|comment
Column expectations:
- 1: node name
- 2: property
- 3: allowed value(s)
- 4: cardinality (optional)
- 5: comment (optional, starts with
#)
Cardinality values:
*: zero or more+: one or morem: exactlymm,n: betweenmandn, inclusive
Application profile CSV format:
Entity_name,Property,Property_label,Mand,Repeat,Value,Value_type,Annotation
Command:
./shexstatements.sh -ap --skipheader examples/languageap.csvExamples are available in the examples directory.