Season 3, Episode 4 of Going Meta introduces a set of structural quality metrics for OWL ontologies that can be computed entirely in Cypher once an ontology has been loaded into Neo4j withDocumentation 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.
n10s (neosemantics). The session adapts five metrics from the software engineering literature — originally designed for object-oriented code quality — and applies them to ontology evaluation. The result is a lightweight, repeatable quality dashboard that requires no external tooling beyond a running Neo4j instance.
Watch the Recording
Season 3, Episode 4 — January 2026
Session Code
Cypher queries and Python evaluation script
Prerequisites
Load your OWL ontology into Neo4j usingn10s. After import, OWL classes are stored as (:owl__Class) nodes, datatype properties as (:owl__DatatypeProperty), object properties as (:owl__ObjectProperty), and the subclass hierarchy as [:rdfs__subClassOf] relationships. Domain and range axioms become [:rdfs__domain] and [:rdfs__range] edges.
The Five Metrics
1. CCC — Class Connectivity Coverage
Definition: The fraction of classes that participate in at least one object property relationship (as domain or range). A high CCC indicates an interconnected ontology; a low score signals many isolated classes with no relationships to other classes.CCC_ext extends the base metric by also counting connections reachable through the subclass hierarchy, capturing indirect connectivity inherited from parent classes.
2. ANOnto — Annotation Richness
Definition: The proportion of classes that carry at least one annotation property — eitherrdfs:label or rdfs:comment. Well-annotated ontologies are easier to understand, reuse, and maintain.
3. PROnto — Properties Richness
Definition: The ratio of object properties to total properties (object + datatype). A higher value indicates a relationally rich ontology; a lower value indicates a more attribute-heavy model. Standard variant:4. LCOMOnto — Lack of Cohesion in Methods
Definition: The mean path length from leaf classes to the top of the hierarchy. Adapted from the software engineering LCOMOnto metric, it captures taxonomy depth — a proxy for how specialised and hierarchically organised the ontology is.LCOMOnto value means leaf classes are buried deeper in the hierarchy (more specialised). A value near 1 indicates a flat taxonomy.
5. CBOOnto — Coupling Between Objects
Definition: The average number of ancestor classes per class. Heavily adapted from the object-oriented CBO metric, it measures how much a class inherits from (or is otherwise coupled to) other classes in the ontology. Base variant (subclass coupling only):LLM-Assisted Quality Evaluation with cceval.py
Beyond structural metrics, the session introduces cceval.py, which uses an LLM to evaluate an ontology against a set of competency questions (CQs) — the stated requirements the ontology was designed to satisfy. The evaluator scores each CQ from 0 to 1 and generates Cypher seed datasets and queries for empirical verification.
| Score | Meaning |
|---|---|
1.0 | Ontology clearly models the required classes/properties/relationships; a Cypher query can answer the CQ |
0.5 | Partially modelled; answerable only after minor refactoring |
0.0 | Not supported — critical modeling gaps |
Empirical verification
The evaluator also runs the LLM-generated Cypher against a real Neo4j instance to confirm the model-level score holds empirically:The empirical check seeds a fresh Neo4j graph for each competency question using the LLM-generated
cypher_dataset statement, then runs the cypher_query and classifies the outcome as fully_answered, not_answered, dataset_error, or query_error.Metric Summary
| Metric | What it measures | Ideal direction |
|---|---|---|
| CCC | Class connectivity (graph integration) | Higher is better |
| ANOnto | Annotation coverage | 100% ideal |
| PROnto | Relational vs attribute richness | Domain-dependent |
| LCOMOnto | Taxonomy depth (hierarchy specialisation) | Domain-dependent |
| CBOOnto | Coupling to ancestor/related classes | Lower is less coupled |