Sveino / Inst4CIM-KG

Instance of CIM Knowledge Graph
Apache License 2.0
3 stars 1 forks source link

SHACL mixup between a node and its type #15

Open VladimirAlexiev opened 3 months ago

VladimirAlexiev commented 3 months ago

(Similar to https://github.com/Sveino/Inst4CIM-KG/issues/19)

Header-AP-Con-SHACL.ttl:

dh:DifferenceModel.preconditions-datatype
        rdf:type        sh:PropertyShape;
        sh:description  "This constraint validates the datatype of the property (attribute).";
        sh:group        dh:DatatypesGroup;
        sh:in           ( md:Statement );
        sh:message      "Blank node (compound datatype) violation. Either it is not a blank node (nested structure, compound datatype) or it is not the right class.";
        sh:name         "DifferenceModel.preconditions-datatype";
        sh:nodeKind     sh:BlankNode;
        sh:order        2;
        sh:path         ( dm:DifferenceModel.preconditions rdf:type );
        sh:severity     sh:Violation .

The mistake is that sh:path leads to the type (presumably md:Statement), which is certainly not a sh:BlankNode. So this constraint cannot be satisfied. The right way to write it is like this:

dh:DifferenceModel.preconditions-datatype
        rdf:type        sh:PropertyShape;
        sh:description  "This constraint validates the datatype of the property (attribute).";
        sh:group        dh:DatatypesGroup;
        sh:class        md:Statement ;
        sh:message      "Blank node (compound datatype) violation. Either it is not a blank node (nested structure, compound datatype) or it is not the right class.";
        sh:name         "DifferenceModel.preconditions-datatype";
        sh:nodeKind     sh:BlankNode;
        sh:order        2;
        sh:path         dm:DifferenceModel.preconditions;
        sh:severity     sh:Violation .
griddigit-ci commented 1 month ago

We need to see what we can do here as we are trying the get away from it

Sveino commented 1 month ago

Yes, We would like to have a JSON-LD way of exchanging difference model (forwardModel and reverseModel). If we also find a way that Turtle and RDF/XML also will support it would be great.

VladimirAlexiev commented 1 month ago

Made new issue #53. Let's discuss in this one just this SHACL shape.