This project runs a pipeline that:
- starts GraphDB (via Docker),
- creates the GraphDB repository if needed,
- imports our ontology to GraphDB,
- converts ASAM OpenLABEL JSON files (generated from OmegaPRIME) to RDF (Synergies.nq),
- detects events/actions with SPARQL (queries_Synergies.nt),
- optionally writes those actions/events back into ASAM OpenLABEL files.
- Docker
- Python 3.9+
Edit conf.yaml before running the pipeline if you need to change paths, ports, or repository names.
ontology: base URI, prefix, and the ontology file path.vcd.vcd_path: input ASAM OpenLABELs folder (source JSON files).paths.output_dir: output folder for ASAM OpenLABELs with actions/events.database: GraphDB connection (ip/port/repository).endpoint_url: full GraphDB SPARQL endpoint.api: optional class discovery API (used in preload).thresholds: numerical thresholds used for event/action detection.
From the repository root, run:
python .\run_pipeline.pyThe script will:
- start GraphDB (Docker) if needed,
- create the repository if it does not exist,
- import the ontology,
- ask whether to run
preload.pyin multiprocessing or sequential mode, - run
preload.pyand generateSynergies.nq, - pause and ask you to import
Synergies.nqmanually, - run
queries.pyand generatequeries_Synergies.nt, - pause and ask you to import
queries_Synergies.ntmanually, - ask if you want to export actions/events back to OpenLABEL.
Before running preload.py, the script asks:
- Multiprocessing (default): faster, but can fail on low RAM.
- Sequential: slower, but more stable.
When the console tells you to import Synergies.nq:
- Open GraphDB Workbench.
- Go to Import -> Server Files.
- Select
Synergies.nqand click Import. - Wait for the import to finish.
When the console tells you to import queries:
- Open Import -> Server Files again.
- Select only
queries_Synergies.nt. - Do not select
Synergies.nqat this step. - Click Import and wait for it to finish.
At the end, the pipeline asks:
Do you want to export actions/events back to OpenLABELs? [y/N]
If you answer yes, it will create the output files in the folder from:
conf.yaml -> paths.output_dir (default: ./output_openlabels/).
This will read the RDF in GraphDB and write the enriched OpenLABELs into paths.output_dir.
You can skip steps if you only want to repeat a part:
- Re-run only
preload.py(skip ontology + queries):python .\run_pipeline.py --skip-ontology --skip-queries
- Re-run only
queries.py(skip ontology + preload):python .\run_pipeline.py --skip-ontology --skip-preload
- Run without starting Docker (GraphDB already running):
python .\run_pipeline.py --no-docker
- Only export OpenLABELs (no pipeline, just write actions/events):
python .\graphdb_to_vcd_parser.py
This package is developed as part of the SYNERGIES project and is funded by the European Union. Views and opinions expressed are however those of the author(s) only and do not necessarily reflect those of the European Union or European Climate, Infrastructure and Environment Executive Agency (CINEA). Neither the European Union nor the granting authority can be held responsible for them.
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.



