Shape Expressions with Inheritance
Iovka Boneva, Jose Emilio Labra Gayo, Eric Prud'hommeaux, Katherine Thornton, Andra Waagmeester
TL;DR
This work addresses the need for reusable, modular schemas in Shape Expressions (ShEx) by introducing Shape Expressions with Inheritance, enabling child shapes to extend and restrict parent shapes, including multiple inheritance and abstract shapes. It provides a formal syntax and semantics that extend ShEx 2.1, introducing a new satisfaction relation for extended shapes, an extension hierarchy, well-defined schemas, and a maximal correct typing that supports a stable validation algorithm. The authors prove termination properties, show how to compute the maximal typing via stratified refinement, and show that validation remains NP-complete, maintaining the same algorithmic complexity as ShEx 2.1. These results enhance reusability and modularity for large RDF ecosystems and align with ongoing standardization efforts, with companion implementations and demonstrations available.
Abstract
We formally introduce an inheritance mechanism for the Shape Expressions language (ShEx). It is inspired by inheritance in object-oriented programming languages, and provides similar advantages such as reuse, modularity, and more flexible data modelling. Using an example, we explain the main features of the inheritance mechanism. We present its syntax and formal semantics. The semantics is an extension of the semantics of ShEx 2.1. It also directly yields a validation algorithm as an extension of the previous ShEx validation algorithms, while maintaining the same algorithmic complexity.
