This tool converts music scores modeled in the MEI XML dialect into Cypher dumps, which can be used to populate a Neo4j graph database (tested with version 4.2.1.X). It powers the graph-based representation of digital scores used in the SKRID project.
- Parses MEI files into internal graph structures.
- Translates internal representations into Cypher queries.
- Designed for integration with Neo4j for symbolic music analysis.
- Includes CLI for file-based operations.
git clone https://gitlab.inria.fr/skrid/data-ingestion.git
cd data-ingestion/Requires Python 3.6+
(You can use a virtual environment if desired)
python3 -m venv venv
source venv/bin/activateInstall the dependencies:
pip install -r requirements.txt
Run the converter
python3 main.py -hCLI Options
usage: python3 main.py [-h] [-V] [-v] [-n] [-o OUTPUT_FOLDER] [-q CQL] files [files ...]
Compiles MEI files into Cypher queries for Neo4j ingestion.
positional arguments:
files MEI files to convert. Appends '_dump.cypher' to basename.
options:
-h, --help Show this help message and exit
-V, --version Show version and exit
-v, --verbose Print logs during conversion
-n, --no-confirmation Skip confirmation prompts
-o, --output-folder Output folder for the generated Cypher files
-q, --cql Also generate a .cql loader file for all output
data-ingestion/
├── main.py # Main CLI entry point
├── src/
│ ├── graph/ # Internal graph model components
│ │ ├── Event.py
│ │ ├── Fact.py
│ │ ├── Measure.py
│ │ ├── Score.py
│ │ ├── TopRhythmic.py
│ │ ├── Voice.py
│ │ └── utils_graph.py
│ ├── MeiToGraph.py # MEI parser
│ ├── ParserUi.py # CLI logic
│ └── utils.py
│
├── mei/ # Sample MEI files for testing
├── LICENSE.md # Project license
├── README.md # You’re reading it!
└── TODO.md # Development roadmap
Each MEI file goes through a two-phase process:
-
Parsing: The file is parsed into an internal object graph (with classes like Score, Voice, Measure, etc.).
-
Exporting: That graph is compiled into Cypher statements for Neo4j ingestion.
This modular separation allows you to inspect or manipulate the graph before export if needed.
See TODO.md for the current list of planned enhancements, open issues, and known limitations.
This project is distributed under the MIT License.
See LICENSE for details.
(Copyright © 2023–2025 IRISA)