repro
- create a class "Offering"
{
"@id": "Offering",
"@type": [
"rdfs:Class",
"shacl:NodeShape"
],
"shacl:property": [
{
"shacl:maxCount": 1,
"shacl:minCount": 1,
"shacl:dataType": {
"@id": "xsd:string"
},
"shacl:path": {
"@id": "name"
}
}
]
}
- create a child class "ServiceOffering" that is rdfs:subClassOf Offering
{
"@id": "ServiceOffering",
"@type": [
"rdfs:Class",
"shacl:NodeShape"
],
"rdfs:subClassOf": {
"@id": "Offering"
},
"shacl:property": [
{
"shacl:maxCount": 1,
"shacl:minCount": 1,
"shacl:dataType": {
"@id": "xsd:integer"
},
"shacl:path": {
"@id": "price"
}
}
]
}
- create a "Charge" class
{
"@id": "Charge",
"@type": [
"rdfs:Class",
"shacl:NodeShape"
],
"shacl:targetClass": {
"@id": "Charge"
},
"shacl:property": [
{
"shacl:class": {
"@id": "Offering"
},
"shacl:maxCount": 1,
"shacl:minCount": 1,
"shacl:path": {
"@id": "for"
}
}
]
}
- Create a ServiceOffering
- Create a Charge referencing the ServiceOffering
expected
it works with no errors
actual
{"error":"db/shacl-validation","cause":"SHACL PropertyShape exception - sh:class: class(es) #{211106232533039} must be same set as #{211106232533465}."}
Of note: if you change the shacl constraint in Charge Class from
"shacl:class": {
"@id": "Offering"
},
to
"shacl:class": {
"@id": "ServiceOffering"
},
the error goes away so it seems It's not observing inheritance.
repro
{ "@id": "Offering", "@type": [ "rdfs:Class", "shacl:NodeShape" ], "shacl:property": [ { "shacl:maxCount": 1, "shacl:minCount": 1, "shacl:dataType": { "@id": "xsd:string" }, "shacl:path": { "@id": "name" } } ] }{ "@id": "ServiceOffering", "@type": [ "rdfs:Class", "shacl:NodeShape" ], "rdfs:subClassOf": { "@id": "Offering" }, "shacl:property": [ { "shacl:maxCount": 1, "shacl:minCount": 1, "shacl:dataType": { "@id": "xsd:integer" }, "shacl:path": { "@id": "price" } } ] }{ "@id": "Charge", "@type": [ "rdfs:Class", "shacl:NodeShape" ], "shacl:targetClass": { "@id": "Charge" }, "shacl:property": [ { "shacl:class": { "@id": "Offering" }, "shacl:maxCount": 1, "shacl:minCount": 1, "shacl:path": { "@id": "for" } } ] }expected
it works with no errors
actual
{"error":"db/shacl-validation","cause":"SHACL PropertyShape exception - sh:class: class(es) #{211106232533039} must be same set as #{211106232533465}."}Of note: if you change the shacl constraint in
ChargeClass fromto
the error goes away so it seems It's not observing inheritance.