Skip to content

debug and rationalize 61970-600-1_Prof10-Header-AP-Con-Complex-SHACL.ttl #116

Description

@VladimirAlexiev

https://github.com/Sveino/Inst4CIM-KG/tree/develop/shacl-improved#generalize-shapes

CGMES_Constraints_Repository.xlsx describes PROF10 (aka C:600:ALL:NA:PROF10) thus:

CGMES instance file (distribution) dependency shall be declared by md:Model.DependentOn in the header according to Figure 1 and the associated rules.

It's implemented in application-profiles-library\CGMES\CurrentRelease\SHACL\61970-600-1_Prof10-Header-AP-Con-Complex-SHACL.ttl,
which is 700 lines, half are commented out, and the rest do the same thing:

  • select by md:Model.profile (SPARQLTarget)
  • check some cardinality restriction on md:Model.DependentOn
  • check that md:Model.DependentOn/md:Model.profile has certain values

It is full of useless pairs of sh:SPARQLTarget like this.
The dependencies of a model don't vary with its form (Full vs Difference), so you should target by md:Model.profile but not rdf:type
(The last question below is an exception, and I think it's incorrect)

prof10:FullModel-EQ a  sh:NodeShape ;
        sh:property     prof10:PROF10-EQ;
        sh:target  
        [
              a sh:SPARQLTarget ;
              sh:prefixes cim: ;
              sh:select """
                SELECT DISTINCT ?this
                WHERE {
                  ?this rdf:type md:FullModel   .
                  ?this md:Model.profile "http://iec.ch/TC57/ns/CIM/CoreEquipment-EU/3.0"^^xsd:anyURI.
                }
                """ ;
        ] . 
prof10:DiffModel-EQ a  sh:NodeShape ;
        sh:property     prof10:PROF10-EQ;
        sh:target  
        [
              a sh:SPARQLTarget ;
              sh:prefixes cim: ;
              sh:select """
                SELECT DISTINCT ?this
                WHERE {
                  ?this rdf:type dm:DifferenceModel   .
                  ?this md:Model.profile "http://iec.ch/TC57/ns/CIM/CoreEquipment-EU/3.0"^^xsd:anyURI.
                }
                """ ;
        ] . 

Questions to @Sveino @griddigit-ci @HarisVranaj (edit this comment and check the boxes here):

  • To avoid any mistakes: where is this Figure 1 ?
  • Are all these similar shapes defined so that this can be done as explained in the excel:

    The validation scope is difficult to define. Different implementations may need to deactivate some SHACL shapes."

Is it true that:

  • TP can have any number of dependencies (doesn't restrict maxCount), as soon as one is SSH?
  • SC can depend on only one of EQ, EQBD, OP?
  • OP can depend on only one of EQ, EQBD, SC?
    • SC can depend on OP, and OP can depend on SC ???
  • GL can depend on maximum two of these four: EQ, EQBD, SC, OP
  • DiffModel-SC can depend on SC???
    I think that's false: DiffModel-SC is based on SC but doesn't depend on another SC

This is better rewritten to ONE SPARQL with a VALUES table as hinted at https://github.com/Sveino/Inst4CIM-KG/tree/develop/shacl-improved#generalize-shapes

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions