Session 11 of Going Meta, broadcast on December 6, 2022, closes Season 1 with a fresh take on graph data quality. Inspired by the Great Expectations framework for tabular data, Jesus introduces the graphexpectations Python library: a way to express data quality rules as readable Python method calls, execute them against a live Neo4j database, and automatically serialize the results as SHACL shapes for version control and cross-tool compatibility.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/jbarrasa/goingmeta/llms.txt
Use this file to discover all available pages before exploring further.
What You Will Learn
- How to install and import the
graphexpectationspackage - How to define expectations per node type: regex patterns, value ranges, cardinality constraints, and type-checking
- How to target a subset of nodes using a Cypher pattern (query-based selection) rather than a label
- How to combine multiple expectation sets into a reusable
Suite - How to serialize a suite as SHACL (Turtle) for storage and interoperability with other tools
- How to bind the suite to a running Neo4j database and execute all validations in one call
- How to visualize the violation breakdown with Plotly
Tags:
Python · Data Quality · SHACL — Broadcast December 6, 2022The Five-Step Workflow
Define expectation sets per node type
Each
ge.Set targets either a node label or a Cypher graph pattern. Methods express the rules in plain English-style API calls.Serialize to SHACL for version control
Call Example output (abbreviated):
s.serialise() to get a Turtle-formatted SHACL document that encodes every expectation as a node shape — ready to commit to git or share with SHACL-native tools.graphexpectations vs. SHACL Directly
graphexpectations
Python-native API, readable method names, integrates with pandas and Plotly for reporting, generates SHACL automatically as an output artifact.
SHACL with n10s
Standards-based, portable across any SHACL-compliant engine, directly supported in Neo4j via the n10s
n10s.validation.shacl.validate procedure.The two approaches are complementary: use
graphexpectations when you want a developer-friendly authoring experience and use the serialized SHACL output when you need to share rules with other systems or enforce them at the RDF layer.Resources
Watch the Recording
Full live-stream on YouTube — Session 11, December 6 2022
Source Code on GitHub
Colab notebook, graphexpectations examples, and SHACL output