Skip to content

feat: add ontology validation script for mobilityDCAT-AP serialisation files #9

@Daham-Mustaf

Description

@Daham-Mustaf

Context

The validation repository currently validates RDF data against SHACL shapes.
A separate validation concern exists: validating the mobilityDCAT-AP ontology
serialisation files themselves (mobilitydcat-ap_v1.1.0.ttl, .rdf, .jsonld)
for internal consistency and correctness.

Problem

The ontology files have accumulated bugs (tracked in mobilityDCAT-AP/mobilityDCAT-AP#179)
that were only discovered through manual audit. There is currently no automated
way to catch these.

Possible validation approaches

1. OWL consistency check
Load the ontology into a reasoner (e.g. HermiT via owlready2, or ELK) and check
for logical inconsistencies — unsatisfiable classes, contradictory axioms etc.

2. SHACL shapes on the ontology itself
Write SHACL shapes that validate the ontology as data — e.g. every
owl:ObjectProperty must have dcam:domainIncludes, every owl:Class must
have rdfs:label and skos:scopeNote, every mobilitydcatap: term must use
https:// namespace etc.

3. RDF syntax validation
Parse all three serialisation files (TTL, RDF/XML, JSON-LD) and verify they
are syntactically valid and produce identical graphs.

4. Namespace consistency check
Script that scans all three files and flags any occurrence of
http://w3id.org/mobilitydcat-ap (wrong) vs https://w3id.org/mobilitydcat-ap.

5. Cross-serialisation consistency check
Load TTL, RDF and JSON-LD into separate graphs and compare — all three should
produce the same triples.

6. Download and validate from main repo
Script that downloads the current ontology files directly from the
mobilityDCAT-AP GitHub repository and runs all checks, enabling CI integration.

Proposed deliverable

A script scripts/validate_ontology.py that:

  • Downloads the three serialisation files from the main repo (or accepts local paths)
  • Runs syntax validation on all three
  • Checks namespace consistency
  • Compares triple counts across serialisations
  • Optionally runs SHACL shapes on the ontology as data

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions