Sveino / Inst4CIM-KG

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

proposal to change representation of attributes and units #29

Closed VladimirAlexiev closed 1 month ago

VladimirAlexiev commented 4 months ago

Currently datatypes are defined like this:

cim:ActivePower  rdf:type       rdfs:Class ;
        rdfs:comment            "Product of RMS value of the voltage and the RMS value of the in-phase component of the current." ;
        rdfs:label              "ActivePower"@en ;
        cims:belongsToCategory  er:Package_EquipmentReliabilityProfile ;
        cims:stereotype         "CIMDatatype" .

cim:ActivePower.multiplier
        rdf:type           rdf:Property ;
        rdfs:domain        cim:ActivePower ;
        rdfs:label         "multiplier"@en ;
        rdfs:range         cim:UnitMultiplier ;
        cims:isFixed       "M" ;
        cims:multiplicity  cims:M:0..1 ;
        cims:stereotype    <http://iec.ch/TC57/NonStandard/UML#attribute> .

cim:ActivePower.unit  rdf:type  rdf:Property ;
        rdfs:domain        cim:ActivePower ;
        rdfs:label         "unit"@en ;
        rdfs:range         cim:UnitSymbol ;
        cims:isFixed       "W" ;
        cims:multiplicity  cims:M:0..1 ;
        cims:stereotype    <http://iec.ch/TC57/NonStandard/UML#attribute> .

cim:ActivePower.value
        rdf:type           rdf:Property ;
        rdfs:domain        cim:ActivePower ;
        rdfs:label         "value"@en ;
        cims:dataType      cim:Float ;
        cims:multiplicity  cims:M:0..1 ;
        cims:stereotype    <http://iec.ch/TC57/NonStandard/UML#attribute> .

And then attributes (data props) are defined like this:

cim:GeneratingUnit.maxEconomicP
        rdf:type           rdf:Property ;
        rdfs:domain        cim:GeneratingUnit ;
        cims:dataType      cim:ActivePower ;
        cims:stereotype    <http://iec.ch/TC57/NonStandard/UML#attribute> .

There are several problems:

Proposals:

VladimirAlexiev commented 4 months ago

EquipmentReliability-AP-Voc-RDFS2020.ttl has a list of units, eg:

cim:UnitSymbol.W  rdf:type  cim:UnitSymbol ;
        rdfs:comment     "Real power in watts (J/s). Electrical power may have real and reactive components. The real portion of electrical power (I&#178;R or VIcos(phi)), is expressed in Watts. See also apparent power and reactive power." ;
        rdfs:label       "W"@en ;

cim:UnitMultiplier.M  rdf:type  cim:UnitMultiplier ;
        rdfs:comment     "Mega 10**6." ;
        rdfs:label       "M"@en ;
        cims:stereotype  "enum" .

and then a shape in EquipmentReliability-AP-Con-Simple-SHACL.ttl asks a certain property to use these enumerated instances:

er:Curve.y1Unit-datatype
        rdf:type        sh:PropertyShape;
        sh:path         cim:Curve.y1Unit;
        sh:in           ( cim:UnitSymbol.A cim:UnitSymbol.none cim:UnitSymbol.VPerVAr cim:UnitSymbol.WPerm2 cim:UnitSymbol.s cim:UnitSymbol.Pa cim:UnitSymbol.WPers cim:UnitSymbol.deg cim:UnitSymbol.degC cim:UnitSymbol.VAr cim:UnitSymbol.Hz cim:UnitSymbol.V cim:UnitSymbol.W cim:UnitSymbol.ohm );

So instead of "M" and "W" above, everywhere we should use cim:UnitMultiplier.M and cim:UnitSymbol.W respectively. That includes cim:ActivePower.multiplier, cim:ActivePower.unit! These enumerated instances still carry less descriptive info than QUDT unit:* but we can stick with them.

VladimirAlexiev commented 3 months ago

This is very similar to https://github.com/3lbits/CIM4NoUtility/issues/338 but addresses some other aspects.

VladimirAlexiev commented 2 months ago

https://github.com/Sveino/Inst4CIM-KG/issues/38 describe this in more detail, and rdfs-improvement/README in even more detail:

The last sec has mapping tables to QUDT.

So let's NOT discuss here, let's discuss there. But this issue has a task list, so I'll close it only after everything is done.