Skip to content

Commit

Permalink
fix: require connectivity nodes when calculating connected bidzones
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkleiven committed Jan 30, 2025
1 parent 9284eed commit 01caff7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
services:
rdf4j:
# Docker Hub image
image: eclipse/rdf4j-workbench:4.3.15
image: eclipse/rdf4j-workbench:5.1.0
ports:
- 8080:8080

Expand Down
20 changes: 9 additions & 11 deletions src/cimsparql/sparql/bus.sparql
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,16 @@ where {
?_substation SN:Substation.MarketDeliveryPoint/SN:MarketDeliveryPoint.BiddingArea/entsoeSecretariat:IdentifiedObject.energyIdentCodeEIC ?direct_bidzone
}
} .
optional {
# When an EIC code does not exist, look for an EIC code in neighbouring nodes
filter(!bound(?direct_bidzone))
{
select ?top_node (max(?connected_bidzone) as ?nearby_bidzone) {
?con_node cim:ConnectivityNode.TopologicalNode ?top_node .
?_eq_subj2 <http://entsoe.eu/CIM/EquipmentCore/3/1> ?eq_repo2 .
service ?eq_repo2 {
# Collect bidzones from substations connected to the current substation via a ConductingEquipment
?con_node ^cim:Terminal.ConnectivityNode/cim:Terminal.ConductingEquipment/^cim:Terminal.ConductingEquipment/cim:Terminal.ConnectivityNode/cim:ConnectivityNode.ConnectivityNodeContainer/cim:VoltageLevel.Substation/SN:Substation.MarketDeliveryPoint/SN:MarketDeliveryPoint.BiddingArea/entsoeSecretariat:IdentifiedObject.energyIdentCodeEIC ?connected_bidzone .
}} group by ?top_node}
{
select ?top_node (max(?connected_bidzone) as ?nearby_bidzone) {
?con_node cim:ConnectivityNode.TopologicalNode ?top_node .
?_eq_subj2 <http://entsoe.eu/CIM/EquipmentCore/3/1> ?eq_repo2 .
service ?eq_repo2 {
# Collect bidzones from substations connected to the current substation via a ConductingEquipment
?con_node ^cim:Terminal.ConnectivityNode/cim:Terminal.ConductingEquipment/^cim:Terminal.ConductingEquipment/cim:Terminal.ConnectivityNode/cim:ConnectivityNode.ConnectivityNodeContainer/cim:VoltageLevel.Substation/SN:Substation.MarketDeliveryPoint/SN:MarketDeliveryPoint.BiddingArea/entsoeSecretariat:IdentifiedObject.energyIdentCodeEIC ?connected_bidzone .
}} group by ?top_node
}

bind(coalesce(?direct_bidzone, ?nearby_bidzone) as ?bidzone)

FILTER regex(?area, '${region}')
Expand Down

0 comments on commit 01caff7

Please sign in to comment.