Expressiveness of SHACL Features and Extensions for Full Equality and Disjointness Tests
Bart Bogaerts, Maxime Jakubowski, Jan Van den Bussche
TL;DR
This work analyzes the expressive power of SHACL features for RDF graph constraints, focusing on equality ($eq$), disjointness ($disj$), and closure ($closed$) constraints and their interaction with target-based shape schemas. The authors show each feature is primitive by constructing targeted boolean queries that require the feature, and they prove that removing any feature reduces expressiveness unless left-hand sides are restricted to targets and closure is absent. They also demonstrate that enabling full versions of equality and disjointness further increases expressive power, and extend the results to stratified recursion. The findings clarify when SHACL’s target-based restrictions are essential and how extensions could broaden SHACL’s descriptive capabilities, with implications for schema design and reasoning in RDF data management.
Abstract
SHACL is a W3C-proposed schema language for expressing structural constraints on RDF graphs. Recent work on formalizing this language has revealed a striking relationship to description logics. SHACL expressions can use three fundamental features that are not so common in description logics. These features are equality tests; disjointness tests; and closure constraints. Moreover, SHACL is peculiar in allowing only a restricted form of expressions (so-called targets) on the left-hand side of inclusion constraints. The goal of this paper is to obtain a clear picture of the impact and expressiveness of these features and restrictions. We show that each of the four features is primitive: using the feature, one can express boolean queries that are not expressible without using the feature. We also show that the restriction that SHACL imposes on allowed targets is inessential, as long as closure constraints are not used. In addition, we show that enriching SHACL with "full" versions of equality tests, or disjointness tests, results in a strictly more powerful language.
