Skip to content

Commit f9589a7

Browse files
Switch to the SAMM 2.2.0
1 parent 66d0d48 commit f9589a7

File tree

233 files changed

+3955
-2162
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

233 files changed

+3955
-2162
lines changed

.github/workflows/push_request_check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
poetry run download-samm-release
3838
poetry build
3939
40-
- name: run tests
40+
- name: run test*s
4141
run: |
4242
cd core/esmf-aspect-meta-model-python
4343
poetry run tox -e py310

.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/

AUTHORS.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
The following people have contributed to this repository:
44

5-
* [Hanna Shalamitskaya](mailto:[email protected])
6-
* [Andreas Textor](mailto:[email protected])
7-
* [Georg Schmidt-Dumont](mailto:[email protected])
8-
* [Michele Santoro](mailto:[email protected])
5+
* [Hanna Shalamitskaya](https://github.com/Hanna-Shalamitskaya-EPAM), [email protected]
6+
* [Andreas Textor](https://github.com/atextor), Robert Bosch GmbH, [email protected]
7+
* Georg Schmidt-Dumont, Robert Bosch GmbH, [email protected]
8+
* [Michele Santoro](https://github.com/michelu89), Robert Bosch GmbH, [email protected]
99
* Nico Makowe
1010
* Aghyad Farrouh
1111

CONTRIBUTING.md

Lines changed: 97 additions & 121 deletions
Large diffs are not rendered by default.

CONVENTIONS.md

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,40 @@ The following document contains a compilation of conventions and guidelines to f
44
structure and write code for the ESMF SDK PY Aspect Model Loader.
55

66
## General Conventions
7-
Our code conventions are based on the [Google Python Style Guide](https://google.github.io/styleguide/pyguide.html) but
8-
detailed and adjusted for the needs of the ESMF SDK py Aspect Model Loader.
7+
8+
Our code conventions are based on the [Google Python Style Guide](https://google.github.io/styleguide/pyguide.html),
9+
but detailed and adjusted for the needs of the ESMF SDK PY Aspect Model Loader.
910

1011
## Copyright header
1112
See [CONTRIBUTING](CONTRIBUTING.md)
13+
14+
## Code Recommendations
15+
16+
The code for this project follows the guidelines of [PEP 8](https://peps.python.org/pep-0008/).
17+
The libraries black, flake8 and isort are also used so that the code can be checked for compliance with the PEP 8 style.
18+
19+
## Documentation
20+
21+
### Developer Documentation
22+
Developer documentation is put into a README.md placed in the project root. This should contain documentation like:
23+
* Checking out the source code and getting it to run/build
24+
* Mandatory (external system) dependencies and how to set them up (e.g. databases)
25+
* Configuration options and how to apply them
26+
* General important concepts that are relevant to working on the project but are not directly obvious from the source code
27+
itself. Links to further readings and information, e.g. wiki or other external sources.
28+
29+
### User documentation
30+
31+
User documentation (this includes technical documentation on how to use an application or tool from the
32+
ESMF SDK PY Aspect Model Loader Code Conventions) should be on its own.
33+
34+
It is written in AsciiDoc, rendered with [Antora](https://antora.org) and the generated static content is
35+
publicly hosted for direct user access.
36+
The source files of the documentation are placed in a subfolder /documentation from the project root.
37+
Documentation is structured so that it can be processed by Antora. This e.g. involves structuring the documentation files
38+
according to [Antora's specification](https://docs.antora.org/antora/2.3/organize-content-files/) and organizing resources
39+
so that Antora [can handle them](https://docs.antora.org/antora/2.3/page/resource-id/).
40+
[AsciiDoc's syntax](https://docs.antora.org/antora/2.3/asciidoc/asciidoc/) is pretty close to Markdown, however it is
41+
way more targeted towards writing fully fledged documents and with its multitude of backends (HTML, PDF, ...) it is a
42+
very good source format.
43+
Publishing is realized by means of [GitHub pages](https://docs.antora.org/antora/2.3/publish-to-github-pages/).

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,4 +370,4 @@ Exhibit B - "Incompatible With Secondary Licenses" Notice
370370
---------------------------------------------------------
371371

372372
This Source Code Form is "Incompatible With Secondary Licenses", as
373-
defined by the Mozilla Public License, v. 2.0.
373+
defined by the Mozilla Public License, v. 2.0.

NOTICE.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1+
## Antora
12

3+
This repository contains software developed by the [Antora Project](https://antora.org/).
4+
5+
Your use of Antora is subject to the terms and conditions of the Mozilla Public License 2.0. A copy of the license is contained in the file [LICENSE.txt](/LICENSE.txt) and is also available at https://mozilla.org/MPL/2.0/.
6+
7+
The source code is available from [GitLab](https://gitlab.com/antora).

README.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,28 +22,26 @@
2222
## Introduction
2323

2424
The ESMF SDK Python Aspect Model Loader contains artifacts and resources for all parties that intent to use, extend or
25-
integrate with the Semantic Aspect Meta Model, e.g., Solution Developers,
26-
Domain Experts or OEMs.
25+
integrate with the Semantic Aspect Meta Model, e.g., Solution Developers, Domain Experts or OEMs.
2726

2827
At its core are components which help to work with the Semantic Aspect Meta Model (SAMM).
2928

30-
This repository contains a detailed developer documentation written in AsciiDoc. The source files (AsciiDoc) are
31-
located [here](documentation/python-sdk-guide)
32-
and are built using
33-
[Antora](https://antora.org/) which generates the documentation as HTML files.
29+
This repository contains a detailed developer documentation written in AsciiDoc. The source files (AsciiDoc) are
30+
[python-sdk-guide](documentation/python-sdk-guide) and are built using [Antora](https://antora.org/)
31+
which generates the documentation as HTML files.
3432

3533
## Getting help
3634

37-
Are you having trouble with ESMF SDK Python? We want to help!
35+
Are you having trouble with ESMF SDK Python Aspect Model Loader? We want to help!
3836

3937
* Check the [developer documentation](https://eclipse-esmf.github.io)
40-
* Having issues with the ESMF SDK Python? Open
41-
a [GitHub issue](https://github.com/eclipse-esmf/esmf-sdk-py-aspect-model-loader/issues).
38+
* Check the SAMM [specification](https://eclipse-esmf.github.io/samm-specification/snapshot/index.html)
39+
* Having issues with the ESMF SDK Python Aspect Model Loader? Open a [GitHub issue](https://github.com/eclipse-esmf/esmf-sdk-py-aspect-model-loader/issues).
4240

4341
## Getting Started
4442

4543
This document provides an overall overview of the SDK and the concepts applied throughout it. Detailed documentation and
46-
concepts for each component can be found in the respective subfolders or subrepositories.
44+
concepts for each component can be found in the respective subfolders or sub-repositories.
4745

4846
## SDK Structure
4947

@@ -55,7 +53,6 @@ esmf-sdk-py-aspect-model-loader
5553
├─── core # e.g. meta model implementation etc.
5654
│ ├─── esmf-aspect-meta-model-python
5755
│ ├─── ...
58-
└─── samples # sample projects to get you started quickly
5956
```
6057

6158
## Python Core Components
@@ -73,7 +70,8 @@ generated source code artifacts. Any form of source code generator will use the
7370

7471
## Version Handling
7572

76-
The aspect meta model loader work with the SAMM versions specified in the [download_samm_release.py](core/esmf-aspect-meta-model-python/esmf_aspect_meta_model_python//samm_aspect_meta_model/download_samm_release.py). This version will be used for deployment.
73+
The aspect meta model loader work with the SAMM versions specified in the [download_samm_release.py](core/esmf-aspect-meta-model-python/esmf_aspect_meta_model_python//samm_aspect_meta_model/download_samm_release.py).
74+
This version will be used for deployment.
7775

7876
As SAMM evolves over time, the Aspect Meta Model Loader should also adapt and evolve accordingly.
7977
Due to this fact it is important to understand the versioning concept that is applied to the SAMM,

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

Lines changed: 40 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,18 @@
11
The Aspect Model Loader as part of the Python SDK provided by the [*Eclipse Semantic Modeling Framework*](
22
https://projects.eclipse.org/projects/dt.esmf).
33

4-
<!-- TOC -->
5-
* [An Aspect of the Meta Model](#an-aspect-of-the-meta-model)
6-
* [Set Up SAMM Aspect Meta Model](#set-up-samm-aspect-meta-model)
7-
* [Install poetry](#install-poetry)
8-
* [Install project dependencies](#install-project-dependencies)
9-
* [Download SAMM files](#download-samm-files)
10-
* [Download SAMM release](#download-samm-release)
11-
* [Download SAMM branch](#download-samm-branch)
12-
* [Aspect Meta Model Loader usage](#aspect-meta-model-loader-usage)
13-
* [Samm Units](#samm-units)
14-
* [SAMM CLI wrapper class](#samm-cli-wrapper-class)
15-
* [Scripts](#scripts)
16-
* [Automation Tasks](#automation-tasks)
17-
* [tox](#tox)
18-
* [GitHub actions](#github-actions)
19-
* [Check New Pull Request](#check-new-pull-request)
20-
* [Build release](#build-release)
21-
<!-- TOC -->
22-
234
# An Aspect of the Meta Model
245

256
The `esmf-aspect-model-loader` package provides the Python implementation for the SAMM Aspect Meta Model, or SAMM.
267
Each Meta Model element and each Characteristic class is represented by an interface with a corresponding
278
implementation.
289

10+
## Documentation
11+
12+
* Check the [developer documentation](https://eclipse-esmf.github.io)
13+
* Check the SAMM [specification](https://eclipse-esmf.github.io/samm-specification/snapshot/index.html)
14+
* Having issues with the ESMF SDK Python Aspect Model Loader? Open a [GitHub issue](https://github.com/eclipse-esmf/esmf-sdk-py-aspect-model-loader/issues).
15+
2916
## Set Up SAMM Aspect Meta Model
3017

3118
Before getting started to use the `esmf-aspect-model-loader` library you need to apply some set up actions:
@@ -34,9 +21,6 @@ Required
3421
- [Install poetry](#install-poetry)
3522
- [Install project dependencies](#install-project-dependencies)
3623
- [Download SAMM files](#download-samm-files)
37-
Optional
38-
- [Download SAMM CLI](#download-samm-cli) (needed to use SAMM CLI functions)
39-
- [Download SAMM test models](#download-test-models) (for running integration tests)
4024

4125
### Install poetry
4226

@@ -87,22 +71,42 @@ poetry run download-samm-branch
8771
```
8872
Link to all branches: [SAMM Releases](https://github.com/eclipse-esmf/esmf-semantic-aspect-meta-model/branches)
8973

90-
## Aspect Meta Model Loader usage
74+
## SAMM Aspect Model Graph usage
75+
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:
78+
```python
79+
from esmf_aspect_meta_model_python import SAMMGraph
80+
81+
# Define the path to your Turtle file
82+
model_path = "absolute/path/to/turtle.ttl"
83+
84+
# Create an instance of SAMMGraph
85+
samm_graph = SAMMGraph()
86+
87+
# Parse the Turtle file to load the graph
88+
samm_graph.parse(model_path)
9189

92-
An Aspect of the Meta Model can be loaded as follows:
90+
# Load the aspect model from the graph
91+
aspect = samm_graph.load_aspect_model()
92+
```
93+
94+
The `load_model_elements` method in the SAMMGraph class creates Python objects to represent all nodes from the Aspect
95+
model graph. It retrieves all SAMM elements from the RDF graph and converts them into structured Python objects.
9396
```python
94-
from esmf_aspect_meta_model_python import AspectLoader
97+
from esmf_aspect_meta_model_python import SAMMGraph
9598

96-
loader = AspectLoader()
97-
model_elements = loader.load_aspect_model("absolute/path/to/turtle.ttl")
98-
aspect = model_elements[0]
99+
# Define the path to your Turtle file
100+
model_path = "absolute/path/to/turtle.ttl"
99101

100-
# or you can provide an Aspect URN
102+
# Create an instance of SAMMGraph
103+
samm_graph = SAMMGraph()
101104

102-
loader = AspectLoader()
103-
aspect_urn = "urn:samm:org.eclipse.esmf.samm:aspect.model:0.0.1#AspectName"
104-
model_elements = loader.load_aspect_model("absolute/path/to/turtle.ttl", aspect_urn)
105-
aspect = model_elements[0]
105+
# Parse the Turtle file to load the graph
106+
samm_graph.parse(model_path)
107+
108+
# Load all model elements from the graph
109+
model_elements = samm_graph.load_model_elements()
106110
```
107111

108112
## Samm Units
@@ -112,7 +116,7 @@ SAMMUnitsGraph is a class contains functions for accessing units of measurement.
112116
from esmf_aspect_meta_model_python.samm_meta_model import units
113117

114118
unit_name = "unit:volt"
115-
units.print_description(units.get_info(unit_name))
119+
units.print_info(units.get_info(unit_name))
116120
# preferredName: volt
117121
# commonCode: VLT
118122
# ...
@@ -122,7 +126,7 @@ units.print_description(units.get_info(unit_name))
122126
volt_info = units.get_info("unit:volt")
123127
# {'preferredName': rdflib.term.Literal('volt', lang='en'), 'commonCode': rdflib.term.Literal('VLT'), ... }
124128

125-
units.print_description(volt_info)
129+
units.print_info(volt_info)
126130
# preferredName: volt
127131
# commonCode: VLT
128132
# ...
@@ -169,7 +173,7 @@ Provided scripts:
169173
All scripts run like a poetry command. The poetry is available from the folder where [pyproject.toml](pyproject.toml)
170174
is located.
171175

172-
# Automation Tasks
176+
# Tests running
173177
## tox
174178

175179
`tox` is used for the tests automation purpose. There are two environments with different purposes and tests can
@@ -187,19 +191,3 @@ poetry run tox -e pep8
187191
# run tests
188192
poetry run tox -e py310
189193
```
190-
191-
## GitHub actions
192-
193-
There are two actions on the GitHub repo:
194-
- [Check New Pull Request](../../.github/workflows/push_request_check.yml)
195-
- [Build release](../../.github/workflows/tagged_release.yml)
196-
197-
### Check New Pull Request
198-
This action run after creation or updating a pull request and run all automation tests with tox command.
199-
200-
### Build release
201-
Prepare and publish a new release for the `esmf-aspect-model-loader` to the PyPi:
202-
[esmf-aspect-model-loader](https://pypi.org/project/esmf-aspect-model-loader/.)
203-
204-
A list of the available releases on the GitHub:
205-
[Releases](https://github.com/eclipse-esmf/esmf-sdk-py-aspect-model-loader/releases).

core/esmf-aspect-meta-model-python/esmf_aspect_meta_model_python/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,5 +85,5 @@
8585
DefaultTrait,
8686
DefaultUnit,
8787
)
88-
from .loader.aspect_loader import AspectLoader
8988
from .loader.samm_graph import SAMMGraph
89+
from .resolver.handler import InputHandler

0 commit comments

Comments
 (0)