MDF Enforced Validator and Loader

Logo

Documentation for MEVAL.

Loader Workflows

MEVAL repo contains ready-to-deploy Prefect workflows. A handful of workflows below (in workflows/prefect/) instantiate and use a meval.loader.Loader instance to read/write the graph database. Each flow first retrieves database credentials from AWS Secrets Manager and creates a neo4j.GraphDatabase.driver, then wraps it with Loader(driver=driver) before calling one or more Loader methods.

Contents

upsert_workflow.py — Dataloading Upsert Workflow

Contains the two main data-loading flows, both of which create a Loader and use it to create indexes and upsert nodes/relationships:

wipe_database.py — Wipe out Database Flow

Creates a Loader and calls Loader.wipe_database() to delete all nodes/relationships, followed by Loader.drop_all_indexes(). Destructive and irreversible — intended for non-production/test databases.

delete_database_study_subgraph.py — Delete Database Study Subgraph Flow

Creates a Loader and, for each given root node property value (e.g. a list of study accessions), calls Loader.wipe_rooted_subgraph(root_node_label, root_node_prop, subgraph_value) to delete that entire rooted subgraph.

find_anchored_traversals.py — Find Anchored Traversals Flow

Creates a Loader and, for each given intermediate-root node value (e.g. a list of participant IDs), calls Loader.viz_intermediate_anchored_traversals(...) to render and upload an HTML visualization of all descendant traversals within a larger rooted subgraph.

precision_deletion_guid.py — Precision Deletion Nodes

Creates a Loader and calls Loader.delete_nodes_by_prop_value(identifier_list, property_name) to delete a specific set of nodes identified by UUID/guid values. Also invokes find_floating_db_nodes_flow (via find_db_floating_nodes.py) to report orphan nodes created as a side effect of the deletion, honoring the dry_run flag before any deletion occurs.

find_db_floating_nodes.py — Find/delete floating (orphan) nodes

Defines two small sub-flows that take an existing Loader instance as a parameter (rather than creating their own driver), so they can be reused inside other flows:

These two are called from both upsert_workflow.py (optional floating-node cleanup after loading) and precision_deletion_guid.py (reporting/cleanup after precision deletion), rather than being deployed as standalone entrypoints.