Skip to content

Commit 041caa5

Browse files
Fixed PR comments
1 parent b5b67de commit 041caa5

File tree

7 files changed

+16
-8
lines changed

7 files changed

+16
-8
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,4 @@ dmypy.json
7070
# SAMM
7171
core/esmf-aspect-meta-model-python/esmf_aspect_meta_model_python/samm_aspect_meta_model/samm/
7272
/core/esmf-aspect-meta-model-python/samm-cli/
73+
/core/esmf-aspect-meta-model-python/tests/integration/java_models/resources/

core/esmf-aspect-meta-model-python/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ poetry run download-samm-branch
7171
```
7272
Link to all branches: [SAMM Releases](https://github.com/eclipse-esmf/esmf-semantic-aspect-meta-model/branches)
7373

74-
## SAMMGraph usage
74+
## SAMM Aspect Model Graph usage
7575

76-
SAMMGraph is a class that allows you to load and interact with the Semantic Data Aspect Meta Model graph.
77-
Below is an example of how to use SAMMGraph in your Python code:
76+
SAMM Aspect Model Graph is a class that allows you to load and interact with the Semantic Data Aspect Meta Model graph.
77+
Below is an example of how to use SAMM Aspect Model Graph in your Python code:
7878
```python
7979
from esmf_aspect_meta_model_python import SAMMGraph
8080

core/esmf-aspect-meta-model-python/esmf_aspect_meta_model_python/impl/data_types/default_abstract_entity.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,10 @@ def __init__(
3636
@property
3737
def extending_elements(self) -> List[ComplexType]:
3838
"""Extending elements."""
39-
return [DefaultComplexType._instances[element_subject] for element_subject in self.__extending_elements]
39+
extending_elements = []
40+
for element_subject in self.__extending_elements:
41+
element = DefaultComplexType._instances.get(element_subject)
42+
if element:
43+
extending_elements.append(element)
44+
45+
return extending_elements

core/esmf-aspect-meta-model-python/esmf_aspect_meta_model_python/loader/instantiator/property_instantiator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def _create_property_blank_node(self, element_node: BNode) -> Property:
8282
predicate=self._samm.get_urn(SAMM.property),
8383
)
8484
if not property_node:
85-
raise ValueError(f"Could not found property for the node {element_node}")
85+
raise ValueError(f"Could not find property for the node {element_node}")
8686

8787
return DefaultBlankProperty(
8888
base_element_node=element_node,

core/esmf-aspect-meta-model-python/esmf_aspect_meta_model_python/vocabulary/constants.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,9 @@ class CharacteristicElements:
9797

9898

9999
class SAMMEElements:
100-
TimeSeriesEntity = "TimeSeriesEntity"
100+
FileResource = "FileResource"
101101
Point3d = "Point3d"
102+
TimeSeriesEntity = "TimeSeriesEntity"
102103

103104

104105
class MetaModelElementAttributes:

core/esmf-aspect-meta-model-python/tests/integration/java_models/test_loading_aspects.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,6 @@ def run_model_elements_load_test():
156156
writer.writerow(row)
157157

158158

159-
if __name__ == "__main__":
159+
def test_loading_aspects():
160160
run_aspect_load_test()
161161
run_model_elements_load_test()

core/esmf-aspect-meta-model-python/tests/unit/loader/instantiators/test_property_instantiator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def test_create_property_blank_node_raise_exception(self):
174174
with pytest.raises(ValueError) as error:
175175
instantiator_cls._create_property_blank_node(element_node_mock)
176176

177-
assert str(error.value) == "Could not found property for the node element_node"
177+
assert str(error.value) == "Could not find property for the node element_node"
178178
samm_mock.get_urn.assert_called_once_with(SAMM.property)
179179
graph_mock.value.assert_called_once_with(subject=element_node_mock, predicate="urn")
180180

0 commit comments

Comments
 (0)