我有一个用于验证研究变量的 SHACL 模式。
{
"@id": "m:VariableShape",
"@type": "sh:NodeShape",
"targetClass": "pplan:Variable",
"property": [
{
"path": "m:dataType",
"class" : "rdfs:Datatype",
"minCount":"1"
},
{
"path": "m:varName",
"datatype": "xsd:string",
"minCount":"1"
}
]
},
{
"@id" : "m:dataType",
"@type" : "owl:ObjectProperty"
},
{
"@id": "m:varName",
"@type": "owl:DatatypeProperty"
}
我正在尝试针对它验证以下数据:
{
"@id" : "ex:bp_var",
"@type" : "pplan:Variable",
"m:dataType" : "xsd:decimal",
"m:varName" : "blood_pressure"
}
根据架构验证此数据会返回类似于以下内容的违规报告:
a sh:ValidationResult ;
sh:resultSeverity sh:Violation ;
…
sh:value xsd:decimal ;
sh:resultPath <http://.../m#dataType> ;
sh:resultMessage "Value does not have class rdfs:Datatype" ;
我是否应该明确指定'xsd:decimal is of type rdfs:Datatype'才能成功验证我的数据?