pyShacl验证sh:hasValue规则报错但Apache Jena验证通过的问题求助
我最近在做RDF数据的SHACL验证,碰到一个特别费解的问题——同样的三元组和验证规则,用Apache Jena能顺利通过,但用pyShacl却总是报hasValue约束违反,实在摸不着头脑,来请教下各位大佬!
待验证的RDF三元组
@prefix atold: <http://publications.europa.eu/resource/authority/> . # 省略其他无关内容 :property dct:language <http://publications.europa.eu/resource/authority/language/DEU>
所用的SHACL验证规则
sh:LanguageProp a sh:PropertyShape ; sh:path dct:language ; sh:property [ sh:hasValue <http://publications.europa.eu/resource/authority/language> ; sh:nodeKind sh:IRI ; sh:path skos:inScheme ] ; sh:nodeKind sh:IRI ; sh:minCount 1 .
pyShacl返回的报错信息
Constraint Violation in HasValueConstraintComponent (http://www.w3.org/ns/shacl#HasValueConstraintComponent):
Severity: sh:Violation
Source Shape: [ sh:hasValue atold:language ; sh:nodeKind sh:IRI ; sh:path skos:inScheme ]
Focus Node: http://publications.europa.eu/resource/authority/language/DEU
Result Path: skos:inScheme
Message: Node http://publications.europa.eu/resource/authority/language/DEU->skos:inScheme does not contain a value in the set: ['http://publications.europa.eu/resource/authority/language']
确认数据正确性
我已经仔细检查过,<http://publications.europa.eu/resource/authority/language/DEU>的三元组里确实存在这条语句:
<skos:inScheme rdf:resource="http://publications.europa.eu/resource/authority/language"/>
而且所有需要依赖的本体都已经正确加载了,Jena验证完全没问题,只有pyShacl报错。有没有朋友遇到过类似的问题,或者能帮我排查下原因?
备注:内容来源于stack exchange,提问作者unicorn

