The Shapes Constraint Language (SHACL) is the W3C Recommendation for validating a single RDF graph. This makes SHACL inadequate for validating data across (named) graphs in an RDF dataset. Existing workarounds, such as graph unions or bespoke preprocessing, either collapse the RDF dataset structure or compromise the declarative nature of SHACL validation. In the former, we lose track of where triples come from; in the latter, knowledge is hidden in the code, and the constraints are not self-contained nor fully declarative. We present SHACL-DS to address this problem. SHACL-DS proposes a vocabulary and an algorithm on top of SHACL for RDF dataset validation. SHACL-DS introduces the concepts of Shapes Datasets, Target Graph Declarations, and Target Graph Combinations, enabling declarative constraints to operate across multiple graphs in an RDF dataset. SHACL-DS also defines the behaviour of SPARQL-based constraints for validating RDF datasets. In this paper, we formalize SHACL-DS and provide a prototype implementation.
翻译:形状约束语言(SHACL)是W3C推荐的用于验证单个RDF图的标准。这使得SHACL不足以验证RDF数据集中跨(命名)图的数据。现有的变通方法,如图并集或定制预处理,要么破坏了RDF数据集的结构,要么损害了SHACL验证的声明性本质。在前一种方法中,我们无法追踪三元组的来源;在后一种方法中,知识隐藏在代码中,约束既不是自包含的,也不是完全声明式的。我们提出了SHACL-DS来解决这个问题。SHACL-DS在SHACL之上提出了一套词汇表和算法,用于RDF数据集验证。SHACL-DS引入了形状数据集、目标图声明和目标图组合的概念,使得声明式约束能够在RDF数据集的多个图上操作。SHACL-DS还定义了基于SPARQL的约束在验证RDF数据集时的行为。在本文中,我们形式化了SHACL-DS并提供了一个原型实现。