0

数据文件位于此网址:https ://schema.repronim.org/rl/activities/PHQ-9/items/phq9_8

我已经为上述数据文件编写了一个 shacl 形状。但是,当我尝试验证时出现错误。在上面的数据文件中,keyresponseOptions指向了一个外部的jsonld文件——就是发生错误的时候。如果我将外部文件嵌入数据文件本身,则没有错误。我用这个形状responseOptions

 sh:property [
        sh:path reproterms:valueconstraints ;
        sh:or ( [ sh:nodeKind sh:IRI ] [ sh:node reproterms:ResponseOptionsShape ] ) ;
   ] .

抛出的错误是:

Traceback (most recent call last):
  File "validation/test.py", line 146, in <module>
    serialize_report_graph=True)
  File "/Users/sanuann/envs/trial/lib/python3.7/site-packages/pyshacl/validate.py", line 259, in validate
    do_owl_imports=False)  # no imports on data_graph
  File "~/envs/trial/lib/python3.7/site-packages/pyshacl/rdfutil/load.py", line 110, in load_from_source
    first_char = source[0]
IndexError: string index out of range

上面的形状对吗?我究竟做错了什么?

4

1 回答 1

1

您的数据类型约束sh:datatype sh:IRI已关闭。三元组的对象sh:datatype必须是 rdf 数据类型,例如xsd:string. 我想你想检查一下sh:nodeKind sh:IRI

于 2020-05-30T11:43:09.437 回答