@prefix cim: <https://cim.ucaiug.io/ns#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

cim:AnalogValue a sh:NodeShape ;
    rdfs:comment "AnalogValue represents an analog MeasurementValue." ;
    sh:closed true ;
    sh:ignoredProperties ( rdf:type ) ;
    sh:property [ sh:class cim:Analog ;
            sh:description "Measurement to which this value is connected." ;
            sh:maxCount 1 ;
            sh:minCount 1 ;
            sh:nodeKind sh:IRI ;
            sh:order 1 ;
            sh:path cim:AnalogValue.Analog ],
        [ sh:datatype xsd:string ;
            sh:description """Master resource identifier issued by a model authority. The mRID is unique within an exchange context. Global uniqueness is easily achieved by using a UUID, as specified in RFC 4122, for the mRID. The use of UUID is strongly recommended.\r
For CIMXML data files in RDF syntax conforming to IEC 61970-552, the mRID is mapped to rdf:ID or rdf:about attributes that identify CIM object elements.""" ;
            sh:maxCount 1 ;
            sh:minCount 1 ;
            sh:nodeKind sh:Literal ;
            sh:order 3 ;
            sh:path cim:IdentifiedObject.mRID ],
        [ sh:datatype xsd:dateTime ;
            sh:description "The time when the value was last updated." ;
            sh:maxCount 1 ;
            sh:nodeKind sh:Literal ;
            sh:order 2 ;
            sh:path cim:MeasurementValue.timeStamp ],
        [ sh:datatype xsd:string ;
            sh:description """The name is any free human readable and possibly non unique text naming the object.\r
""" ;
            sh:maxCount 1 ;
            sh:nodeKind sh:Literal ;
            sh:order 4 ;
            sh:path cim:IdentifiedObject.name ],
        [ sh:datatype xsd:float ;
            sh:description "The value to supervise." ;
            sh:maxCount 1 ;
            sh:nodeKind sh:Literal ;
            sh:order 0 ;
            sh:path cim:AnalogValue.value ] ;
    sh:targetClass cim:AnalogValue .

cim:IOPoint a sh:NodeShape ;
    rdfs:comment "The class describe a measurement or control value. The purpose is to enable having attributes and associations common for measurement and control." ;
    sh:closed true ;
    sh:ignoredProperties ( cim:AnalogValue.value cim:Analog cim:MeasurementValue.timeStamp rdf:type ) ;
    sh:property [ sh:datatype xsd:string ;
            sh:description """Master resource identifier issued by a model authority. The mRID is unique within an exchange context. Global uniqueness is easily achieved by using a UUID, as specified in RFC 4122, for the mRID. The use of UUID is strongly recommended.\r
For CIMXML data files in RDF syntax conforming to IEC 61970-552, the mRID is mapped to rdf:ID or rdf:about attributes that identify CIM object elements.""" ;
            sh:maxCount 1 ;
            sh:minCount 1 ;
            sh:nodeKind sh:Literal ;
            sh:order 0 ;
            sh:path cim:IdentifiedObject.mRID ],
        [ sh:datatype xsd:string ;
            sh:description """The name is any free human readable and possibly non unique text naming the object.\r
""" ;
            sh:maxCount 1 ;
            sh:nodeKind sh:Literal ;
            sh:order 1 ;
            sh:path cim:IdentifiedObject.name ] ;
    sh:targetClass cim:IOPoint .

cim:IdentifiedObject a sh:NodeShape ;
    rdfs:comment "This is a root class to provide common identification for all classes needing identification and naming attributes." ;
    sh:closed true ;
    sh:ignoredProperties ( cim:Measurement.Terminal cim:Measurement.PowerSystemResource rdf:type cim:Analog cim:Measurement.unitMultiplier cim:Measurement.unitSymbol cim:MeasurementValue.timeStamp cim:AnalogValue.value cim:Analog.positiveFlowIn ) ;
    sh:property [ sh:datatype xsd:string ;
            sh:description """Master resource identifier issued by a model authority. The mRID is unique within an exchange context. Global uniqueness is easily achieved by using a UUID, as specified in RFC 4122, for the mRID. The use of UUID is strongly recommended.\r
For CIMXML data files in RDF syntax conforming to IEC 61970-552, the mRID is mapped to rdf:ID or rdf:about attributes that identify CIM object elements.""" ;
            sh:maxCount 1 ;
            sh:minCount 1 ;
            sh:nodeKind sh:Literal ;
            sh:order 0 ;
            sh:path cim:IdentifiedObject.mRID ],
        [ sh:datatype xsd:string ;
            sh:description """The name is any free human readable and possibly non unique text naming the object.\r
""" ;
            sh:maxCount 1 ;
            sh:nodeKind sh:Literal ;
            sh:order 1 ;
            sh:path cim:IdentifiedObject.name ] ;
    sh:targetClass cim:IdentifiedObject .

cim:Measurement a sh:NodeShape ;
    rdfs:comment """A Measurement represents any measured, calculated or non-measured
non-calculated quantity. Any piece of equipment may contain Measurements,
e.g. a substation may have temperature measurements and door open
indications, a transformer may have oil temperature and tank pressure
measurements, a bay may contain a number of power flow measurements and a
Breaker may contain a switch status measurement.

The PSR - Measurement association is intended to capture this use of
Measurement and is included in the naming hierarchy based on
EquipmentContainer. The naming hierarchy typically has Measurements as
leaves, e.g. Substation-VoltageLevel-Bay-Switch-Measurement.

Some Measurements represent quantities related to a particular sensor
location in the network, e.g. a voltage transformer (VT) or potential
transformer (PT) at a busbar or a current transformer (CT) at the bar
between a breaker and an isolator.  The sensing position is not captured
in the PSR - Measurement association.  Instead it is captured by the
Measurement - Terminal association that is used to define the sensing
location in the network topology. The location is defined by the
connection of the Terminal to ConductingEquipment.

If both a Terminal and PSR are associated, and the PSR is of type
ConductingEquipment, the associated Terminal should belong to that
ConductingEquipment instance.

When the sensor location is needed both Measurement-PSR and
Measurement-Terminal are used. The Measurement-Terminal association is
never used alone.""" ;
    sh:closed true ;
    sh:ignoredProperties ( cim:Analog.positiveFlowIn rdf:type ) ;
    sh:property [ sh:datatype xsd:string ;
            sh:description "One or more measurements may be associated with a terminal in the network." ;
            sh:maxCount 1 ;
            sh:nodeKind sh:Literal ;
            sh:order 2 ;
            sh:path cim:Measurement.Terminal ],
        [ sh:description "The unit of measure of the measured quantity." ;
            sh:in ( cim:UnitSymbol.A cim:UnitSymbol.Ah cim:UnitSymbol.none cim:UnitSymbol.ohm cim:UnitSymbol.V cim:UnitSymbol.VA cim:UnitSymbol.VAh cim:UnitSymbol.VAr cim:UnitSymbol.VArh cim:UnitSymbol.W cim:UnitSymbol.Wb cim:UnitSymbol.Wh ) ;
            sh:maxCount 1 ;
            sh:minCount 1 ;
            sh:order 1 ;
            sh:path cim:Measurement.unitSymbol ],
        [ sh:datatype xsd:string ;
            sh:description "The power system resource that contains the measurement." ;
            sh:maxCount 1 ;
            sh:nodeKind sh:Literal ;
            sh:order 3 ;
            sh:path cim:Measurement.PowerSystemResource ],
        [ sh:description "The unit multiplier of the measured quantity." ;
            sh:in ( cim:UnitMultiplier.G cim:UnitMultiplier.h cim:UnitMultiplier.k cim:UnitMultiplier.m cim:UnitMultiplier.M cim:UnitMultiplier.micro cim:UnitMultiplier.none ) ;
            sh:maxCount 1 ;
            sh:minCount 1 ;
            sh:order 0 ;
            sh:path cim:Measurement.unitMultiplier ],
        [ sh:datatype xsd:string ;
            sh:description """Master resource identifier issued by a model authority. The mRID is unique within an exchange context. Global uniqueness is easily achieved by using a UUID, as specified in RFC 4122, for the mRID. The use of UUID is strongly recommended.\r
For CIMXML data files in RDF syntax conforming to IEC 61970-552, the mRID is mapped to rdf:ID or rdf:about attributes that identify CIM object elements.""" ;
            sh:maxCount 1 ;
            sh:minCount 1 ;
            sh:nodeKind sh:Literal ;
            sh:order 4 ;
            sh:path cim:IdentifiedObject.mRID ],
        [ sh:datatype xsd:string ;
            sh:description """The name is any free human readable and possibly non unique text naming the object.\r
""" ;
            sh:maxCount 1 ;
            sh:nodeKind sh:Literal ;
            sh:order 5 ;
            sh:path cim:IdentifiedObject.name ] ;
    sh:targetClass cim:Measurement .

cim:MeasurementValue a sh:NodeShape ;
    rdfs:comment """The current state for a measurement. A state value is an instance of a measurement from a specific source. Measurements can be associated with many state values, each representing a different source for the measurement.\r
""" ;
    sh:closed true ;
    sh:ignoredProperties ( cim:AnalogValue.value cim:Analog rdf:type ) ;
    sh:property [ sh:datatype xsd:string ;
            sh:description """Master resource identifier issued by a model authority. The mRID is unique within an exchange context. Global uniqueness is easily achieved by using a UUID, as specified in RFC 4122, for the mRID. The use of UUID is strongly recommended.\r
For CIMXML data files in RDF syntax conforming to IEC 61970-552, the mRID is mapped to rdf:ID or rdf:about attributes that identify CIM object elements.""" ;
            sh:maxCount 1 ;
            sh:minCount 1 ;
            sh:nodeKind sh:Literal ;
            sh:order 1 ;
            sh:path cim:IdentifiedObject.mRID ],
        [ sh:datatype xsd:dateTime ;
            sh:description "The time when the value was last updated." ;
            sh:maxCount 1 ;
            sh:nodeKind sh:Literal ;
            sh:order 0 ;
            sh:path cim:MeasurementValue.timeStamp ],
        [ sh:datatype xsd:string ;
            sh:description """The name is any free human readable and possibly non unique text naming the object.\r
""" ;
            sh:maxCount 1 ;
            sh:nodeKind sh:Literal ;
            sh:order 2 ;
            sh:path cim:IdentifiedObject.name ] ;
    sh:targetClass cim:MeasurementValue .

cim:Analog a sh:NodeShape ;
    rdfs:comment """Analog represents an analog Measurement.\r
""" ;
    sh:closed true ;
    sh:ignoredProperties ( rdf:type ) ;
    sh:property [ sh:description "The unit of measure of the measured quantity." ;
            sh:in ( cim:UnitSymbol.A cim:UnitSymbol.Ah cim:UnitSymbol.none cim:UnitSymbol.ohm cim:UnitSymbol.V cim:UnitSymbol.VA cim:UnitSymbol.VAh cim:UnitSymbol.VAr cim:UnitSymbol.VArh cim:UnitSymbol.W cim:UnitSymbol.Wb cim:UnitSymbol.Wh ) ;
            sh:maxCount 1 ;
            sh:minCount 1 ;
            sh:order 2 ;
            sh:path cim:Measurement.unitSymbol ],
        [ sh:datatype xsd:string ;
            sh:description "The power system resource that contains the measurement." ;
            sh:maxCount 1 ;
            sh:nodeKind sh:Literal ;
            sh:order 4 ;
            sh:path cim:Measurement.PowerSystemResource ],
        [ sh:datatype xsd:boolean ;
            sh:description "If true then this measurement is an active power, reactive power or current with the convention that a positive value measured at the Terminal means power is flowing into the related PowerSystemResource." ;
            sh:maxCount 1 ;
            sh:nodeKind sh:Literal ;
            sh:order 0 ;
            sh:path cim:Analog.positiveFlowIn ],
        [ sh:datatype xsd:string ;
            sh:description "One or more measurements may be associated with a terminal in the network." ;
            sh:maxCount 1 ;
            sh:nodeKind sh:Literal ;
            sh:order 3 ;
            sh:path cim:Measurement.Terminal ],
        [ sh:datatype xsd:string ;
            sh:description """The name is any free human readable and possibly non unique text naming the object.\r
""" ;
            sh:maxCount 1 ;
            sh:nodeKind sh:Literal ;
            sh:order 6 ;
            sh:path cim:IdentifiedObject.name ],
        [ sh:description "The unit multiplier of the measured quantity." ;
            sh:in ( cim:UnitMultiplier.G cim:UnitMultiplier.h cim:UnitMultiplier.k cim:UnitMultiplier.m cim:UnitMultiplier.M cim:UnitMultiplier.micro cim:UnitMultiplier.none ) ;
            sh:maxCount 1 ;
            sh:minCount 1 ;
            sh:order 1 ;
            sh:path cim:Measurement.unitMultiplier ],
        [ sh:datatype xsd:string ;
            sh:description """Master resource identifier issued by a model authority. The mRID is unique within an exchange context. Global uniqueness is easily achieved by using a UUID, as specified in RFC 4122, for the mRID. The use of UUID is strongly recommended.\r
For CIMXML data files in RDF syntax conforming to IEC 61970-552, the mRID is mapped to rdf:ID or rdf:about attributes that identify CIM object elements.""" ;
            sh:maxCount 1 ;
            sh:minCount 1 ;
            sh:nodeKind sh:Literal ;
            sh:order 5 ;
            sh:path cim:IdentifiedObject.mRID ] ;
    sh:targetClass cim:Analog .


