Skip to main content

MDF Enforced Validator and Loader

Project description

MDF Enforced Validator and Loader (MEVAL)

MDF Enforced Validator and Loader is a lightweight and modular framework designed to ensure data integrity through MDF enforced validation and seamless data ingestion into the graph database. This repository serves as the source code for MEVAL, providing tools, scripts, and workflows to validate and load data to graph database using Graph Model Description Format (MDF) as the source of accessing model features.

Core Modules

MEVAL includes three core classes under the meval package that work together to support model-aware validation and graph loading workflows:

ModelParser (meval/parser.py)

ModelParser wraps bento_mdf.MDFReader and provides easy access to MDF model metadata.(bento_mdf repository: https://github.com/CBIIT/bento-mdf)

It is used to inspect node definitions, key properties, required fields, parent-child relationships, property types, and permissible values. This class is the model introspection layer used by both validation and loading logic.

Loader (meval/loader.py)

Loader handles graph database ingestion for TSV data files. It reads files in chunks, prepares node properties and relationships from each chunk, and performs upsert operations (MERGE semantics) for nodes and edges. It also includes helper methods for index creation, duplicate cleanup, and graph maintenance tasks such as finding floating/orphan nodes (nodes without a path to a root node, such as study/program node).

Validator (meval/validator.py)

Validator enforces MDF-based data quality checks before loading. It validates TSV file format, validates record-level values against model constraints, checks relationship consistency across files, and supports unique-entry checks. It also provides utilities such as deterministic UUID generation and adding UUID columns to TSV files.

Installation

Prerequisites

  • Python 3.13

Install from source

  1. Clone this repository.
  2. Create and activate a virtual environment.
  3. Install dependencies:
    • pip install -r requirements_python3.13.txt
  4. Install the package:
    • pip install .

Example Usage (Imports and Instances)

from neo4j import GraphDatabase
from meval.loader import Loader
from meval.parser import ModelParser
from meval.validator import Validator

# Create ModelParser
model_parser = ModelParser(
   model_file="tests/test_files/ccdi-dcc-model-test.yml",
   props_file="tests/test_files/ccdi-dcc-model-props-test.yml",
   handle="ccdi_dcc",
)

# Create Validator (uses MDF object from ModelParser)
validator = Validator(mdf=model_parser.mdf)

# Create Loader
driver = GraphDatabase.driver(
   "bolt://localhost:7687",
   auth=("neo4j", "your_password"),
)
loader = Loader(driver=driver)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ctos_meval-1.1.0.tar.gz (37.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ctos_meval-1.1.0-py3-none-any.whl (33.6 kB view details)

Uploaded Python 3

File details

Details for the file ctos_meval-1.1.0.tar.gz.

File metadata

  • Download URL: ctos_meval-1.1.0.tar.gz
  • Upload date:
  • Size: 37.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for ctos_meval-1.1.0.tar.gz
Algorithm Hash digest
SHA256 d88db59566c38c0dadb0d37cda8a9c4018fd8d7f9acfd811d003e36860f9c509
MD5 c20321d3b16578d80c7cfa2c40be16ed
BLAKE2b-256 8f6fbea2f98d49549c448f9ad2033a122194f720bf91d18a56feaa53c16a6610

See more details on using hashes here.

File details

Details for the file ctos_meval-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: ctos_meval-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 33.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for ctos_meval-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0ae58b9d41fcacb368ac3d95ab419273bade21d8e4bab0823b2a39d78feea298
MD5 25cc3017688fb2142795cd246ca5f1b8
BLAKE2b-256 d30e1cb475cd816ad7e062196210b03909f2640135ab519635ef05ae35cfd3ad

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page