From 5aa5164e6a418ad44b83b8c7d36b029fe5a4ded1 Mon Sep 17 00:00:00 2001 From: Leif Warland Date: Thu, 16 Jun 2022 13:00:51 +0200 Subject: [PATCH] Add converter mrid to transformators_connected_to_converter Can/will be used to connect converter power given in SSH profile. --- cimsparql/__init__.py | 2 +- cimsparql/model.py | 2 +- cimsparql/queries.py | 3 ++- pyproject.toml | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cimsparql/__init__.py b/cimsparql/__init__.py index cf9195de..034f9b8c 100644 --- a/cimsparql/__init__.py +++ b/cimsparql/__init__.py @@ -1,2 +1,2 @@ """Library for CIM sparql queries""" -__version__ = "1.10.0" +__version__ = "1.10.1" diff --git a/cimsparql/model.py b/cimsparql/model.py index 9eefa522..1b2a257e 100644 --- a/cimsparql/model.py +++ b/cimsparql/model.py @@ -486,7 +486,7 @@ def transformers_connected_to_converter( ) if dry_run: return self._query_with_header(query) - return self._get_table_and_convert(query, index="mrid") + return self._get_table_and_convert(query, index="converter_mrid") def ac_lines( self, diff --git a/cimsparql/queries.py b/cimsparql/queries.py index 82f0ec91..169e0993 100644 --- a/cimsparql/queries.py +++ b/cimsparql/queries.py @@ -519,9 +519,10 @@ def transformers_connected_to_converter( ) -> str: mrid_subject = "?_mrid" name = "?name" - variables = ["?mrid", "?t_mrid", name] + variables = ["?mrid", "?t_mrid", "?converter_mrid", name] converters = [sup.rdf_type_tripler("?volt", converter) for converter in converter_types] where_list = [ + f"?volt {ID_OBJ}.mRID ?converter_mrid", f"{mrid_subject} {ID_OBJ}.mRID ?mrid", f"?_t_mrid {ID_OBJ}.mRID ?t_mrid", sup.rdf_type_tripler(mrid_subject, "cim:PowerTransformer"), diff --git a/pyproject.toml b/pyproject.toml index 2a40935f..401ada9b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ # character. [tool.poetry] name = "cimsparql" -version = "1.10.0" +version = "1.10.1" description = "CIM query utilities" readme = "README.md" authors = ["Statnett Datascience "]