sheval: An RDF data shapes evaluation tool and test-suite for recursive shapes

Shqiponja Ahmetaj, Iovka Boneva, Jan Hidders, Maxime Jakubowski, Jose-Emilio Labra-Gayo, Wim Martens, Filip Murlak, Cem Okulmus, Ognjen Savković, Mantas Šimkus, Dominik TomaszukarXiv 2026 · arXiv

TL;DR

The paper introduces sheval, an open-source evaluation framework and test suite designed to assess how different RDF data shape validation engines handle recursive definitions. The tool reveals that while ShEx engines consistently implement Greatest Fixed Point (GFP) semantics, SHACL engines exhibit wildly divergent behaviors—ranging from crashes and timeouts to contradictory validation reports—due to ambiguities in the official SHACL specification.

What Problem Does This Paper Address?

In the world of the Semantic Web, Resource Description Framework (RDF) graphs are used to represent complex, interconnected data. To ensure this data is clean and consistent, developers use shape-based validation languages like ShEx (Shape Expressions) and SHACL (Shapes Constraint Language).

A major challenge arises with recursive shapes—definitions where a shape refers to itself, either directly or indirectly (e.g., a User shape requires a connection to a Person shape, which in turn requires a connection to a User shape).

Figure 1: Example RDF graph representing a simple social network

While the ShEx specification explicitly defines how to handle recursion, the W3C SHACL 1.0 recommendation leaves the semantics of recursive shapes undefined. As a result, different SHACL validation engines have implemented their own ad-hoc strategies, leading to a total lack of interoperability and unpredictable validation results for developers.

Methods

The authors developed sheval, a command-line framework designed to run a standardized test suite across multiple ShEx and SHACL validation engines.

Figure 3: Main modules of sheval: the YAML manifest drives the orchestrator, which prepares engine- specific inputs; runners invoke external validation engines whose output is parsed, classified and checked against the expected results and exported.

The core design principle of sheval is the isolation of engine-specific quirks behind a uniform Runner interface. The framework operates as follows:

  1. Orchestration: It reads a YAML manifest defining the test cases (data graphs, schemas, and expected results).
  2. Input Preparation: It automatically translates abstract shape definitions into concrete ShEx schemas (ShapeMaps) or SHACL shapes graphs.
  3. Execution: It runs the validation engines inside Docker containers to ensure reproducibility, capturing standard output, errors, and exit codes.
  4. Analysis & Matching: It parses the varied outputs into a unified format (conforms, successes, failures, message) and matches them against formal logical semantics, such as Least Fixed Point (LFP), Greatest Fixed Point (GFP), and Supported Model Semantics (SMS).

Datasets

Instead of a traditional training dataset, the authors introduced a specialized recursive shapes test suite consisting of several micro-benchmarks:

  • Basic Separation Tests: Minimal examples designed to clearly distinguish whether an engine uses LFP semantics (where a node doesn't conform unless proven otherwise) or GFP semantics (where a node conforms unless a constraint is violated).
  • Reachability Separation Tests: Scenarios checking graph reachability and safety properties.
  • Feature Tests: Edge cases testing non-stratified negation (combining recursion and negation in ways that cause logical paradoxes), consistency checking, and "fresh nodes" (nodes evaluated outside the actual data graph).
  • Duality Tests: Validating the logical duality propositions between LFP and GFP.
  • Non-recursive Control Tests: Baselines to ensure engines behave identically on standard, non-recursive data.

Key Insights and Ideas

  • ShEx is Unified, SHACL is Divided: ShEx validators (like rudof, Jena ShEx, and ShEx-S) are highly consistent because they strictly follow the official specification's GFP semantics. SHACL engines, however, are a "wild west" of conflicting implementations.
  • The Spectrum of SHACL Behaviors: When faced with recursion, SHACL engines don't just disagree on the boolean true/false verdict; they fail in entirely different ways. Some engines enter infinite loops, some crash with stack overflows, and others attempt to flag the cycle and proceed anyway.
  • Abstracting the Quirks: The paper demonstrates that a clean, runner-based architecture can successfully benchmark software even when the target applications have completely different input formats, output structures, and error-signaling behaviors.

Key Results

The framework evaluated several prominent engines, including pySHACL, SHACL-S, Apache Jena, SHACL-TQ, rudof, and ShEx-S.

  • ShEx Engines: 100% consistent with GFP semantics across all basic and reachability tests.
  • Apache Jena (SHACL): Tended to follow GFP semantics, successfully detecting cycles and continuing validation to return conforms=true in most recursive test cases.
  • pySHACL: Detected cycles but frequently crashed (C!) or returned validation errors on complex recursive structures.
  • SHACL-S: Suffered from timeout errors (T) on basic recursive examples, indicating an inability to resolve certain loops.
  • SHACL-TQ: Followed a unique, non-standard semantics that did not align with LFP, GFP, or Supported Model Semantics, highlighting a critical need for a formal study of its underlying algorithm.

Limitations and Future Work

The current iteration of sheval relies on a simplified, abstract shape language subset to map behaviors across ShEx and SHACL. It does not yet cover the full expressiveness of either language specification.

Future work aims to integrate additional ShEx and SHACL implementations into the runner framework. The authors also plan to expand the test suites to evaluate other critical dimensions of data shape validation, including performance benchmarking, interoperability, explainability, and overall usability.

Summary updated

Abstract

Two different languages have been developed to validate RDF data based on the concept of a shape: ShEx and SHACL. In each language it is possible to define a shape that refers to itself, which is called a recursive shape. While in the case of ShEx, the semantics of recursive shapes is well defined and is part of the specification, in the case of SHACL, the semantics of recursive shapes is left to the implementation of the different SHACL engines. Consequently, the different SHACL engines show different behaviours when confronted with recursive shapes. In this paper we present sheval: an evaluation framework consisting of a tool and a test suite that can be used to compare the behaviour of different shapes technologies when confronted with recursive definitions. The tool has been used to evaluate and understand the differences in the implementation of recursive shapes in ShEx and SHACL. It provides a framework for testing and comparing the behaviour of different shape engines, helping to identify inconsistencies and potential issues, and providing a basis for further research and development in the field of shape-based validation of RDF data.
BibTeX
@misc{ahmetaj2026sheval,
  author = {Shqiponja Ahmetaj and Iovka Boneva and Jan Hidders and Maxime Jakubowski and Jose-Emilio Labra-Gayo and Wim Martens and Filip Murlak and Cem Okulmus and Ognjen Savković and Mantas Šimkus and Dominik Tomaszuk},
  title = {{sheval: An RDF data shapes evaluation tool and test-suite for recursive shapes}},
  year = {2026},
  eprint = {2609.05944},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2609.05944},
}
Figure