Skip to content

Commit

Permalink
Use cim:Switch.normalOpen as fallback for cim:Switch.open
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkleiven committed Jun 12, 2024
1 parent 1eee9fe commit f3c7c44
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions cimsparql/sparql/switches.sparql
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
# Name: Switches
PREFIX cim: <${cim}>
select ?mrid ?is_open (strafter(str(?type), "#") as ?equipment_type) ?connectivity_node_1 ?connectivity_node_2 where {
?switch cim:Switch.open ?is_open;
a ?type .
?_eq_subject <http://entsoe.eu/CIM/EquipmentCore/3/1> ?eq_repo .
service ?eq_repo {
?switch cim:IdentifiedObject.mRID ?mrid;
^cim:Terminal.ConductingEquipment ?terminal1;
^cim:Terminal.ConductingEquipment ?terminal2 .
?terminal1 cim:ACDCTerminal.sequenceNumber 1;
cim:Terminal.ConnectivityNode/cim:IdentifiedObject.mRID ?connectivity_node_1 .
?terminal2 cim:ACDCTerminal.sequenceNumber 2;
cim:Terminal.ConnectivityNode/cim:IdentifiedObject.mRID ?connectivity_node_2 .
{
select * {
?_eq_subject <http://entsoe.eu/CIM/EquipmentCore/3/1> ?eq_repo .
service ?eq_repo {
?switch cim:IdentifiedObject.mRID ?mrid;
a ?type;
cim:Switch.normalOpen ?normal_open;
^cim:Terminal.ConductingEquipment ?terminal1;
^cim:Terminal.ConductingEquipment ?terminal2 .
?terminal1 cim:ACDCTerminal.sequenceNumber 1;
cim:Terminal.ConnectivityNode/cim:IdentifiedObject.mRID ?connectivity_node_1 .
?terminal2 cim:ACDCTerminal.sequenceNumber 2;
cim:Terminal.ConnectivityNode/cim:IdentifiedObject.mRID ?connectivity_node_2 .
}
}
}
optional{?switch cim:Switch.open ?ssh_is_open}
bind(coalesce(?ssh_is_open, ?normal_open) as ?is_open)
}

0 comments on commit f3c7c44

Please sign in to comment.