esmf-aspect-model-loader 0.1.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (189) hide show
  1. esmf_aspect_meta_model_python/__init__.py +88 -0
  2. esmf_aspect_meta_model_python/base/README.md +48 -0
  3. esmf_aspect_meta_model_python/base/__init__.py +48 -0
  4. esmf_aspect_meta_model_python/base/aspect.py +41 -0
  5. esmf_aspect_meta_model_python/base/base.py +36 -0
  6. esmf_aspect_meta_model_python/base/bound_definition.py +27 -0
  7. esmf_aspect_meta_model_python/base/cache_strategy.py +66 -0
  8. esmf_aspect_meta_model_python/base/characteristics/__init__.py +10 -0
  9. esmf_aspect_meta_model_python/base/characteristics/characteristic.py +29 -0
  10. esmf_aspect_meta_model_python/base/characteristics/code.py +21 -0
  11. esmf_aspect_meta_model_python/base/characteristics/collection/__init__.py +10 -0
  12. esmf_aspect_meta_model_python/base/characteristics/collection/collection.py +29 -0
  13. esmf_aspect_meta_model_python/base/characteristics/collection/list.py +21 -0
  14. esmf_aspect_meta_model_python/base/characteristics/collection/set.py +21 -0
  15. esmf_aspect_meta_model_python/base/characteristics/collection/sorted_set.py +21 -0
  16. esmf_aspect_meta_model_python/base/characteristics/collection/time_series.py +21 -0
  17. esmf_aspect_meta_model_python/base/characteristics/either.py +31 -0
  18. esmf_aspect_meta_model_python/base/characteristics/enumeration.py +27 -0
  19. esmf_aspect_meta_model_python/base/characteristics/quantifiable/__init__.py +10 -0
  20. esmf_aspect_meta_model_python/base/characteristics/quantifiable/duration.py +21 -0
  21. esmf_aspect_meta_model_python/base/characteristics/quantifiable/measurement.py +21 -0
  22. esmf_aspect_meta_model_python/base/characteristics/quantifiable/quantifiable.py +30 -0
  23. esmf_aspect_meta_model_python/base/characteristics/single_entity.py +21 -0
  24. esmf_aspect_meta_model_python/base/characteristics/state.py +26 -0
  25. esmf_aspect_meta_model_python/base/characteristics/structured_value.py +33 -0
  26. esmf_aspect_meta_model_python/base/characteristics/trait.py +36 -0
  27. esmf_aspect_meta_model_python/base/contraints/__init__.py +10 -0
  28. esmf_aspect_meta_model_python/base/contraints/constraint.py +22 -0
  29. esmf_aspect_meta_model_python/base/contraints/encoding_constraint.py +26 -0
  30. esmf_aspect_meta_model_python/base/contraints/fixed_point_constraint.py +32 -0
  31. esmf_aspect_meta_model_python/base/contraints/language_constraint.py +26 -0
  32. esmf_aspect_meta_model_python/base/contraints/length_constraint.py +34 -0
  33. esmf_aspect_meta_model_python/base/contraints/locale_constraint.py +26 -0
  34. esmf_aspect_meta_model_python/base/contraints/range_constraint.py +45 -0
  35. esmf_aspect_meta_model_python/base/contraints/regular_expression_constraint.py +25 -0
  36. esmf_aspect_meta_model_python/base/data_types/__init__.py +10 -0
  37. esmf_aspect_meta_model_python/base/data_types/abstract_entity.py +29 -0
  38. esmf_aspect_meta_model_python/base/data_types/complex_type.py +41 -0
  39. esmf_aspect_meta_model_python/base/data_types/data_type.py +32 -0
  40. esmf_aspect_meta_model_python/base/data_types/entity.py +22 -0
  41. esmf_aspect_meta_model_python/base/data_types/scalar.py +27 -0
  42. esmf_aspect_meta_model_python/base/event.py +29 -0
  43. esmf_aspect_meta_model_python/base/has_properties.py +28 -0
  44. esmf_aspect_meta_model_python/base/has_urn.py +31 -0
  45. esmf_aspect_meta_model_python/base/is_described.py +51 -0
  46. esmf_aspect_meta_model_python/base/operation.py +34 -0
  47. esmf_aspect_meta_model_python/base/property.py +82 -0
  48. esmf_aspect_meta_model_python/base/property_func.py +50 -0
  49. esmf_aspect_meta_model_python/base/quantity_kind.py +20 -0
  50. esmf_aspect_meta_model_python/base/structure_element.py +19 -0
  51. esmf_aspect_meta_model_python/base/unit.py +49 -0
  52. esmf_aspect_meta_model_python/impl/README.md +132 -0
  53. esmf_aspect_meta_model_python/impl/__init__.py +46 -0
  54. esmf_aspect_meta_model_python/impl/base_impl.py +77 -0
  55. esmf_aspect_meta_model_python/impl/characteristics/__init__.py +10 -0
  56. esmf_aspect_meta_model_python/impl/characteristics/collection/__init__.py +10 -0
  57. esmf_aspect_meta_model_python/impl/characteristics/collection/default_collection.py +42 -0
  58. esmf_aspect_meta_model_python/impl/characteristics/collection/default_list.py +17 -0
  59. esmf_aspect_meta_model_python/impl/characteristics/collection/default_set.py +17 -0
  60. esmf_aspect_meta_model_python/impl/characteristics/collection/default_sorted_set.py +17 -0
  61. esmf_aspect_meta_model_python/impl/characteristics/collection/default_time_series.py +17 -0
  62. esmf_aspect_meta_model_python/impl/characteristics/default_characteristic.py +32 -0
  63. esmf_aspect_meta_model_python/impl/characteristics/default_code.py +17 -0
  64. esmf_aspect_meta_model_python/impl/characteristics/default_either.py +45 -0
  65. esmf_aspect_meta_model_python/impl/characteristics/default_enumeration.py +35 -0
  66. esmf_aspect_meta_model_python/impl/characteristics/default_single_entity.py +17 -0
  67. esmf_aspect_meta_model_python/impl/characteristics/default_state.py +36 -0
  68. esmf_aspect_meta_model_python/impl/characteristics/default_structured_value.py +42 -0
  69. esmf_aspect_meta_model_python/impl/characteristics/default_trait.py +49 -0
  70. esmf_aspect_meta_model_python/impl/characteristics/quantifiable/__init__.py +10 -0
  71. esmf_aspect_meta_model_python/impl/characteristics/quantifiable/default_duration.py +17 -0
  72. esmf_aspect_meta_model_python/impl/characteristics/quantifiable/default_measurement.py +17 -0
  73. esmf_aspect_meta_model_python/impl/characteristics/quantifiable/default_quantifiable.py +38 -0
  74. esmf_aspect_meta_model_python/impl/constraints/__init__.py +10 -0
  75. esmf_aspect_meta_model_python/impl/constraints/default_constraint.py +19 -0
  76. esmf_aspect_meta_model_python/impl/constraints/default_encoding_constraint.py +27 -0
  77. esmf_aspect_meta_model_python/impl/constraints/default_fixed_point_constraint.py +38 -0
  78. esmf_aspect_meta_model_python/impl/constraints/default_language_constraint.py +27 -0
  79. esmf_aspect_meta_model_python/impl/constraints/default_length_constraint.py +40 -0
  80. esmf_aspect_meta_model_python/impl/constraints/default_locale_constraint.py +27 -0
  81. esmf_aspect_meta_model_python/impl/constraints/default_range_constraint.py +55 -0
  82. esmf_aspect_meta_model_python/impl/constraints/default_regular_expression_constraint.py +27 -0
  83. esmf_aspect_meta_model_python/impl/data_types/__init__.py +10 -0
  84. esmf_aspect_meta_model_python/impl/data_types/default_abstract_entity.py +37 -0
  85. esmf_aspect_meta_model_python/impl/data_types/default_complex_type.py +101 -0
  86. esmf_aspect_meta_model_python/impl/data_types/default_entity.py +17 -0
  87. esmf_aspect_meta_model_python/impl/data_types/default_scalar.py +30 -0
  88. esmf_aspect_meta_model_python/impl/default_aspect.py +69 -0
  89. esmf_aspect_meta_model_python/impl/default_event.py +34 -0
  90. esmf_aspect_meta_model_python/impl/default_operation.py +50 -0
  91. esmf_aspect_meta_model_python/impl/default_property.py +111 -0
  92. esmf_aspect_meta_model_python/impl/default_quantity_kind.py +17 -0
  93. esmf_aspect_meta_model_python/impl/default_unit.py +68 -0
  94. esmf_aspect_meta_model_python/loader/README.md +58 -0
  95. esmf_aspect_meta_model_python/loader/__init__.py +10 -0
  96. esmf_aspect_meta_model_python/loader/aspect_loader.py +173 -0
  97. esmf_aspect_meta_model_python/loader/default_element_cache.py +59 -0
  98. esmf_aspect_meta_model_python/loader/instantiator/__init__.py +10 -0
  99. esmf_aspect_meta_model_python/loader/instantiator/abstract_entity_instantiator.py +38 -0
  100. esmf_aspect_meta_model_python/loader/instantiator/abstract_property_instantiator.py +95 -0
  101. esmf_aspect_meta_model_python/loader/instantiator/aspect_instantiator.py +46 -0
  102. esmf_aspect_meta_model_python/loader/instantiator/characteristic_instantiator.py +27 -0
  103. esmf_aspect_meta_model_python/loader/instantiator/code_instantiator.py +27 -0
  104. esmf_aspect_meta_model_python/loader/instantiator/collection_instantiator.py +29 -0
  105. esmf_aspect_meta_model_python/loader/instantiator/complex_type_instantiator.py +74 -0
  106. esmf_aspect_meta_model_python/loader/instantiator/duration_instantiator.py +29 -0
  107. esmf_aspect_meta_model_python/loader/instantiator/either_instantiator.py +30 -0
  108. esmf_aspect_meta_model_python/loader/instantiator/encoding_constraint_instantiator.py +28 -0
  109. esmf_aspect_meta_model_python/loader/instantiator/entity_instantiator.py +40 -0
  110. esmf_aspect_meta_model_python/loader/instantiator/enumeration_instantiator.py +98 -0
  111. esmf_aspect_meta_model_python/loader/instantiator/event_instantiator.py +27 -0
  112. esmf_aspect_meta_model_python/loader/instantiator/fixed_point_constraint_instantiator.py +30 -0
  113. esmf_aspect_meta_model_python/loader/instantiator/language_constraint_instantiator.py +27 -0
  114. esmf_aspect_meta_model_python/loader/instantiator/length_constraint_instantiator.py +30 -0
  115. esmf_aspect_meta_model_python/loader/instantiator/list_instantiator.py +29 -0
  116. esmf_aspect_meta_model_python/loader/instantiator/locale_constraint_instantiator.py +27 -0
  117. esmf_aspect_meta_model_python/loader/instantiator/measurement_instantiator.py +30 -0
  118. esmf_aspect_meta_model_python/loader/instantiator/operation_instantiator.py +35 -0
  119. esmf_aspect_meta_model_python/loader/instantiator/property_instantiator.py +135 -0
  120. esmf_aspect_meta_model_python/loader/instantiator/quantifiable_instantiator.py +29 -0
  121. esmf_aspect_meta_model_python/loader/instantiator/range_constraint_instantiator.py +79 -0
  122. esmf_aspect_meta_model_python/loader/instantiator/regular_expression_constraint_instantiator.py +29 -0
  123. esmf_aspect_meta_model_python/loader/instantiator/scalar_instantiator.py +24 -0
  124. esmf_aspect_meta_model_python/loader/instantiator/set_instantiator.py +29 -0
  125. esmf_aspect_meta_model_python/loader/instantiator/single_entity_instantiator.py +27 -0
  126. esmf_aspect_meta_model_python/loader/instantiator/sorted_set_instantiator.py +29 -0
  127. esmf_aspect_meta_model_python/loader/instantiator/structured_value_instantiator.py +49 -0
  128. esmf_aspect_meta_model_python/loader/instantiator/time_series_instantiator.py +29 -0
  129. esmf_aspect_meta_model_python/loader/instantiator/trait_instantiator.py +44 -0
  130. esmf_aspect_meta_model_python/loader/instantiator/unit_instantiator.py +70 -0
  131. esmf_aspect_meta_model_python/loader/instantiator_base.py +189 -0
  132. esmf_aspect_meta_model_python/loader/meta_model_base_attributes.py +186 -0
  133. esmf_aspect_meta_model_python/loader/model_element_factory.py +151 -0
  134. esmf_aspect_meta_model_python/loader/rdf_helper.py +90 -0
  135. esmf_aspect_meta_model_python/resolver/README.md +25 -0
  136. esmf_aspect_meta_model_python/resolver/__init__.py +10 -0
  137. esmf_aspect_meta_model_python/resolver/aspect_meta_model_resolver.py +56 -0
  138. esmf_aspect_meta_model_python/samm_aspect_meta_model/__init__.py +0 -0
  139. esmf_aspect_meta_model_python/samm_aspect_meta_model/download_samm_branch.py +68 -0
  140. esmf_aspect_meta_model_python/samm_aspect_meta_model/download_samm_release.py +56 -0
  141. esmf_aspect_meta_model_python/samm_aspect_meta_model/github_file.py +29 -0
  142. esmf_aspect_meta_model_python/samm_aspect_meta_model/github_folder.py +60 -0
  143. esmf_aspect_meta_model_python/samm_aspect_meta_model/samm/characteristic/1.0.0/characteristic-definitions.ttl +231 -0
  144. esmf_aspect_meta_model_python/samm_aspect_meta_model/samm/characteristic/1.0.0/characteristic-instances.ttl +70 -0
  145. esmf_aspect_meta_model_python/samm_aspect_meta_model/samm/characteristic/1.0.0/characteristic-shapes.ttl +774 -0
  146. esmf_aspect_meta_model_python/samm_aspect_meta_model/samm/characteristic/1.0.0/characteristic-validations.js +179 -0
  147. esmf_aspect_meta_model_python/samm_aspect_meta_model/samm/characteristic/2.0.0/characteristic-definitions.ttl +256 -0
  148. esmf_aspect_meta_model_python/samm_aspect_meta_model/samm/characteristic/2.0.0/characteristic-instances.ttl +61 -0
  149. esmf_aspect_meta_model_python/samm_aspect_meta_model/samm/characteristic/2.0.0/characteristic-shapes.ttl +809 -0
  150. esmf_aspect_meta_model_python/samm_aspect_meta_model/samm/characteristic/2.0.0/characteristic-validations.js +179 -0
  151. esmf_aspect_meta_model_python/samm_aspect_meta_model/samm/characteristic/2.1.0/characteristic-definitions.ttl +256 -0
  152. esmf_aspect_meta_model_python/samm_aspect_meta_model/samm/characteristic/2.1.0/characteristic-instances.ttl +61 -0
  153. esmf_aspect_meta_model_python/samm_aspect_meta_model/samm/characteristic/2.1.0/characteristic-shapes.ttl +809 -0
  154. esmf_aspect_meta_model_python/samm_aspect_meta_model/samm/characteristic/2.1.0/characteristic-validations.js +179 -0
  155. esmf_aspect_meta_model_python/samm_aspect_meta_model/samm/entity/1.0.0/FileResource.ttl +34 -0
  156. esmf_aspect_meta_model_python/samm_aspect_meta_model/samm/entity/1.0.0/Point3d.ttl +35 -0
  157. esmf_aspect_meta_model_python/samm_aspect_meta_model/samm/entity/1.0.0/TimeSeriesEntity.ttl +31 -0
  158. esmf_aspect_meta_model_python/samm_aspect_meta_model/samm/entity/2.0.0/FileResource.ttl +31 -0
  159. esmf_aspect_meta_model_python/samm_aspect_meta_model/samm/entity/2.0.0/Point3d.ttl +31 -0
  160. esmf_aspect_meta_model_python/samm_aspect_meta_model/samm/entity/2.0.0/TimeSeriesEntity.ttl +28 -0
  161. esmf_aspect_meta_model_python/samm_aspect_meta_model/samm/entity/2.1.0/FileResource.ttl +31 -0
  162. esmf_aspect_meta_model_python/samm_aspect_meta_model/samm/entity/2.1.0/Point3d.ttl +31 -0
  163. esmf_aspect_meta_model_python/samm_aspect_meta_model/samm/entity/2.1.0/TimeSeriesEntity.ttl +28 -0
  164. esmf_aspect_meta_model_python/samm_aspect_meta_model/samm/meta-model/1.0.0/aspect-meta-model-definitions.ttl +197 -0
  165. esmf_aspect_meta_model_python/samm_aspect_meta_model/samm/meta-model/1.0.0/aspect-meta-model-shapes.ttl +750 -0
  166. esmf_aspect_meta_model_python/samm_aspect_meta_model/samm/meta-model/1.0.0/prefix-declarations.ttl +67 -0
  167. esmf_aspect_meta_model_python/samm_aspect_meta_model/samm/meta-model/1.0.0/type-conversions.ttl +59 -0
  168. esmf_aspect_meta_model_python/samm_aspect_meta_model/samm/meta-model/2.0.0/aspect-meta-model-definitions.ttl +243 -0
  169. esmf_aspect_meta_model_python/samm_aspect_meta_model/samm/meta-model/2.0.0/aspect-meta-model-shapes.ttl +982 -0
  170. esmf_aspect_meta_model_python/samm_aspect_meta_model/samm/meta-model/2.0.0/prefix-declarations.ttl +67 -0
  171. esmf_aspect_meta_model_python/samm_aspect_meta_model/samm/meta-model/2.0.0/type-conversions.ttl +59 -0
  172. esmf_aspect_meta_model_python/samm_aspect_meta_model/samm/meta-model/2.1.0/aspect-meta-model-definitions.ttl +243 -0
  173. esmf_aspect_meta_model_python/samm_aspect_meta_model/samm/meta-model/2.1.0/aspect-meta-model-shapes.ttl +982 -0
  174. esmf_aspect_meta_model_python/samm_aspect_meta_model/samm/meta-model/2.1.0/prefix-declarations.ttl +67 -0
  175. esmf_aspect_meta_model_python/samm_aspect_meta_model/samm/meta-model/2.1.0/type-conversions.ttl +59 -0
  176. esmf_aspect_meta_model_python/samm_aspect_meta_model/samm/scripts/language-registry.js +1 -0
  177. esmf_aspect_meta_model_python/samm_aspect_meta_model/samm/unit/1.0.0/units.ttl +19560 -0
  178. esmf_aspect_meta_model_python/samm_aspect_meta_model/samm/unit/2.0.0/units.ttl +14828 -0
  179. esmf_aspect_meta_model_python/samm_aspect_meta_model/samm/unit/2.1.0/units.ttl +14828 -0
  180. esmf_aspect_meta_model_python/vocabulary/SAMM.py +75 -0
  181. esmf_aspect_meta_model_python/vocabulary/SAMMC.py +82 -0
  182. esmf_aspect_meta_model_python/vocabulary/SAMME.py +34 -0
  183. esmf_aspect_meta_model_python/vocabulary/UNIT.py +27 -0
  184. esmf_aspect_meta_model_python/vocabulary/__init__.py +10 -0
  185. esmf_aspect_meta_model_python/vocabulary/namespace.py +35 -0
  186. esmf_aspect_model_loader-0.1.2.dist-info/METADATA +84 -0
  187. esmf_aspect_model_loader-0.1.2.dist-info/RECORD +189 -0
  188. esmf_aspect_model_loader-0.1.2.dist-info/WHEEL +4 -0
  189. esmf_aspect_model_loader-0.1.2.dist-info/entry_points.txt +4 -0
@@ -0,0 +1,88 @@
1
+ # Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH
2
+ #
3
+ # See the AUTHORS file(s) distributed with this work for additional
4
+ # information regarding authorship.
5
+ #
6
+ # This Source Code Form is subject to the terms of the Mozilla Public
7
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
8
+ # file, You can obtain one at https://mozilla.org/MPL/2.0/.
9
+ #
10
+ # SPDX-License-Identifier: MPL-2.0
11
+
12
+ from .base import (
13
+ AbstractEntity,
14
+ Aspect,
15
+ Base,
16
+ BoundDefinition,
17
+ Characteristic,
18
+ Code,
19
+ Collection,
20
+ ComplexType,
21
+ Constraint,
22
+ DataType,
23
+ Duration,
24
+ Either,
25
+ EncodingConstraint,
26
+ Entity,
27
+ Enumeration,
28
+ Event,
29
+ FixedPointConstraint,
30
+ LanguageConstraint,
31
+ LengthConstraint,
32
+ List,
33
+ LocaleConstraint,
34
+ Measurement,
35
+ Operation,
36
+ Property,
37
+ Quantifiable,
38
+ QuantityKind,
39
+ RangeConstraint,
40
+ RegularExpressionConstraint,
41
+ Scalar,
42
+ Set,
43
+ SingleEntity,
44
+ SortedSet,
45
+ State,
46
+ StructuredValue,
47
+ TimeSeries,
48
+ Trait,
49
+ Unit,
50
+ )
51
+ from .impl import (
52
+ BaseImpl,
53
+ DefaultAbstractEntity,
54
+ DefaultAspect,
55
+ DefaultCharacteristic,
56
+ DefaultCode,
57
+ DefaultCollection,
58
+ DefaultComplexType,
59
+ DefaultConstraint,
60
+ DefaultDuration,
61
+ DefaultEither,
62
+ DefaultEncodingConstraint,
63
+ DefaultEntity,
64
+ DefaultEnumeration,
65
+ DefaultEvent,
66
+ DefaultFixedPointConstraint,
67
+ DefaultLanguageConstraint,
68
+ DefaultLengthConstraint,
69
+ DefaultList,
70
+ DefaultLocaleConstraint,
71
+ DefaultMeasurement,
72
+ DefaultOperation,
73
+ DefaultProperty,
74
+ DefaultQuantifiable,
75
+ DefaultQuantityKind,
76
+ DefaultRangeConstraint,
77
+ DefaultRegularExpressionConstraint,
78
+ DefaultScalar,
79
+ DefaultSet,
80
+ DefaultSingleEntity,
81
+ DefaultSortedSet,
82
+ DefaultState,
83
+ DefaultStructuredValue,
84
+ DefaultTimeSeries,
85
+ DefaultTrait,
86
+ DefaultUnit,
87
+ )
88
+ from .loader.aspect_loader import AspectLoader
@@ -0,0 +1,48 @@
1
+ # Base
2
+ This folder contains a minimum definition of the elements in the SAMM. The folder does not include any implementations.
3
+ It can be seen as a contract that establishes a fixed structure and inheritance hierarchy.
4
+ The classes should not be instantiated because they are abstract which is similar to interfaces in Java.
5
+
6
+ # Inheritance hierarchy
7
+ ```
8
+ HasUrn
9
+ ├───────────────────────────────────────────────── DataType
10
+ └── IsDescribed ├── Scalar
11
+ └── Base HasProperties │
12
+ ├── StructureElement <──┘ │
13
+ │ ├── Aspect │
14
+ │ └── ComplexType <──────────────────────┘
15
+ │ ├── AbstractEntity
16
+ │ └── Entity
17
+ ├── Characteristic
18
+ │ ├── Code
19
+ │ ├── Collection
20
+ │ │ ├── List
21
+ │ │ ├── Set
22
+ │ │ └── SortedSet
23
+ │ │ └── TimeSeries
24
+ │ ├── Either
25
+ │ ├── Enumeration
26
+ │ │ └── State
27
+ │ ├── SingleEntity
28
+ │ ├── StructuredValue
29
+ │ ├── Quantifiable
30
+ │ │ ├── Duration
31
+ │ │ └── Measurement
32
+ │ └── Trait
33
+ ├── Constraint
34
+ │ ├── EncodingConstraint
35
+ │ ├── FixedPointConstraint
36
+ │ ├── LanguageConstraint
37
+ │ ├── LengthConstraint
38
+ │ ├── LocaleConstraint
39
+ │ ├── RangeConstraint
40
+ │ └── RegularExpressionConstraint
41
+ ├── Event
42
+ ├── Operation
43
+ ├── Property
44
+ ├── QuantityKind
45
+ └── Unit
46
+
47
+ BoundDefiniton
48
+ ```
@@ -0,0 +1,48 @@
1
+ # Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH
2
+ #
3
+ # See the AUTHORS file(s) distributed with this work for additional
4
+ # information regarding authorship.
5
+ #
6
+ # This Source Code Form is subject to the terms of the Mozilla Public
7
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
8
+ # file, You can obtain one at https://mozilla.org/MPL/2.0/.
9
+ #
10
+ # SPDX-License-Identifier: MPL-2.0
11
+
12
+ from .aspect import Aspect
13
+ from .base import Base
14
+ from .bound_definition import BoundDefinition
15
+ from .characteristics.characteristic import Characteristic
16
+ from .characteristics.code import Code
17
+ from .characteristics.collection.collection import Collection
18
+ from .characteristics.collection.list import List
19
+ from .characteristics.collection.set import Set
20
+ from .characteristics.collection.sorted_set import SortedSet
21
+ from .characteristics.collection.time_series import TimeSeries
22
+ from .characteristics.either import Either
23
+ from .characteristics.enumeration import Enumeration
24
+ from .characteristics.quantifiable.duration import Duration
25
+ from .characteristics.quantifiable.measurement import Measurement
26
+ from .characteristics.quantifiable.quantifiable import Quantifiable
27
+ from .characteristics.single_entity import SingleEntity
28
+ from .characteristics.state import State
29
+ from .characteristics.structured_value import StructuredValue
30
+ from .characteristics.trait import Trait
31
+ from .contraints.constraint import Constraint
32
+ from .contraints.encoding_constraint import EncodingConstraint
33
+ from .contraints.fixed_point_constraint import FixedPointConstraint
34
+ from .contraints.language_constraint import LanguageConstraint
35
+ from .contraints.length_constraint import LengthConstraint
36
+ from .contraints.locale_constraint import LocaleConstraint
37
+ from .contraints.range_constraint import RangeConstraint
38
+ from .contraints.regular_expression_constraint import RegularExpressionConstraint
39
+ from .data_types.abstract_entity import AbstractEntity
40
+ from .data_types.complex_type import ComplexType
41
+ from .data_types.data_type import DataType
42
+ from .data_types.entity import Entity
43
+ from .data_types.scalar import Scalar
44
+ from .event import Event
45
+ from .operation import Operation
46
+ from .property import Property
47
+ from .quantity_kind import QuantityKind
48
+ from .unit import Unit
@@ -0,0 +1,41 @@
1
+ # Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH
2
+ #
3
+ # See the AUTHORS file(s) distributed with this work for additional
4
+ # information regarding authorship.
5
+ #
6
+ # This Source Code Form is subject to the terms of the Mozilla Public
7
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
8
+ # file, You can obtain one at https://mozilla.org/MPL/2.0/.
9
+ #
10
+ # SPDX-License-Identifier: MPL-2.0
11
+
12
+ from abc import ABC, abstractmethod
13
+ from typing import List
14
+
15
+ from esmf_aspect_meta_model_python.base.event import Event
16
+ from esmf_aspect_meta_model_python.base.operation import Operation
17
+ from esmf_aspect_meta_model_python.base.structure_element import StructureElement
18
+
19
+
20
+ class Aspect(StructureElement, ABC):
21
+ """Aspect interface class.
22
+
23
+ An aspect is the root class for a digital twin.
24
+ It has a number of properties and operations.
25
+ An Aspect Model is described in RDF Turtle.
26
+ """
27
+
28
+ @property
29
+ @abstractmethod
30
+ def operations(self) -> List[Operation]:
31
+ """Operations."""
32
+
33
+ @property
34
+ @abstractmethod
35
+ def events(self) -> List[Event]:
36
+ """Events."""
37
+
38
+ @property
39
+ def is_collection_aspect(self) -> bool:
40
+ """Is collection aspect flag."""
41
+ return False
@@ -0,0 +1,36 @@
1
+ # Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH
2
+ #
3
+ # See the AUTHORS file(s) distributed with this work for additional
4
+ # information regarding authorship.
5
+ #
6
+ # This Source Code Form is subject to the terms of the Mozilla Public
7
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
8
+ # file, You can obtain one at https://mozilla.org/MPL/2.0/.
9
+ #
10
+ # SPDX-License-Identifier: MPL-2.0
11
+
12
+ from abc import ABC, abstractmethod
13
+ from typing import Optional
14
+
15
+ from esmf_aspect_meta_model_python.base.is_described import IsDescribed
16
+
17
+
18
+ class Base(IsDescribed, ABC):
19
+ """Base interface class.
20
+
21
+ Superclass from which all elements in the Meta Model inherit.
22
+ """
23
+
24
+ @property
25
+ @abstractmethod
26
+ def parent_elements(self) -> Optional[list["Base"]]:
27
+ """Parent elements."""
28
+
29
+ @parent_elements.setter
30
+ @abstractmethod
31
+ def parent_elements(self, elements: list["Base"]) -> None:
32
+ """Parent elements setter."""
33
+
34
+ @abstractmethod
35
+ def append_parent_element(self, element: "Base") -> None:
36
+ """Add parent element."""
@@ -0,0 +1,27 @@
1
+ # Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH
2
+ #
3
+ # See the AUTHORS file(s) distributed with this work for additional
4
+ # information regarding authorship.
5
+ #
6
+ # This Source Code Form is subject to the terms of the Mozilla Public
7
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
8
+ # file, You can obtain one at https://mozilla.org/MPL/2.0/.
9
+ #
10
+ # SPDX-License-Identifier: MPL-2.0
11
+
12
+ import enum
13
+
14
+
15
+ @enum.unique
16
+ class BoundDefinition(enum.Enum):
17
+ """Bound Definition class.
18
+
19
+ Enumeration that holds the specifies the upper or lower boundary rule for a range constraint.
20
+ Possible values are: OPEN, AT_LEAST, GREATER_THAN, LESS_THAN, AT_MOST
21
+ """
22
+
23
+ OPEN = "OPEN"
24
+ AT_LEAST = "AT_LEAST"
25
+ GREATER_THAN = "GREATER_THAN"
26
+ LESS_THAN = "LESS_THAN"
27
+ AT_MOST = "AT_MOST"
@@ -0,0 +1,66 @@
1
+ # Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH
2
+ #
3
+ # See the AUTHORS file(s) distributed with this work for additional
4
+ # information regarding authorship.
5
+ #
6
+ # This Source Code Form is subject to the terms of the Mozilla Public
7
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
8
+ # file, You can obtain one at https://mozilla.org/MPL/2.0/.
9
+ #
10
+ # SPDX-License-Identifier: MPL-2.0
11
+
12
+ from abc import ABC, abstractmethod
13
+
14
+ from esmf_aspect_meta_model_python.base.base import Base
15
+
16
+
17
+ class CacheStrategy(ABC):
18
+ """Cache Strategy interface class."""
19
+
20
+ @abstractmethod
21
+ def reset(self) -> None:
22
+ """Reset all cached elements."""
23
+
24
+ @abstractmethod
25
+ def get(self, key: str) -> Base | None:
26
+ """Gets a Base, and returns the element or undefined.
27
+
28
+ Args:
29
+ key (str): key key of the element.
30
+
31
+ Returns:
32
+ Base | None: Element or undefined if it does not exist.
33
+ """
34
+
35
+ @abstractmethod
36
+ def get_by_name(self, name: str) -> list[Base]:
37
+ """Get element by name.
38
+
39
+ Args:
40
+ name (str): name of the element.
41
+
42
+ Returns:
43
+ list[Base]: the found elements or an empty list.
44
+ """
45
+
46
+ @abstractmethod
47
+ def resolve_instance(self, model_element: Base) -> Base:
48
+ """Resolve cached element instance or add the given element to the cache.
49
+
50
+ Args:
51
+ model_element (Base): modelElement element instance to resolve
52
+
53
+ Returns:
54
+ Base: cached element instance.
55
+ """
56
+
57
+ @abstractmethod
58
+ def add_element(self, name: str, model_element: Base, overwrite: bool = False) -> None:
59
+ """Add element explicitly to the cache.
60
+
61
+ Args:
62
+ name (str): name of the element
63
+ model_element (Base): element instance to resolve
64
+ overwrite (_type_, optional): force to overwrite it if an element with the
65
+ name already exists. Defaults to False:bool.
66
+ """
@@ -0,0 +1,10 @@
1
+ # Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH
2
+ #
3
+ # See the AUTHORS file(s) distributed with this work for additional
4
+ # information regarding authorship.
5
+ #
6
+ # This Source Code Form is subject to the terms of the Mozilla Public
7
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
8
+ # file, You can obtain one at https://mozilla.org/MPL/2.0/.
9
+ #
10
+ # SPDX-License-Identifier: MPL-2.0
@@ -0,0 +1,29 @@
1
+ # Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH
2
+ #
3
+ # See the AUTHORS file(s) distributed with this work for additional
4
+ # information regarding authorship.
5
+ #
6
+ # This Source Code Form is subject to the terms of the Mozilla Public
7
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
8
+ # file, You can obtain one at https://mozilla.org/MPL/2.0/.
9
+ #
10
+ # SPDX-License-Identifier: MPL-2.0
11
+
12
+ from abc import ABC, abstractmethod
13
+
14
+ from esmf_aspect_meta_model_python.base.base import Base
15
+ from esmf_aspect_meta_model_python.base.data_types.data_type import DataType
16
+
17
+
18
+ class Characteristic(Base, ABC):
19
+ """Characteristic interface class.
20
+
21
+ Specifies a property by describing its data type.
22
+ Multiple classes inherit from Characteristic which describe the property in a more specific way
23
+ (e.g. Enumeration or Collection).
24
+ """
25
+
26
+ @property
27
+ @abstractmethod
28
+ def data_type(self) -> DataType:
29
+ """Data type."""
@@ -0,0 +1,21 @@
1
+ # Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH
2
+ #
3
+ # See the AUTHORS file(s) distributed with this work for additional
4
+ # information regarding authorship.
5
+ #
6
+ # This Source Code Form is subject to the terms of the Mozilla Public
7
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
8
+ # file, You can obtain one at https://mozilla.org/MPL/2.0/.
9
+ #
10
+ # SPDX-License-Identifier: MPL-2.0
11
+
12
+ from abc import ABC
13
+
14
+ from esmf_aspect_meta_model_python.base.characteristics.characteristic import Characteristic
15
+
16
+
17
+ class Code(Characteristic, ABC):
18
+ """Code interface class.
19
+
20
+ Describes a Property which contains any kind of code.
21
+ """
@@ -0,0 +1,10 @@
1
+ # Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH
2
+ #
3
+ # See the AUTHORS file(s) distributed with this work for additional
4
+ # information regarding authorship.
5
+ #
6
+ # This Source Code Form is subject to the terms of the Mozilla Public
7
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
8
+ # file, You can obtain one at https://mozilla.org/MPL/2.0/.
9
+ #
10
+ # SPDX-License-Identifier: MPL-2.0
@@ -0,0 +1,29 @@
1
+ # Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH
2
+ #
3
+ # See the AUTHORS file(s) distributed with this work for additional
4
+ # information regarding authorship.
5
+ #
6
+ # This Source Code Form is subject to the terms of the Mozilla Public
7
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
8
+ # file, You can obtain one at https://mozilla.org/MPL/2.0/.
9
+ #
10
+ # SPDX-License-Identifier: MPL-2.0
11
+
12
+ from abc import ABC, abstractmethod
13
+ from typing import Optional
14
+
15
+ from esmf_aspect_meta_model_python.base.characteristics.characteristic import Characteristic
16
+
17
+
18
+ class Collection(Characteristic, ABC):
19
+ """Collection interface class.
20
+
21
+ Describes a property that has a group of values of the same type.
22
+ It can have a reference to another characteristic which describes an actual value of the collection.
23
+ The values are not ordered and may include duplicates.
24
+ """
25
+
26
+ @property
27
+ @abstractmethod
28
+ def element_characteristic(self) -> Optional[Characteristic]:
29
+ """Element characteristic."""
@@ -0,0 +1,21 @@
1
+ # Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH
2
+ #
3
+ # See the AUTHORS file(s) distributed with this work for additional
4
+ # information regarding authorship.
5
+ #
6
+ # This Source Code Form is subject to the terms of the Mozilla Public
7
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
8
+ # file, You can obtain one at https://mozilla.org/MPL/2.0/.
9
+ #
10
+ # SPDX-License-Identifier: MPL-2.0
11
+
12
+ from abc import ABC
13
+
14
+ from esmf_aspect_meta_model_python.base.characteristics.collection.collection import Collection
15
+
16
+
17
+ class List(Collection, ABC):
18
+ """List interface class.
19
+
20
+ Collection with ordered elements and allowed duplicates.
21
+ """
@@ -0,0 +1,21 @@
1
+ # Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH
2
+ #
3
+ # See the AUTHORS file(s) distributed with this work for additional
4
+ # information regarding authorship.
5
+ #
6
+ # This Source Code Form is subject to the terms of the Mozilla Public
7
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
8
+ # file, You can obtain one at https://mozilla.org/MPL/2.0/.
9
+ #
10
+ # SPDX-License-Identifier: MPL-2.0
11
+
12
+ from abc import ABC
13
+
14
+ from esmf_aspect_meta_model_python.base.characteristics.collection.collection import Collection
15
+
16
+
17
+ class Set(Collection, ABC):
18
+ """Set interface class.
19
+
20
+ Collection with unordered elements and without duplicates.
21
+ """
@@ -0,0 +1,21 @@
1
+ # Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH
2
+ #
3
+ # See the AUTHORS file(s) distributed with this work for additional
4
+ # information regarding authorship.
5
+ #
6
+ # This Source Code Form is subject to the terms of the Mozilla Public
7
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
8
+ # file, You can obtain one at https://mozilla.org/MPL/2.0/.
9
+ #
10
+ # SPDX-License-Identifier: MPL-2.0
11
+
12
+ from abc import ABC
13
+
14
+ from esmf_aspect_meta_model_python.base.characteristics.collection.collection import Collection
15
+
16
+
17
+ class SortedSet(Collection, ABC):
18
+ """Sorted Set interface class.
19
+
20
+ Collection with ordered elements and without duplicates.
21
+ """
@@ -0,0 +1,21 @@
1
+ # Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH
2
+ #
3
+ # See the AUTHORS file(s) distributed with this work for additional
4
+ # information regarding authorship.
5
+ #
6
+ # This Source Code Form is subject to the terms of the Mozilla Public
7
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
8
+ # file, You can obtain one at https://mozilla.org/MPL/2.0/.
9
+ #
10
+ # SPDX-License-Identifier: MPL-2.0
11
+
12
+ from abc import ABC
13
+
14
+ from esmf_aspect_meta_model_python.base.characteristics.collection.sorted_set import SortedSet
15
+
16
+
17
+ class TimeSeries(SortedSet, ABC):
18
+ """Time Series interface class.
19
+
20
+ Sorted Set that has tuples of timestamps and values.
21
+ """
@@ -0,0 +1,31 @@
1
+ # Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH
2
+ #
3
+ # See the AUTHORS file(s) distributed with this work for additional
4
+ # information regarding authorship.
5
+ #
6
+ # This Source Code Form is subject to the terms of the Mozilla Public
7
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
8
+ # file, You can obtain one at https://mozilla.org/MPL/2.0/.
9
+ #
10
+ # SPDX-License-Identifier: MPL-2.0
11
+
12
+ from abc import ABC, abstractmethod
13
+
14
+ from esmf_aspect_meta_model_python.base.characteristics.characteristic import Characteristic
15
+
16
+
17
+ class Either(Characteristic, ABC):
18
+ """Either interface class.
19
+
20
+ Describes a property that has exactly one of two possible values.
21
+ """
22
+
23
+ @property
24
+ @abstractmethod
25
+ def left(self) -> Characteristic:
26
+ """Left."""
27
+
28
+ @property
29
+ @abstractmethod
30
+ def right(self) -> Characteristic:
31
+ """Right."""
@@ -0,0 +1,27 @@
1
+ # Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH
2
+ #
3
+ # See the AUTHORS file(s) distributed with this work for additional
4
+ # information regarding authorship.
5
+ #
6
+ # This Source Code Form is subject to the terms of the Mozilla Public
7
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
8
+ # file, You can obtain one at https://mozilla.org/MPL/2.0/.
9
+ #
10
+ # SPDX-License-Identifier: MPL-2.0
11
+
12
+ from abc import ABC, abstractmethod
13
+ from typing import List
14
+
15
+ from esmf_aspect_meta_model_python.base.characteristics.characteristic import Characteristic
16
+
17
+
18
+ class Enumeration(Characteristic, ABC):
19
+ """Enumeration interface class.
20
+
21
+ Describes a Property that has exactly one of multiple possible values.
22
+ """
23
+
24
+ @property
25
+ @abstractmethod
26
+ def values(self) -> List:
27
+ """Values."""
@@ -0,0 +1,10 @@
1
+ # Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH
2
+ #
3
+ # See the AUTHORS file(s) distributed with this work for additional
4
+ # information regarding authorship.
5
+ #
6
+ # This Source Code Form is subject to the terms of the Mozilla Public
7
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
8
+ # file, You can obtain one at https://mozilla.org/MPL/2.0/.
9
+ #
10
+ # SPDX-License-Identifier: MPL-2.0
@@ -0,0 +1,21 @@
1
+ # Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH
2
+ #
3
+ # See the AUTHORS file(s) distributed with this work for additional
4
+ # information regarding authorship.
5
+ #
6
+ # This Source Code Form is subject to the terms of the Mozilla Public
7
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
8
+ # file, You can obtain one at https://mozilla.org/MPL/2.0/.
9
+ #
10
+ # SPDX-License-Identifier: MPL-2.0
11
+
12
+ from abc import ABC
13
+
14
+ from esmf_aspect_meta_model_python.base.characteristics.quantifiable.quantifiable import Quantifiable
15
+
16
+
17
+ class Duration(Quantifiable, ABC):
18
+ """Duration interface class.
19
+
20
+ Quantifiable where the unit quantifies time.
21
+ """
@@ -0,0 +1,21 @@
1
+ # Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH
2
+ #
3
+ # See the AUTHORS file(s) distributed with this work for additional
4
+ # information regarding authorship.
5
+ #
6
+ # This Source Code Form is subject to the terms of the Mozilla Public
7
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
8
+ # file, You can obtain one at https://mozilla.org/MPL/2.0/.
9
+ #
10
+ # SPDX-License-Identifier: MPL-2.0
11
+
12
+ from abc import ABC
13
+
14
+ from esmf_aspect_meta_model_python.base.characteristics.quantifiable.quantifiable import Quantifiable
15
+
16
+
17
+ class Measurement(Quantifiable, ABC):
18
+ """Measurement interface class.
19
+
20
+ Quantifiable where the unit is required.
21
+ """