From d7732282c424f0233826f96928f6535cfe93d633 Mon Sep 17 00:00:00 2001 From: Mark Tully Date: Tue, 21 Oct 2025 22:13:22 +0100 Subject: [PATCH] refactor _get_start_shape --- entityshape/api_v2/comparejsonld.py | 31 +++++++---------------------- 1 file changed, 7 insertions(+), 24 deletions(-) diff --git a/entityshape/api_v2/comparejsonld.py b/entityshape/api_v2/comparejsonld.py index a8c74ff..98650ef 100644 --- a/entityshape/api_v2/comparejsonld.py +++ b/entityshape/api_v2/comparejsonld.py @@ -132,29 +132,12 @@ def _get_start_shape(self) -> dict: :return: the start shape """ - if "start" in self._shape: - start: dict = self._shape['start'] - start_shape: dict = {} - if "shapes" in self._shape: - for shape in self._shape['shapes']: - if shape["id"] == start: - start_shape = shape - return start_shape - else: + if "start" not in self._shape: + return {} + if "shapes" not in self._shape: return {} - def _process_one_of(self) -> None: - """ - Processes one of expression types in the shape - - :return: - """ - pass - - def _process_each_of(self) -> None: - """ - Processes each of expression types in the shape - - :return: - """ - pass + for shape in self._shape['shapes']: + if shape["id"] == self._shape["start"]: + return shape + return {}