diff --git a/cimsparql/data_models.py b/cimsparql/data_models.py index 630edc45..dddb7e89 100644 --- a/cimsparql/data_models.py +++ b/cimsparql/data_models.py @@ -75,7 +75,6 @@ class BusDataSchema(JsonSchemaOut): class LoadsSchema(NamedResourceSchema): node: Series[str] = pa.Field() substation_mrid: Series[str] = pa.Field() - bidzone: Series[str] = pa.Field(nullable=True) status: Series[bool] = pa.Field() p: Series[float] = pa.Field(nullable=True) q: Series[float] = pa.Field(nullable=True) @@ -105,7 +104,6 @@ class SynchronousMachinesSchema(NamedMarketResourceSchema): maxP: Series[float] = pa.Field() minP: Series[float] = pa.Field() MO: Series[float] = pa.Field(nullable=True) - bidzone: Series[str] = pa.Field(nullable=True) sn: Series[float] = pa.Field() p: Series[float] = pa.Field(nullable=True) q: Series[float] = pa.Field(nullable=True) @@ -200,8 +198,6 @@ class CoordinatesSchema(JsonSchemaOut): class BranchComponentSchema(NamedResourceSchema): - bidzone_1: Series[str] = pa.Field(nullable=True) - bidzone_2: Series[str] = pa.Field(nullable=True) node_1: Series[str] = pa.Field() node_2: Series[str] = pa.Field() ploss_1: Series[float] = pa.Field(nullable=True) diff --git a/cimsparql/sparql/ac_lines.sparql b/cimsparql/sparql/ac_lines.sparql index a2cf42bc..b707fb9e 100644 --- a/cimsparql/sparql/ac_lines.sparql +++ b/cimsparql/sparql/ac_lines.sparql @@ -11,8 +11,6 @@ select # thus max-aggregation will pick True if it exists in the group (max(?mrid) as ?mrid) (max(?name) as ?name) -(max(?bidzone_1) as ?bidzone_1) -(max(?bidzone_2) as ?bidzone_2) (max(?node_1) as ?node_1) (max(?node_2) as ?node_2) @@ -54,9 +52,6 @@ where { # Find area and optionally bidzone for each substation ?substation cim:Substation.Region/cim:SubGeographicalRegion.Region/cim:IdentifiedObject.name ?area . - optional { - ?substation SN:Substation.MarketDeliveryPoint/SN:MarketDeliveryPoint.BiddingArea/SN:BiddingArea.marketCode ?bidzone . - } optional {?acline cim:ACLineSegment.gch ?g .} optional {?acline SN:Equipment.networkAnalysisEnable ?analysis_enabled .} @@ -87,11 +82,9 @@ where { bind(if(?nr = 1, str(?p), '') as ?p_1) bind(if(?nr = 1, ?node, '') as ?node_1) bind(if(?nr = 1, ?connected, False) as ?connected_1) - bind(if(?nr = 1, ?bidzone, '') as ?bidzone_1) bind(if(?nr = 2, str(?p), '') as ?p_2) bind(if(?nr = 2, ?node, '') as ?node_2) bind(if(?nr = 2, ?connected, False) as ?connected_2) - bind(if(?nr = 2, ?bidzone, '') as ?bidzone_2) bind(if(?nr = 1, ?connectivity_node, '') as ?connectivity_node_1) bind(if(?nr = 2, ?connectivity_node, '') as ?connectivity_node_2) filter(regex(?area, '${region}')) diff --git a/cimsparql/sparql/loads.sparql b/cimsparql/sparql/loads.sparql index dd18637e..c01542ec 100644 --- a/cimsparql/sparql/loads.sparql +++ b/cimsparql/sparql/loads.sparql @@ -1,7 +1,7 @@ # Name: Loads PREFIX cim: <${cim}> PREFIX SN: <${SN}> -select ?mrid ?name ?node ?substation_mrid ?bidzone ?status ?p ?q ?station_group ?connectivity_node +select ?mrid ?name ?node ?substation_mrid ?status ?p ?q ?station_group ?connectivity_node where { { # Appears to be significantly faster to run the query if the EQ part is executed within its own sub-query @@ -18,8 +18,6 @@ where { cim:IdentifiedObject.mRID ?substation_mrid . filter regex(?area, '${region}') - # Optionally extract bidzone for each substation and station_group for each load - optional {?substation SN:Substation.MarketDeliveryPoint/SN:MarketDeliveryPoint.BiddingArea/SN:BiddingArea.marketCode ?bidzone} . optional {?load cim:NonConformLoad.LoadGroup/SN:NonConformLoadGroup.ScheduleResource/SN:ScheduleResource.marketCode ?station_group} . optional {?load SN:Equipment.networkAnalysisEnable ?_network_analysis} . bind(coalesce(?_network_analysis, True) as ?network_analysis) diff --git a/cimsparql/sparql/series_compensators.sparql b/cimsparql/sparql/series_compensators.sparql index 01be5442..712c4b05 100644 --- a/cimsparql/sparql/series_compensators.sparql +++ b/cimsparql/sparql/series_compensators.sparql @@ -5,8 +5,6 @@ PREFIX xsd: <${xsd}> select (max(?mrid) as ?mrid) (max(?name) as ?name) - (max(?bidzone_1) as ?bidzone_1) - (max(?bidzone_2) as ?bidzone_2) (max(?node_1) as ?node_1) (max(?node_2) as ?node_2) (if (xsd:double(max(?p_1)) < xsd:double(max(?p_2)), xsd:double(max(?p_1)) + xsd:double(max(?p_2)), xsd:double(0.0)) as ?ploss_1) @@ -36,9 +34,6 @@ where { ?con_node cim:ConnectivityNode.ConnectivityNodeContainer/cim:VoltageLevel.Substation ?substation ; cim:IdentifiedObject.mRID ?connectivity_node . ?substation cim:Substation.Region/cim:SubGeographicalRegion.Region/cim:IdentifiedObject.name ?area . - optional { - ?substation SN:Substation.MarketDeliveryPoint/SN:MarketDeliveryPoint.BiddingArea/SN:BiddingArea.marketCode ?bidzone - } optional {?compensator SN:Equipment.networkAnalysisEnable ?network_analysis} filter(regex(?area, '${region}')) @@ -68,11 +63,9 @@ where { bind(if(?nr = 1, str(?p), '') as ?p_1) bind(if(?nr = 1, ?node, '') as ?node_1) bind(if(?nr = 1, ?connected, False) as ?connected_1) - bind(if(?nr = 1, ?bidzone, '') as ?bidzone_1) bind(if(?nr = 2, str(?p), '') as ?p_2) bind(if(?nr = 2, ?node, '') as ?node_2) bind(if(?nr = 2, ?connected, False) as ?connected_2) - bind(if(?nr = 2, ?bidzone, '') as ?bidzone_2) bind(if(?nr = 1, ?connectivity_node, '') as ?connectivity_node_1) bind(if(?nr = 2, ?connectivity_node, '') as ?connectivity_node_2) } group by ?compensator diff --git a/cimsparql/sparql/synchronous_machines.sparql b/cimsparql/sparql/synchronous_machines.sparql index fbcbed19..78010d06 100644 --- a/cimsparql/sparql/synchronous_machines.sparql +++ b/cimsparql/sparql/synchronous_machines.sparql @@ -2,7 +2,7 @@ PREFIX cim: <${cim}> PREFIX SN: <${SN}> PREFIX xsd: <${xsd}> -select ?mrid ?name ?market_code ?node ?status ?station_group ?station_group_name ?substation_mrid ?maxP ?minP ?MO ?bidzone ?sn ?p ?q ?connectivity_node ?generator_type ?schedule_resource +select ?mrid ?name ?market_code ?node ?status ?station_group ?station_group_name ?substation_mrid ?maxP ?minP ?MO ?sn ?p ?q ?connectivity_node ?generator_type ?schedule_resource where { # Extract properties for synchronous machines. { @@ -48,11 +48,6 @@ where { } filter regex(?area, '${region}') - # Optionally extract bidzone for the substation associated with the sync machin - optional { - ?substation SN:Substation.MarketDeliveryPoint/SN:MarketDeliveryPoint.BiddingArea/SN:BiddingArea.marketCode ?bidzone - } . - # Opionally extract non-CIM standard properties generating units optional {?machine SN:Equipment.networkAnalysisEnable ?_network_analysis} bind(if(bound(?gen_type), replace(str(?gen_type), str(cim:), ""), "unknown") as ?generator_type) diff --git a/cimsparql/sparql/transformer_branches.sparql b/cimsparql/sparql/transformer_branches.sparql index 1303351e..7ae10997 100644 --- a/cimsparql/sparql/transformer_branches.sparql +++ b/cimsparql/sparql/transformer_branches.sparql @@ -3,7 +3,7 @@ PREFIX cim: <${cim}> PREFIX SN: <${SN}> PREFIX xsd: <${xsd}> # Name: Transformer branches -select ?node_1 ?node_2 ?status ?name ?mrid ?un ?r ?x ?b ?g ?rate (?bidzone as ?bidzone_1) (?bidzone as ?bidzone_2) ?angle ?ratio ?connectivity_node_1 (?node_2 as ?connectivity_node_2) +select ?node_1 ?node_2 ?status ?name ?mrid ?un ?r ?x ?b ?g ?rate ?angle ?ratio ?connectivity_node_1 (?node_2 as ?connectivity_node_2) where { { select * where { @@ -32,10 +32,6 @@ where { ?terminal cim:Terminal.ConnectivityNode ?con_node . ?con_node cim:ConnectivityNode.ConnectivityNodeContainer/cim:VoltageLevel.BaseVoltage/cim:BaseVoltage.nominalVoltage ?un ; cim:IdentifiedObject.mRID ?connectivity_node_1 . - - # Optionally extract bidzone for substations - optional {?Substation SN:Substation.MarketDeliveryPoint/SN:MarketDeliveryPoint.BiddingArea/SN:BiddingArea.marketCode ?bidzone} . - # Optionally extract active power limits optional { ?_lim a cim:ActivePowerLimit;