Sveino / Inst4CIM-KG

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

missing "multiplier isFixed" in NC #108

Closed VladimirAlexiev closed 11 hours ago

VladimirAlexiev commented 1 month ago

Out of many thousand cims:dataType props, these 9 are not translated to owl:DatatypeProperty:

select * {
    ?x a owl:ObjectProperty; cims:dataType ?qk
}
x qk
1 nc: GeneratingUnit.normalMustRunQ cim: ReactivePower
2 nc: Interruption.energyNotDelivered cim: RealEnergy
3 nc: Interruption.energyNotSupplied cim: RealEnergy
4 nc: InfeedLimitTimePoint.valueA cim: CurrentFlow
5 nc: UnitCostTimePoint.startupCost cim: Money
6 nc: UnitCostTimePoint.warmStartupCost cim: Money
7 cim: GeneratingUnit.startupCost cim: Money
8 nc: FrequencyControlFuntion.targetValue cim: Frequency
9 nc: GeneratingUnit.warmStartupCost cim: Money

I found this when investigating some JSONLD irregularities. It's exactly the same 9 props;

grep -n '       "@id": "cim' */*/*.jsonld
CGMES-NC/jsonld/EquipmentReliability-AP-Voc-RDFS2020.jsonld:5457:        "@id": "cim:ReactivePower"
CGMES-NC/jsonld/GridDisturbance-AP-Voc-RDFS2020.jsonld:818:        "@id": "cim:RealEnergy"
CGMES-NC/jsonld/GridDisturbance-AP-Voc-RDFS2020.jsonld:838:        "@id": "cim:RealEnergy"
CGMES-NC/jsonld/StateInstructionSchedule-AP-Voc-RDFS2020.jsonld:2100:        "@id": "cim:CurrentFlow"
CGMES-NC/jsonld/StateInstructionSchedule-AP-Voc-RDFS2020.jsonld:3046:        "@id": "cim:Money"
CGMES-NC/jsonld/StateInstructionSchedule-AP-Voc-RDFS2020.jsonld:3066:        "@id": "cim:Money"
CGMES-NC/jsonld/SteadyStateInstruction-AP-Voc-RDFS2020.jsonld:1145:        "@id": "cim:Money"
CGMES-NC/jsonld/SteadyStateInstruction-AP-Voc-RDFS2020.jsonld:1198:        "@id": "cim:Frequency"
CGMES-NC/jsonld/SteadyStateInstruction-AP-Voc-RDFS2020.jsonld:1218:        "@id": "cim:Money"

The prop definition seems ok:

  <rdf:Description rdf:about="https://cim4.eu/ns/nc#GeneratingUnit.normalMustRunQ">
    <rdfs:comment>Normal minimum reactive power injection that is needed to meet must-run requirement. This value can be higher or equal to minimum operational limit. Load sign convention is used, i.e. positive sign means flow out from a node.</rdfs:comment>
    <cims:dataType rdf:resource="#ReactivePower"/>
    <rdfs:domain rdf:resource="#GeneratingUnit"/>
    <rdfs:label xml:lang="en">normalMustRunQ</rdfs:label>
    <cims:multiplicity rdf:resource="http://iec.ch/TC57/1999/rdf-schema-extensions-19990926#M:0..1"/>
    <cims:stereotype rdf:resource="http://iec.ch/TC57/NonStandard/UML#attribute"/>
    <cims:stereotype>NC</cims:stereotype>
    <rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"/>
  </rdf:Description>

Let's see the QK definition:

  <rdf:Description rdf:about="#ReactivePower">
    <cims:belongsToCategory rdf:resource="https://ap-voc.cim4.eu/EquipmentReliability#Package_EquipmentReliabilityProfile"/>
    <rdfs:comment>Product of RMS value of the voltage and the RMS value of the quadrature component of the current.</rdfs:comment>
    <rdfs:label xml:lang="en">ReactivePower</rdfs:label>
    <cims:stereotype>CIMDatatype</cims:stereotype>
    <rdf:type rdf:resource="http://www.w3.org/2000/01/rdf-schema#Class"/>
  </rdf:Description>
  <rdf:Description rdf:about="#ReactivePower.multiplier">
    <rdfs:domain rdf:resource="#ReactivePower"/>
    <rdfs:label xml:lang="en">multiplier</rdfs:label>
    <cims:multiplicity rdf:resource="http://iec.ch/TC57/1999/rdf-schema-extensions-19990926#M:0..1"/>
    <rdfs:range rdf:resource="#UnitMultiplier"/>
    <cims:stereotype rdf:resource="http://iec.ch/TC57/NonStandard/UML#attribute"/>
    <rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"/>
  </rdf:Description>
  <rdf:Description rdf:about="#ReactivePower.unit">
    <rdfs:domain rdf:resource="#ReactivePower"/>
    <cims:isFixed>VAr</cims:isFixed>
    <rdfs:label xml:lang="en">unit</rdfs:label>
    <cims:multiplicity rdf:resource="http://iec.ch/TC57/1999/rdf-schema-extensions-19990926#M:0..1"/>
    <rdfs:range rdf:resource="#UnitSymbol"/>
    <cims:stereotype rdf:resource="http://iec.ch/TC57/NonStandard/UML#attribute"/>
    <rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"/>
  </rdf:Description>
  <rdf:Description rdf:about="#ReactivePower.value">
    <cims:dataType rdf:resource="#Float"/>
    <rdfs:domain rdf:resource="#ReactivePower"/>
    <rdfs:label xml:lang="en">value</rdfs:label>
    <cims:multiplicity rdf:resource="http://iec.ch/TC57/1999/rdf-schema-extensions-19990926#M:0..1"/>
    <cims:stereotype rdf:resource="http://iec.ch/TC57/NonStandard/UML#attribute"/>
    <rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"/>
  </rdf:Description>

Diffing against another package (61970-600-2_SteadyStateHypothesis-AP-Voc-RDFS2020_v3-0-0), we see this is missing in ReactivePower.multiplier:

    <cims:isFixed>M</cims:isFixed>
VladimirAlexiev commented 1 month ago

It's the same for Money.multiplier: in CGMES/2020/Equipment it has:

    <cims:isFixed rdf:datatype="http://www.w3.org/2001/XMLSchema#string">none</cims:isFixed>

but this is lacking in CGMES-NC/SteadyStateInstruction.

admin-cimug commented 1 month ago

@VladimirAlexiev / @Sveino : I am catching up on emails here. This one caught my attention as I happen to be taking a closer look specifically at the CIMDatatype(s) as part of the current development I am doing in CIMTool. As I looked closer at what we did in defining the defaults for the multipliers and units for some of our core profiles it also led me to revisit what we have defined as base within the UML. As I reviewed this yesterday I questioned things and it seems to me that we should have defined "none" as constant/default for a number of these attributes for the CIMDatatypes. In any event, maybe this is a related discussion, or perhaps completely separate. I did want to throw it out there though. There may be some history here that I need to catch up on. Doing the implementation just surfaced these questions for me.

Todd

admin-cimug commented 1 month ago

Ignore my prior comment. On a second pass I realized I'd missed the obvious and upon closer inspection this is not an issue. I chalk this one up to working too late an hour.

Todd

VladimirAlexiev commented 1 month ago

Why is this not an issue?

Sveino commented 3 weeks ago

It is an issue if unit and multiplier does not include cims:isFixed in the profile. The unit should also be fixed in the vocabulary. We should also be consistent in the type declaration. I assume that

It's the same for Money.multiplier: in CGMES/2020/Equipment it has:

none but this is lacking in CGMES-NC/SteadyStateInstruction.

Is an exception that needs to be fixed. All the listed attributes that is not defined as cims:dataType but not translated toowl:DatatypeProperty, because it is missing the cims:isFixed. We can add a script that fixes this and we need to fix the profile definitions and make sure the export is correct.

griddigit-ci commented 3 weeks ago

Indeed this is another UML issue that will need to be fixed there. For all properties where we do not have multiplier it should be set to none

Svein we need to discuss

Sveino commented 3 weeks ago

We cannot really have difference between NC and CGMES 3.0. I do not think that the group has thought it through the consequence of going for no multiplier.

VladimirAlexiev commented 2 weeks ago

Agreed: if in one set of profiles you use kV but in another you use just V, this will lead to confusion.

VladimirAlexiev commented 1 week ago

I spent an hour debugging because I saw cim:GeneratingUnit.startupCost a owl:DtatypeProperty, owl:ObjectProperty. The reason is that it's defined properly in Equipment but improperly in SteadyStateInstruction.

griddigit-ci commented 11 hours ago

This is now fixed in the UML v68.