I have a SHACL schema that is written to validate research variables.
{
"@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"
}
And I am trying to validate the following data against it:
{
"@id" : "ex:bp_var",
"@type" : "pplan:Variable",
"m:dataType" : "xsd:decimal",
"m:varName" : "blood_pressure"
}
The validation of this data against the schema returns a violation report similar to:
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" ;
Should I be specifying explicitly 'xsd:decimal is of type rdfs:Datatype' to be able to successfully validate my data?