@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: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 ( rdf:type cim:Location.PowerSystemResources cim:Location.mainAddress cim:CoordinateSystem.crsUrn cim:CoordinateSystem ) ;
    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:PositionPoint a sh:NodeShape ;
    rdfs:comment "Set of spatial coordinates that determine a point, defined in the coordinate system specified in 'Location.CoordinateSystem'. Use a single position point instance to describe a point-oriented location. Use a sequence of position points to describe a line-oriented object (physical location of non-point oriented objects like cables or lines), or area of an object (like a substation or a geographical zone - in this case, have first and last position point with the same values)." ;
    sh:closed true ;
    sh:ignoredProperties ( rdf:type ) ;
    sh:property [ sh:datatype xsd:integer ;
            sh:description "Zero-relative sequence number of this point within a series of points." ;
            sh:maxCount 1 ;
            sh:nodeKind sh:Literal ;
            sh:order 1 ;
            sh:path cim:PositionPoint.sequenceNumber ],
        [ sh:datatype xsd:string ;
            sh:description "X axis position." ;
            sh:maxCount 1 ;
            sh:minCount 1 ;
            sh:nodeKind sh:Literal ;
            sh:order 2 ;
            sh:path cim:PositionPoint.xPosition ],
        [ sh:datatype xsd:integer ;
            sh:description "Zero-relative sequence number of this group within a series of points; used when there is a need to express disjoint groups of points that are considered to be part of a single location." ;
            sh:maxCount 1 ;
            sh:nodeKind sh:Literal ;
            sh:order 0 ;
            sh:path cim:PositionPoint.groupNumber ],
        [ sh:class cim:Location ;
            sh:description "Location described by this position point." ;
            sh:maxCount 1 ;
            sh:minCount 1 ;
            sh:nodeKind sh:IRI ;
            sh:order 5 ;
            sh:path cim:PositionPoint.Location ],
        [ sh:datatype xsd:string ;
            sh:description "(if applicable) Z axis position." ;
            sh:maxCount 1 ;
            sh:nodeKind sh:Literal ;
            sh:order 4 ;
            sh:path cim:PositionPoint.zPosition ],
        [ sh:datatype xsd:string ;
            sh:description "Y axis position." ;
            sh:maxCount 1 ;
            sh:minCount 1 ;
            sh:nodeKind sh:Literal ;
            sh:order 3 ;
            sh:path cim:PositionPoint.yPosition ] ;
    sh:targetClass cim:PositionPoint .

cim:Location a sh:NodeShape ;
    rdfs:comment """The place, scene, or point of something where someone or something has been, is, and/or will be at a given moment in time. It can be defined with one or more position points (coordinates) in a given coordinate system.\r
""" ;
    sh:closed true ;
    sh:ignoredProperties ( rdf:type ) ;
    sh:property [ sh:class cim:CoordinateSystem ;
            sh:description "Coordinate system used to describe position points of this location." ;
            sh:maxCount 1 ;
            sh:nodeKind sh:IRI ;
            sh:order 2 ;
            sh:path cim:Location.CoordinateSystem ],
        [ sh:datatype xsd:string ;
            sh:description "All power system resources at this location." ;
            sh:minCount 1 ;
            sh:nodeKind sh:Literal ;
            sh:order 1 ;
            sh:path cim:Location.PowerSystemResources ],
        [ sh:class cim:StreetAddress ;
            sh:description "Main address of the location." ;
            sh:maxCount 1 ;
            sh:nodeKind sh:BlankNodeOrIRI ;
            sh:order 0 ;
            sh:path cim:Location.mainAddress ],
        [ 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: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:targetClass cim:Location .

cim:StreetAddress a sh:NodeShape ;
    rdfs:comment "General purpose street and postal address information." ;
    sh:closed true ;
    sh:ignoredProperties ( rdf:type ) ;
    sh:property [ sh:datatype xsd:string ;
            sh:description "Postal code for the address." ;
            sh:maxCount 1 ;
            sh:minCount 1 ;
            sh:nodeKind sh:Literal ;
            sh:order 0 ;
            sh:path cim:StreetAddress.postalCode ],
        [ sh:class cim:StreetDetail ;
            sh:description "Street detail." ;
            sh:maxCount 1 ;
            sh:nodeKind sh:BlankNodeOrIRI ;
            sh:order 1 ;
            sh:path cim:StreetAddress.streetDetail ] ;
    sh:targetClass cim:StreetAddress .

cim:StreetDetail a sh:NodeShape ;
    rdfs:comment """Street details, in the context of address.\r
""" ;
    sh:closed true ;
    sh:ignoredProperties ( rdf:type ) ;
    sh:property [ sh:datatype xsd:string ;
            sh:description "Designator of the specific location on the street." ;
            sh:maxCount 1 ;
            sh:minCount 1 ;
            sh:nodeKind sh:Literal ;
            sh:order 0 ;
            sh:path cim:StreetDetail.number ] ;
    sh:targetClass cim:StreetDetail .

cim:CoordinateSystem a sh:NodeShape ;
    rdfs:comment """Coordinate reference system.\r
""" ;
    sh:closed true ;
    sh:ignoredProperties ( rdf:type ) ;
    sh:property [ 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: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:string ;
            sh:description """A Uniform Resource Name (URN) for the coordinate reference system (crs) used to define 'Location.PositionPoints'.\r
An example would be the European Petroleum Survey Group (EPSG) code for a coordinate reference system, defined in URN under the Open Geospatial Consortium (OGC) namespace as: urn:ogc:def:crs:EPSG::XXXX, where XXXX is an EPSG code (a full list of codes can be found at the EPSG Registry web site http://www.epsg-registry.org/). To define the coordinate system as being WGS84 (latitude, longitude) using an EPSG OGC, this attribute would be urn:ogc:def:crs:EPSG::4.3.2.6\r
A profile should limit this code to a set of allowed URNs agreed to by all sending and receiving parties.""" ;
            sh:maxCount 1 ;
            sh:nodeKind sh:Literal ;
            sh:order 0 ;
            sh:path cim:CoordinateSystem.crsUrn ] ;
    sh:targetClass cim:CoordinateSystem .


