Skip to content

Commit dc0c2db

Browse files
committed
Resolve change requests
1 parent e6bb57c commit dc0c2db

31 files changed

Lines changed: 272 additions & 258 deletions

compliance_tool/aas_compliance_tool/compliance_check_aasx.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2025 the Eclipse BaSyx Authors
1+
# Copyright (c) 2026 the Eclipse BaSyx Authors
22
#
33
# This program and the accompanying materials are made available under the terms of the MIT License, available in
44
# the LICENSE file of this project.

compliance_tool/aas_compliance_tool/compliance_check_json.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2025 the Eclipse BaSyx Authors
1+
# Copyright (c) 2026 the Eclipse BaSyx Authors
22
#
33
# This program and the accompanying materials are made available under the terms of the MIT License, available in
44
# the LICENSE file of this project.
@@ -112,7 +112,7 @@ def check_deserialization(file_path: str, state_manager: ComplianceToolStateMana
112112
:param file_path: Given file which should be deserialized
113113
:param state_manager: :class:`~basyx.aas.compliance_tool.state_manager.ComplianceToolStateManager` to log the steps
114114
:param file_info: Additional information about the file for name of the steps
115-
:return: The deserialized :class:`~basyx.aas.model.provider.DictObjectStore`
115+
:return: The deserialized :class:`~basyx.aas.model.provider.DictIdentifiableStore`
116116
"""
117117
logger = logging.getLogger('compliance_check')
118118
logger.addHandler(state_manager)

compliance_tool/test/test_aas_compliance_tool.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2025 the Eclipse BaSyx Authors
1+
# Copyright (c) 2026 the Eclipse BaSyx Authors
22
#
33
# This program and the accompanying materials are made available under the terms of the MIT License, available in
44
# the LICENSE file of this project.
@@ -138,10 +138,10 @@ def test_json_create_example(self) -> None:
138138
self.assertIn('SUCCESS: Write data to file', str(output.stdout))
139139

140140
with open(filename, "r", encoding='utf-8-sig') as f:
141-
json_object_store = read_aas_json_file(f, failsafe=False)
141+
json_identifiable_store = read_aas_json_file(f, failsafe=False)
142142
data = create_example()
143143
checker = AASDataChecker(raise_immediately=True)
144-
checker.check_identifiable_store(json_object_store, data)
144+
checker.check_identifiable_store(json_identifiable_store, data)
145145
os.unlink(filename)
146146

147147
def test_json_deserialization(self) -> None:
@@ -184,10 +184,10 @@ def test_xml_create_example(self) -> None:
184184
self.assertIn('SUCCESS: Write data to file', str(output.stdout))
185185

186186
with open(filename, "rb") as f:
187-
xml_object_store = read_aas_xml_file(f, failsafe=False)
187+
xml_identifiable_store = read_aas_xml_file(f, failsafe=False)
188188
data = create_example()
189189
checker = AASDataChecker(raise_immediately=True)
190-
checker.check_identifiable_store(xml_object_store, data)
190+
checker.check_identifiable_store(xml_identifiable_store, data)
191191
os.unlink(filename)
192192

193193
def test_xml_deseralization(self) -> None:

sdk/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,10 @@ write_aas_xml_file(file='Simple_Submodel.xml', data=data)
124124
For further examples and tutorials, check out the `basyx.aas.examples`-package. Here is a quick overview:
125125

126126
* [`tutorial_create_simple_aas`](./basyx/aas/examples/tutorial_create_simple_aas.py): Create an Asset Administration Shell, including an Asset object and a Submodel
127-
* [`tutorial_storage`](./basyx/aas/examples/tutorial_storage.py): Manage a larger number of Asset Administration Shells in an ObjectStore and resolve references
127+
* [`tutorial_storage`](./basyx/aas/examples/tutorial_storage.py): Manage a larger number of Asset Administration Shells in an IdentifiableStore and resolve references
128128
* [`tutorial_serialization_deserialization`](./basyx/aas/examples/tutorial_serialization_deserialization.py): Use the JSON and XML serialization/deserialization for single objects or full standard-compliant files
129129
* [`tutorial_aasx`](./basyx/aas/examples/tutorial_aasx.py): Export Asset Administration Shells with related objects and auxiliary files to AASX package files
130-
* [`tutorial_backend_couchdb`](./basyx/aas/examples/tutorial_backend_couchdb.py): Use the *CouchDBObjectStore* to manage and retrieve AAS objects in a CouchDB document database
130+
* [`tutorial_backend_couchdb`](./basyx/aas/examples/tutorial_backend_couchdb.py): Use the *CouchDBIdentifiableStore* to manage and retrieve AAS objects in a CouchDB document database
131131

132132

133133
### Documentation

sdk/basyx/aas/adapter/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@
1818

1919
def load_directory(directory: Union[Path, str]) -> tuple[DictIdentifiableStore, DictSupplementaryFileContainer]:
2020
"""
21-
Create a new :class:`~basyx.aas.model.provider.DictObjectStore` and use it to load Asset Administration Shell and
22-
Submodel files in ``AASX``, ``JSON`` and ``XML`` format from a given directory into memory. Additionally, load all
23-
embedded supplementary files into a new :class:`~basyx.aas.adapter.aasx.DictSupplementaryFileContainer`.
21+
Create a new :class:`~basyx.aas.model.provider.DictIdentifiableStore` and use it to load Asset Administration Shell
22+
and Submodel files in ``AASX``, ``JSON`` and ``XML`` format from a given directory into memory. Additionally, load
23+
all embedded supplementary files into a new :class:`~basyx.aas.adapter.aasx.DictSupplementaryFileContainer`.
2424
2525
:param directory: :class:`~pathlib.Path` or ``str`` pointing to the directory containing all Asset Administration
2626
Shell and Submodel files to load
27-
:return: Tuple consisting of a :class:`~basyx.aas.model.provider.DictObjectStore` and a
27+
:return: Tuple consisting of a :class:`~basyx.aas.model.provider.DictIdentifiableStore` and a
2828
:class:`~basyx.aas.adapter.aasx.DictSupplementaryFileContainer` containing all loaded data
2929
"""
3030

sdk/basyx/aas/adapter/aasx.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2025 the Eclipse BaSyx Authors
1+
# Copyright (c) 2026 the Eclipse BaSyx Authors
22
#
33
# This program and the accompanying materials are made available under the terms of the MIT License, available in
44
# the LICENSE file of this project.
@@ -52,7 +52,7 @@ class AASXReader:
5252
5353
.. code-block:: python
5454
55-
objects = DictObjectStore()
55+
identifiables = DictIdentifiableStore()
5656
files = DictSupplementaryFileContainer()
5757
with AASXReader("filename.aasx") as reader:
5858
meta_data = reader.get_core_properties()
@@ -241,7 +241,7 @@ def _parse_aas_part(self, part_name: str, **kwargs) -> model.DictIdentifiableSto
241241
This method chooses and calls the correct parser.
242242
243243
:param part_name: The OPC part name of the part to be parsed
244-
:return: A DictObjectStore containing the parsed AAS objects
244+
:return: A DictIdentifiableStore containing the parsed AAS objects
245245
"""
246246
content_type = self.reader.get_content_type(part_name)
247247
extension = part_name.split("/")[-1].split(".")[-1]

sdk/basyx/aas/adapter/json/json_deserialization.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2025 the Eclipse BaSyx Authors
1+
# Copyright (c) 2026 the Eclipse BaSyx Authors
22
#
33
# This program and the accompanying materials are made available under the terms of the MIT License, available in
44
# the LICENSE file of this project.
@@ -21,7 +21,7 @@
2121
takes a complete AAS JSON file, reads its contents and stores the objects in the provided
2222
:class:`~basyx.aas.model.provider.AbstractObjectStore`. :meth:`read_aas_json_file` is a wrapper for this function.
2323
Instead of storing the objects in a given :class:`~basyx.aas.model.provider.AbstractObjectStore`,
24-
it returns a :class:`~basyx.aas.model.provider.DictObjectStore` containing parsed objects.
24+
it returns a :class:`~basyx.aas.model.provider.DictIdentifiableStore` containing parsed objects.
2525
2626
The deserialization is performed in a bottom-up approach: The ``object_hook()`` method gets called for every parsed JSON
2727
object (as dict) and checks for existence of the ``modelType`` attribute. If it is present, the ``AAS_CLASS_PARSERS``
@@ -816,12 +816,12 @@ def read_aas_json_file_into(object_store: model.AbstractObjectStore, file: PathO
816816
-> Set[model.Identifier]:
817817
"""
818818
Read an Asset Administration Shell JSON file according to 'Details of the Asset Administration Shell', chapter 5.5
819-
into a given object store.
819+
into a given ObjectStore.
820820
821821
:param object_store: The :class:`ObjectStore <basyx.aas.model.provider.AbstractObjectStore>` in which the
822822
identifiable objects should be stored
823823
:param file: A filename or file-like object to read the JSON-serialized data from
824-
:param replace_existing: Whether to replace existing objects with the same identifier in the object store or not
824+
:param replace_existing: Whether to replace existing objects with the same identifier in the ObjectStore or not
825825
:param ignore_existing: Whether to ignore existing objects (e.g. log a message) or raise an error.
826826
This parameter is ignored if replace_existing is ``True``.
827827
:param failsafe: If ``True``, the document is parsed in a failsafe way: Missing attributes and elements are logged
@@ -901,8 +901,8 @@ def read_aas_json_file_into(object_store: model.AbstractObjectStore, file: PathO
901901
def read_aas_json_file(file: PathOrIO, failsafe: bool = True, **kwargs) -> model.DictIdentifiableStore:
902902
"""
903903
A wrapper of :meth:`~basyx.aas.adapter.json.json_deserialization.read_aas_json_file_into`, that reads all objects
904-
in an empty :class:`~basyx.aas.model.provider.DictObjectStore`. This function supports the same keyword arguments as
905-
:meth:`~basyx.aas.adapter.json.json_deserialization.read_aas_json_file_into`.
904+
in an empty :class:`~basyx.aas.model.provider.DictIdentifiableStore`. This function supports the same keyword
905+
arguments as :meth:`~basyx.aas.adapter.json.json_deserialization.read_aas_json_file_into`.
906906
907907
:param file: A filename or file-like object to read the JSON-serialized data from
908908
:param failsafe: If ``True``, the document is parsed in a failsafe way: Missing attributes and elements are logged
@@ -913,7 +913,7 @@ def read_aas_json_file(file: PathOrIO, failsafe: bool = True, **kwargs) -> model
913913
Errors during construction of the objects
914914
:raises TypeError: **Non-failsafe**: Encountered an element in the wrong list
915915
(e.g. an AssetAdministrationShell in ``submodels``)
916-
:return: A :class:`~basyx.aas.model.provider.DictObjectStore` containing all AAS objects from the JSON file
916+
:return: A :class:`~basyx.aas.model.provider.DictIdentifiableStore` containing all AAS objects from the JSON file
917917
"""
918918
identifiable_store: model.DictIdentifiableStore = model.DictIdentifiableStore()
919919
read_aas_json_file_into(identifiable_store, file, failsafe=failsafe, **kwargs)

sdk/basyx/aas/adapter/json/json_serialization.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2025 the Eclipse BaSyx Authors
1+
# Copyright (c) 2026 the Eclipse BaSyx Authors
22
#
33
# This program and the accompanying materials are made available under the terms of the MIT License, available in
44
# the LICENSE file of this project.
@@ -17,7 +17,7 @@
1717
simple python types for an automatic JSON serialization.
1818
To simplify the usage of this module, the :meth:`write_aas_json_file` and :meth:`object_store_to_json` are provided.
1919
The former is used to serialize a given :class:`~basyx.aas.model.provider.AbstractObjectStore` to a file, while the
20-
latter serializes the object store to a string and returns it.
20+
latter serializes the ObjectStore to a string and returns it.
2121
2222
The serialization is performed in an iterative approach: The :meth:`~.AASToJsonEncoder.default` function gets called for
2323
every object and checks if an object is an BaSyx Python SDK object. In this case, it calls a special function for the

sdk/basyx/aas/adapter/xml/xml_deserialization.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2025 the Eclipse BaSyx Authors
1+
# Copyright (c) 2026 the Eclipse BaSyx Authors
22
#
33
# This program and the accompanying materials are made available under the terms of the MIT License, available in
44
# the LICENSE file of this project.
@@ -15,7 +15,7 @@
1515
- :func:`read_aas_xml_file_into` constructs all elements of an XML document and stores them in a given
1616
:class:`ObjectStore <basyx.aas.model.provider.AbstractObjectStore>`
1717
- :func:`read_aas_xml_file` constructs all elements of an XML document and returns them in a
18-
:class:`~basyx.aas.model.provider.DictObjectStore`
18+
:class:`~basyx.aas.model.provider.DictIdentifiableStore`
1919
2020
These functions take a decoder class as keyword argument, which allows parsing in failsafe (default) or non-failsafe
2121
mode. Parsing stripped elements - used in the HTTP adapter - is also possible. It is also possible to subclass the
@@ -1512,7 +1512,7 @@ def read_aas_xml_file(file: PathOrIO, failsafe: bool = True, **kwargs: Any)\
15121512
-> model.DictIdentifiableStore:
15131513
"""
15141514
A wrapper of :meth:`~basyx.aas.adapter.xml.xml_deserialization.read_aas_xml_file_into`, that reads all objects in an
1515-
empty :class:`~basyx.aas.model.provider.DictObjectStore`. This function supports
1515+
empty :class:`~basyx.aas.model.provider.DictIdentifiableStore`. This function supports
15161516
the same keyword arguments as :meth:`~basyx.aas.adapter.xml.xml_deserialization.read_aas_xml_file_into`.
15171517
15181518
:param file: A filename or file-like object to read the XML-serialized data from
@@ -1525,7 +1525,7 @@ def read_aas_xml_file(file: PathOrIO, failsafe: bool = True, **kwargs: Any)\
15251525
:raises (~basyx.aas.model.base.AASConstraintViolation, KeyError, ValueError): **Non-failsafe**: Errors during
15261526
construction of the objects
15271527
:raises TypeError: **Non-failsafe**: Encountered an undefined top-level list (e.g. ``<aas:submodels1>``)
1528-
:return: A :class:`~basyx.aas.model.provider.DictObjectStore` containing all AAS objects from the XML file
1528+
:return: A :class:`~basyx.aas.model.provider.DictIdentifiableStore` containing all AAS objects from the XML file
15291529
"""
15301530
identifiable_store: model.DictIdentifiableStore[model.Identifiable] = model.DictIdentifiableStore()
15311531
read_aas_xml_file_into(identifiable_store, file, failsafe=failsafe, **kwargs)

sdk/basyx/aas/backend/couchdb.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2025 the Eclipse BaSyx Authors
1+
# Copyright (c) 2026 the Eclipse BaSyx Authors
22
#
33
# This program and the accompanying materials are made available under the terms of the MIT License, available in
44
# the LICENSE file of this project.
@@ -8,7 +8,8 @@
88
This module adds the functionality of storing and retrieving :class:`~basyx.aas.model.base.Identifiable` objects
99
in a CouchDB.
1010
11-
The :class:`~CouchDBObjectStore` handles adding, deleting and otherwise managing the AAS objects in a specific CouchDB.
11+
The :class:`~CouchDBIdentifiableStore` handles adding, deleting and otherwise managing the AAS objects in a specific
12+
CouchDB.
1213
"""
1314
import threading
1415
import warnings
@@ -41,7 +42,7 @@ def register_credentials(url: str, username: str, password: str):
4142
.. Warning::
4243
4344
Do not use this function, while other threads may be accessing the credentials via the
44-
:class:`~.CouchDBObjectStore`!
45+
:class:`~.CouchDBIdentifiableStore`!
4546
4647
:param url: Toplevel URL
4748
:param username: Username to that CouchDB instance
@@ -93,13 +94,14 @@ class CouchDBIdentifiableStore(model.AbstractObjectStore[model.Identifier, model
9394
An ObjectStore implementation for :class:`~basyx.aas.model.base.Identifiable` BaSyx Python SDK objects backed
9495
by a CouchDB database server.
9596
96-
All methods of the ``CouchDBObjectStore`` are blocking, i.e. they stop the current thread's execution until they
97-
receive a response from the CouchDB server (or encounter a timeout). However, the ``CouchDBObjectStore`` objects are
98-
thread-safe, as long as no CouchDB credentials are added (via ``register_credentials()``) during transactions.
97+
All methods of the ``CouchDBIdentifiableStore`` are blocking, i.e. they stop the current thread's execution until
98+
they receive a response from the CouchDB server (or encounter a timeout). However, the ``CouchDBIdentifiableStore``
99+
objects are thread-safe, as long as no CouchDB credentials are added (via ``register_credentials()``) during
100+
transactions.
99101
"""
100102
def __init__(self, url: str, database: str):
101103
"""
102-
Initializer of class CouchDBObjectStore
104+
Initializer of class CouchDBIdentifiableStore
103105
104106
:param url: URL to the CouchDB
105107
:param database: Name of the Database inside the CouchDB

0 commit comments

Comments
 (0)