Skip to content

daimoners/sinbad

Repository files navigation

SINBAD – Semantic Interoperability of Battery Data

Sinbad logo

License: MIT Python 3.9+ RDF

SINBAD (Semantic Interoperability of Battery Data) is a Python framework for FAIR (Findable, Accessible, Interoperable, Reusable) integration of heterogeneous battery data—from laboratory experiments, industrial sensors, and simulators—into a unified semantic knowledge graph compliant with the BattINFO ontology and European Battery Passport requirements.


✨ Features

  • Multi-source ingestion: Supports synthetic experiments, Oxford Battery Dataset (.mat → CSV), and NREL Battery Archive.
  • Structured modeling: Pydantic-based BatteryExperimentalData ensures data integrity.
  • JSON-LD serialization: Semantic documents with BattINFO/EMMO/SOSA context and raw file traceability.
  • MongoDB storage: Persistent storage with provenance metadata (source, ingestion_date, rawDataFile).
  • Knowledge Graph: Builds RDF graphs (Turtle/XML) from JSON-LD using ontologies.
  • Querying: SPARQL support and interactive Streamlit dashboard.
  • Extensible: Add new data sources via BaseAdapter.

🚀 Quick Start

1. Install

git clone https://github.com/daimoners/sinbad.git
cd sinbad
pip install -e ".[dashboard,dev]"

2. Configure

Create a .env file:

MONGODB_URI=mongodb://localhost:27017
MONGODB_DB=sinbad_db
MONGODB_COLLECTION=sinbad_data
SINBAD_NAMESPACE=https://w3id.org/sinbad/data

3. Quick demo

./run_demo.sh

4. Generate and Ingest Sample Data

# Generate synthetic experiments
python scripts/generate_data.py --type synthetic --count 3

# Ingest into MongoDB
sinbad ingest synthetic examples/synthetic_experiments/metadata

# Build Knowledge Graph
sinbad build-kg --output output/unified_kg.rdf --format xml

5. Query the Knowledge Graph

Option A: CLI SPARQL

SPARQL (see scripts/query_rdf_sample.py)

Option B: Web Dashboard

sinbad dashboard --kg output/unified_kg.rdf

Then open http://localhost:8501.


🧩 Architecture Overview

Raw Data (JSON+CSV / .mat / CSV)
       ↓
Adapter → BatteryExperimentalData (Pydantic)
       ↓
JSONLDWriter → JSON-LD with @context
       ↓
MongoDB (with _metadata)
       ↓
KG Builder → RDF Graph (BattINFO + EMMO + SOSA)
       ↓
SPARQL / Streamlit Dashboard

📂 Project Structure

sinbad/
├── src/sinbad/                # Core framework
│   ├── ai/                    # ML dataset extraction & training
│   ├── cli/                   # Typer-based CLI
│   ├── core/                  # Models, config, JSON-LD context
│   ├── graph/                 # Ontology resolver, KG builder
│   ├── io/                    # Adapters and serializers
│   ├── storage/               # MongoDB backend
│   └── dashboard/             # Streamlit app
├── scripts/                   # Data generation & pipeline utilities
├── examples/                  # Sample datasets
├── assets/ontology/           # Cached ontologies (BattINFO, SINBAD extension)
├── docs/                      # Sphinx documentation
└── output/                    # Generated KG, CSV, plots

🤝 Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Write tests
  4. Submit a pull request

📚 Documentation

Full API and user guides are available at:
👉 https://sinbad.readthedocs.io

To build locally:

cd docs
make html

📜 License

Distributed under the MIT License. See LICENSE for details.


🙏 Acknowledgements

  • BattINFO Ontology – developed by the BIG-MAP initiative.
  • EMMO – European Materials Modelling Ontology.
  • NREL & Oxford University – for open battery datasets.

📬 Contact

For questions or collaboration:
DAIMON Team - CNR-ISMN Bologna, Italydaimoners@gmail.com


SINBAD v1.0 – Enabling semantic interoperability for the battery data ecosystem. 🔋🌍

About

Semantic Interoperability of Battery Data

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors