Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ dmypy.json
# SAMM
core/esmf-aspect-meta-model-python/esmf_aspect_meta_model_python/samm_aspect_meta_model/samm/
/core/esmf-aspect-meta-model-python/samm-cli/
/core/esmf-aspect-meta-model-python/tests/integration/java_models/resources/
/core/esmf-aspect-meta-model-python/tests/integration/aspect_model_loader/java_models/resources/
1 change: 1 addition & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
The following people have contributed to this repository:

* [Hanna Shalamitskaya](https://github.com/Hanna-Shalamitskaya-EPAM), external.Hanna.Shalamitskaya@de.bosch.com
* [Oleksandr Muzyka](https://github.com/o-muzyka), external.Oleksandr.Muzyka@bosch.com
* [Andreas Textor](https://github.com/atextor), Robert Bosch GmbH, andreas.textor@de.bosch.com
* Georg Schmidt-Dumont, Robert Bosch GmbH, georg.schmidt-dumont@de.bosch.com
* [Michele Santoro](https://github.com/michelu89), Robert Bosch GmbH, michele.santoro@de.bosch.com
Expand Down
15 changes: 14 additions & 1 deletion core/esmf-aspect-meta-model-python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ Python Aspect Model Loader provide a wrapper class to be able to call SAMM CLI f
For instance, validation of a model can be done with the following code snippet:

```python
from esmf_aspect_meta_model_python.samm_cli_functions import SammCli
from esmf_aspect_meta_model_python.samm_cli import SammCli

samm_cli = SammCli()
model_path = "Paht_to_the_model/Model.ttl"
Expand All @@ -154,12 +154,25 @@ samm_cli.validate(model_path)

List of SAMMCLI functions:
- validate
- prettyprint
- usage
- to_openapi
- to_schema
- to_json
- to_html
- to_png
- to_svg
- to_java
- to_asyncapi
- to_jsonld
- to_sql
- to_aas
- edit_move
- edit_newversion
- aas_to_aspect
- aas_list
- package_import
- package_export

# Scripts

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .base import SammCli

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH
#
# See the AUTHORS file(s) distributed with this work for additional
# information regarding authorship.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
#
# SPDX-License-Identifier: MPL-2.0
"""Constants for SAMM CLI commands and types."""


class SAMMCLICommands:
"""SAMM CLI command names."""

VALIDATE = "validate"
TO_OPENAPI = "to openapi"
TO_SCHEMA = "to schema"
TO_JSON = "to json"
TO_HTML = "to html"
TO_PNG = "to png"
TO_SVG = "to svg"
PRETTYPRINT = "prettyprint"
TO_JAVA = "to java"
TO_ASYNCAPI = "to asyncapi"
TO_JSONLD = "to jsonld"
TO_SQL = "to sql"
TO_AAS = "to aas"
EDIT_MOVE = "edit move"
EDIT_NEWVERSION = "edit newversion"
USAGE = "usage"
AAS_TO_ASPECT = "to aspect"
AAS_LIST = "list"
PACKAGE_IMPORT = "import"
PACKAGE_EXPORT = "export"


class SAMMCLICommandTypes:
"""SAMM CLI command types."""

ASPECT = "aspect"
AAS = "aas"
PACKAGE = "package"

This file was deleted.

2 changes: 1 addition & 1 deletion core/esmf-aspect-meta-model-python/scripts/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ class TestModelConstants:
"esmf-test-aspect-models-$version_number.jar"
)
SAMM_VERSION = SAMM_VERSION
TEST_MODELS_PATH = join("tests", "integration", "java_models", "resources")
TEST_MODELS_PATH = join("tests", "integration", "aspect_model_loader", "java_models", "resources")
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

def get_resources_folder_path() -> str:
"""Get a path for storing test models."""
base_path = Path(__file__).parents[3].absolute()
base_path = Path(__file__).parents[4].absolute()
models_path = join(base_path, TestModelConstants.TEST_MODELS_PATH)

return models_path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

from esmf_aspect_meta_model_python import BaseImpl, SAMMGraph

RESOURCE_PATH = getcwd() / Path("tests/integration/resources/org.eclipse.esmf.test.general/2.1.0")
RESOURCE_PATH = getcwd() / Path("tests/integration/aspect_model_loader/resources/org.eclipse.esmf.test.general/2.1.0")


def test_get_access_path():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
StructuredValue,
)

RESOURCE_PATH = getcwd() / Path("tests/integration/resources/org.eclipse.esmf.test.characteristics/2.1.0")
RESOURCE_PATH = getcwd() / Path(
"tests/integration/aspect_model_loader/resources/org.eclipse.esmf.test.characteristics/2.1.0"
)


def test_loading_aspect_with_collection():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
Trait,
)

RESOURCE_PATH = getcwd() / Path("tests/integration/resources/org.eclipse.esmf.test.constraints/2.1.0")
RESOURCE_PATH = getcwd() / Path(
"tests/integration/aspect_model_loader/resources/org.eclipse.esmf.test.constraints/2.1.0"
)


def test_loading_aspect_with_constrained_collection():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

from esmf_aspect_meta_model_python import AbstractEntity, ComplexType, Enumeration, Quantifiable, SAMMGraph

RESOURCE_PATH = getcwd() / Path("tests/integration/resources/org.eclipse.esmf.test.entity/2.1.0")
RESOURCE_PATH = getcwd() / Path("tests/integration/aspect_model_loader/resources/org.eclipse.esmf.test.entity/2.1.0")


def test_loading_aspect_with_entity_enum():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

from esmf_aspect_meta_model_python import Event, SAMMGraph

RESOURCE_PATH = getcwd() / Path("tests/integration/resources/org.eclipse.esmf.test.event/2.1.0")
RESOURCE_PATH = getcwd() / Path("tests/integration/aspect_model_loader/resources/org.eclipse.esmf.test.event/2.1.0")


def test_loading_aspect_with_event() -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

from esmf_aspect_meta_model_python import BaseImpl, ComplexType, Either, SAMMGraph

RESOURCE_PATH = getcwd() / Path("tests/integration/resources/org.eclipse.esmf.test.general/2.1.0")
RESOURCE_PATH = getcwd() / Path("tests/integration/aspect_model_loader/resources/org.eclipse.esmf.test.general/2.1.0")


def test_aspect_with_multiple_attributes():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@

from esmf_aspect_meta_model_python import SAMMGraph

RESOURCE_PATH = getcwd() / Path("tests/integration/resources/org.eclipse.esmf.test.general_with_references/2.1.0")
RESOURCE_PATH = getcwd() / Path(
"tests/integration/aspect_model_loader/resources/org.eclipse.esmf.test.general_with_references/2.1.0"
)


def test_resolve_elements_references():
Expand Down
Loading