Session 19 of Going Meta, broadcast on August 1, 2023, addresses a real-world challenge for ontology engineers: how do you track and compare changes between successive versions of an OWL ontology? Jesus Barrasa demonstrates an approach built entirely on Neo4j Enterprise — one database per ontology version, a composite database to span them all, and CypherDocumentation 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.
USE clauses to compute diffs between versions. The resulting change sets are visualised in a live NeoDash dashboard.
What You’ll Learn
- How to create separate Neo4j databases for each ontology version
- How to configure neosemantics (n10s) consistently across all version databases
- How to create a composite database with version aliases
- How to compute added and removed classes between versions using cross-database Cypher calls
- How to use a NeoDash dashboard to browse the change history visually
Architecture Overview
One Database per Version
Each ontology version (
v0, v1, v2) lives in its own Neo4j database, imported with neosemantics. This keeps versions isolated and queryable independently.Composite Database for Diffing
A Neo4j composite database (
ontos) with aliased targets (ontos.v0, ontos.v1, ontos.v2) allows cross-version Cypher queries using USE subqueries.Step-by-Step Walkthrough
Create databases for each ontology version
Create one database per version and configure each for RDF import, enabling multi-valued properties and language tag retention:
handleMultival: "ARRAY" is essential for rdfs:label and rdfs:comment, which commonly appear once per language in an OWL ontology. Without it, only one language tag would be retained.Create a composite database with version aliases
Group all version databases under a single composite database so they can be queried together:
Import ontology versions using the Python notebook
Use the
session19/versioning_ontos.ipynb Python notebook to load each version of the OWL ontology into its respective database. The notebook uses neosemantics to fetch the ontology files (created in Protégé) and imports them into ontov0, ontov1, and ontov2.Compute the diff between two versions
Switch to the composite database and use
CALL { USE … } subqueries to collect classes from each version, then calculate what was added in v1 that wasn’t in v0:Key Concepts
Composite Databases
Neo4j Enterprise’s composite databases are the backbone of this approach, enabling a single Cypher query to span multiple isolated graph databases.
USE Subqueries
CALL { USE db.alias … } subqueries let you collect data from each version database and join the results in the outer query — the foundation of the diff calculation.Protégé Integration
Ontology versions are authored in Protégé and exported as OWL/Turtle files, then loaded into Neo4j via neosemantics — a realistic enterprise workflow.
NeoDash Visualisation
The session includes a ready-made NeoDash dashboard that renders the version diff as an interactive graph, making ontology changes visible to non-technical stakeholders.
Resources
Watch the Recording
Full session recording on YouTube — August 1, 2023.
Session Code
CQL scripts, Python notebook, and NeoDash dashboard on GitHub.