Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Principle:AKSW RDFUnit Validation Result Serialization

From Leeroopedia
Knowledge Sources
Domains Semantic_Web, Data_Quality, Serialization
Last Updated 2026-10-16 00:00 GMT

Overview

Technique for serializing RDF validation results into multiple output formats (HTML, Turtle, RDF/XML, JSON-LD, JUnit XML) from a single in-memory result model, enabling both human-readable reports and machine-consumable outputs.

Description

Validation Result Serialization handles the final stage of the RDFUnit validation pipeline: converting the in-memory `TestExecution` object—containing all test case results, dataset overview statistics, and provenance metadata—into persistent output files. RDFUnit supports multiple serialization formats, each serving different consumers:

  • HTML: Human-readable reports with color-coded pass/fail indicators, violation tables, and summary statistics. The HTML writer varies by execution type (status, aggregate, SHACL Lite, SHACL).
  • RDF formats (Turtle, N3, N-Triples, JSON-LD, RDF/XML, etc.): Machine-consumable RDF serializations of the validation report, using PROV and RDFUnit vocabularies for provenance and SHACL vocabulary for validation results.
  • JUnit XML: XML format compatible with CI/CD systems for integrating validation results into build pipelines.

The serialization uses a writer factory that selects the appropriate writer based on the requested format. The core `TestExecutionWriter` converts the `TestExecution` into a Jena `Model` using RDFUnit, SHACL, and PROV vocabularies, which is then serialized by format-specific writers.

Usage

Use this principle when you need to produce validation reports for different audiences. Use HTML for human review, RDF formats for machine processing, and JUnit XML for CI/CD integration. Multiple formats can be produced in a single validation run.

Theoretical Basis

The serialization pipeline:

# Abstract algorithm
model = create_empty_jena_model()
TestExecutionWriter.create(test_execution).write(model)
# model now contains:
#   - PROV.Activity for the execution
#   - RDFUNITv.TestExecution metadata
#   - SHACL.ValidationReport with conforms flag
#   - SHACL.result entries for each violation
#   - DatasetOverviewResults statistics (total, passed, failed, errors)

for format in requested_formats:
    writer = WriterFactory.create(filename, format, test_execution)
    writer.write(model)  # serializes to file

The validation report model structure:

[] a prov:Activity, rutt:TestExecution, sh:ValidationReport ;
   rutt:executionType "shaclTestCaseResult" ;
   prov:startedAtTime "2026-01-01T10:00:00" ;
   prov:endedAtTime "2026-01-01T10:05:00" ;
   rutt:testsRun 150 ;
   rutt:testsFailed 3 ;
   rutt:totalIndividualErrors 12 ;
   sh:conforms false ;
   sh:result [ a sh:ValidationResult ; ... ] .

Related Pages

Implemented By

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment