Skip to content

Commit cbeea35

Browse files
authored
Merge pull request #84 from Teester/get_start_shape
refactor _get_start_shape
2 parents f8ca664 + d773228 commit cbeea35

1 file changed

Lines changed: 7 additions & 24 deletions

File tree

entityshape/api_v2/comparejsonld.py

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -132,29 +132,12 @@ def _get_start_shape(self) -> dict:
132132
133133
:return: the start shape
134134
"""
135-
if "start" in self._shape:
136-
start: dict = self._shape['start']
137-
start_shape: dict = {}
138-
if "shapes" in self._shape:
139-
for shape in self._shape['shapes']:
140-
if shape["id"] == start:
141-
start_shape = shape
142-
return start_shape
143-
else:
135+
if "start" not in self._shape:
136+
return {}
137+
if "shapes" not in self._shape:
144138
return {}
145139

146-
def _process_one_of(self) -> None:
147-
"""
148-
Processes one of expression types in the shape
149-
150-
:return:
151-
"""
152-
pass
153-
154-
def _process_each_of(self) -> None:
155-
"""
156-
Processes each of expression types in the shape
157-
158-
:return:
159-
"""
160-
pass
140+
for shape in self._shape['shapes']:
141+
if shape["id"] == self._shape["start"]:
142+
return shape
143+
return {}

0 commit comments

Comments
 (0)