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

Fix query #331

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
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
18 changes: 8 additions & 10 deletions src/cimsparql/sparql/bus.sparql
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,15 @@ where {
}
} .
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
Loading