Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added base_voltage attributes #24

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions cimgraph/loaders/sparql/rc4_2021/base_voltage.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ class type and object mRID
query_message = """
PREFIX r: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX cim: <http://iec.ch/TC57/CIM100#>
SELECT ?mRID ?name
SELECT ?mRID ?name ?nominalVoltage
(group_concat(distinct ?ConductingEq; separator=';') as ?ConductingEquipment)
(group_concat(distinct ?TransformerEnd; separator=';') as ?TransformerEnds)
(group_concat(distinct ?TopoNode; separator=';') as ?TopologicalNode)
(group_concat(distinct ?VoltLevel; separator=';') as ?VoltageLevel)
(group_concat(distinct ?NetworkAsset; separator=';') as ?NetworkAssetDeployment)
WHERE {
?eq r:type cim:BaseVoltage.
VALUES ?fdrid {"%s"}
Expand All @@ -31,14 +36,27 @@ class type and object mRID
query_message += ' "%s" \n'%mrid
# add all attributes
query_message += """ }
?eq cim:Equipment.EquipmentContainer ?fdr.
?condeq cim:ConductingEquipment.BaseVoltage ?eq.
?condeq cim:IdentifiedObject.mRID ?ConductingEq.
?condeq cim:Equipment.EquipmentContainer ?fdr.
?fdr cim:IdentifiedObject.mRID ?fdrid.
?eq cim:IdentifiedObject.mRID ?mRID.
?eq cim:IdentifiedObject.name ?name.

OPTIONAL {?eq cim:BaseVoltage.nominalVoltage ?nominalVoltage.}



OPTIONAL {?xfend cim:TransformerEnd.BaseVoltage ?eq.
?xfend cim:IdentifiedObject.mRID ?TransformerEnd.}

OPTIONAL {?level cim:VoltageLevel.BaseVoltage ?eq.
?level cim:IdentifiedObject.mRID ?VoltLevel.}

OPTIONAL {?asset cim:AssetDeployment.BaseVoltage ?eq.
?asset cim:IdentifiedObject.mRID ?NetworkAsset.}

}
GROUP by ?name ?mRID ?nominalVoltage
ORDER by ?name
"""
return query_message
Loading