简体   繁体   English

用于验证数据文件的类型不匹配的 Shacl 规则

[英]Shacl rule to validate data file for mismatched type

I have a set of Shacl rules to validate the incoming data files.我有一组 Shacl 规则来验证传入的数据文件。 The issue is when the type of a record in the data file mismatches with the Shacl targetClass, no validation will be done and the Shacl validation engine just reports Success.问题是当数据文件中的记录类型与 Shacl 目标类不匹配时,不会进行验证,并且 Shacl 验证引擎只会报告成功。 I got a solution from this website, but it does not work for me.我从这个网站得到了一个解决方案,但它对我不起作用。 I have posted my Shacl rules and simple data here:我在这里发布了我的 Shacl 规则和简单数据:

https://s.zazuko.com/b887FZ https://s.zazuko.com/b887FZ

The data type "DataInventoryRecord" (data row 20 from the right panel) is correct;数据类型“DataInventoryRecord”(右侧面板中的第 20 行数据)正确; when I change the target type, for example changing it to "dataInventoryRecord2", I expect an error, but no error is reported.当我更改目标类型时,例如将其更改为“dataInventoryRecord2”,我预计会出现错误,但不会报告错误。

I got the idea of recordCountShape from the following post which was answered by Holger Knublauch:我从 Holger Knublauch 回答的以下帖子中得到了 recordCountShape 的想法:

How to check for a number of class instances with SHACL 如何使用 SHACL 检查多个 class 实例

Any help will be greatly appreciated任何帮助将不胜感激

The shape definitions look fine to me and also seem to work on the (old) SHACL Playground https://shacl.org/playground/形状定义对我来说看起来不错,而且似乎也适用于(旧)SHACL Playground https://shacl.org/playground/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM