Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
474 commits
Select commit Hold shift + click to select a range
8866d8e
adapter.http: fixing post submodelelement route
Frosty2500 Mar 18, 2024
0d41fa4
adapter.http: implement the recommended changes
Frosty2500 Mar 18, 2024
33725b0
adapter.http: implement the new recommended changes
Frosty2500 Mar 20, 2024
864c7ca
adapter.http: hardcode `utf-8` for XML serialization
jkhsjdhjs Mar 20, 2024
cfa775f
adapter.http: change `base64url_encode()` function to return `str`
jkhsjdhjs Mar 20, 2024
7e61895
adapter.http: update AAS submodel refs path
jkhsjdhjs Mar 20, 2024
5e461c7
adapter.http: update AAS submodel refs `DELETE` route
jkhsjdhjs Mar 20, 2024
a6e9a53
adapter.http: suffix submodel refs deletion route with a slash
jkhsjdhjs Mar 20, 2024
db85bc4
adapter.http: refactor submodel ref access as separate function
jkhsjdhjs Mar 20, 2024
a13fea5
adapter.http: suffix slashes to all routes
jkhsjdhjs Mar 20, 2024
13e4d50
adapter.http: implement AAS API submodel routes via redirects
jkhsjdhjs Mar 28, 2024
cebe4bb
adapter.http: move `asset-information` routes to a submount
jkhsjdhjs Mar 28, 2024
4dd4055
adapter.http: rename `/constraints` routes to `/qualifiers`
jkhsjdhjs Mar 29, 2024
c3f711f
adapter.http: fix `Qualifier` JSON deserialization
jkhsjdhjs Mar 29, 2024
4e8b3f5
adapter.http: refactor qualifier retrieval/removal
jkhsjdhjs Mar 29, 2024
7d78a51
adapter.http: improve an error mesage
jkhsjdhjs Mar 29, 2024
dbaa752
adapter.http: rename `IdentifierConverter` to `Base64URLConverter`
jkhsjdhjs Mar 31, 2024
ea77752
adapter.http: add `SpecificAssetId` filtering to `get_aas_all()`
hadijannat Mar 20, 2024
47e67ed
adapter.http: improve `SpecificAssetId` filtering
jkhsjdhjs Apr 2, 2024
9b3e836
adapter.http: refactor AAS retrieval
jkhsjdhjs Apr 3, 2024
9b7133d
adapter.http: remove outdated TODOs
jkhsjdhjs Apr 3, 2024
9bad7df
adapter.http: implement the AAS reference routes
Frosty2500 Apr 5, 2024
b47ab9d
adapter.http: implement the attachment routes (#33)
Frosty2500 Apr 5, 2024
04455a4
adapter.http: implement the pagination
Frosty2500 Apr 19, 2024
f4b7e5d
adapter.http: fix codestyle errors
Frosty2500 Apr 19, 2024
9daee38
adapter.http: implement recommended changes
Frosty2500 Apr 23, 2024
c90cac2
adapter.http: implement new recommended changes
Frosty2500 Apr 28, 2024
c15e2b3
adapter.http: implement new recommended changes
Frosty2500 Apr 30, 2024
299bf32
adapter.http: change the limit and cursor check
Frosty2500 May 9, 2024
1d4159c
adapter.http: implement warning for not implemented routes
Frosty2500 May 23, 2024
ba16760
adapter.http: remove unnecessary lines
Frosty2500 May 24, 2024
304ea86
adapter.http: remove excess blank line
jkhsjdhjs May 24, 2024
afe4e54
Extract compliance tool to be its own package
s-heppner Mar 4, 2024
166bc42
Update Copyright Notices (#224)
s-heppner Apr 10, 2024
df6e7ae
adapter.aasx: allow deleting files from `SupplementaryFileContainer`
jkhsjdhjs Jun 13, 2024
2e4e5e3
adapter.http: allow changing the API base path
jkhsjdhjs Jun 13, 2024
02a9dd5
adapter.http: fix a `DeprecationWarning`
jkhsjdhjs Jun 13, 2024
aa0d839
adapter.http: allow retrieving and modifying `File` attachments via API
jkhsjdhjs Jun 13, 2024
5e5f0e9
adapter.http: remove nonfunctional 'Not Implemented' check
jkhsjdhjs Jun 19, 2024
959c6e5
adapter.xml, test.adapter.xml: add lxml typechecking
jkhsjdhjs Jun 19, 2024
501b3ef
adapter.http: fix `lxml` typing
jkhsjdhjs Jun 20, 2024
4ca0142
adapter.http: improve type hints
jkhsjdhjs Jun 19, 2024
ff49297
adapter.http: remove unnecessary generator expression
jkhsjdhjs Jul 19, 2024
6a0b3f1
adapter.http: remove trailing slashes from routes
jkhsjdhjs Jul 19, 2024
69753ab
adapter.http: add documentation of not implemented features (#52)
Frosty2500 Aug 15, 2024
792f031
adapter.http: add CD-Repo routes
zrgt Aug 27, 2024
c2e41a0
adapter.http: code style fixes
zrgt Aug 27, 2024
024852f
adapter.http: Refactor and improve codestyle (#292)
zrgt Sep 4, 2024
33336cf
sdk/basyx/adapter/: move copied files to desired location
somsonson Sep 26, 2024
be31e3e
sdk/basyx/adapter/: copied and modified the adapter from the basyx-py…
somsonson Oct 23, 2024
a882d81
model.adapter: first version of json serialization
TorbenD Dec 5, 2019
25ddaa4
adapter: restructuring
TorbenD Dec 5, 2019
f9c4731
test.adapter.json: first test for validation
TorbenD Dec 6, 2019
651914d
adapter.json: Clean up test
mhthies Dec 6, 2019
be6a98e
adapter.json: Add first version of json deserialization functionality
mhthies Dec 10, 2019
c9954de
adapter.json: Add read_json_aas_file()
mhthies Dec 10, 2019
6af2976
aas.examples: add example for a nearly complete asset administration …
TorbenD Dec 13, 2019
6a66756
adapter.json: Fix usage of Reference and new AASReference
mhthies Dec 16, 2019
3fa0e43
Add license headers to new files
mhthies Dec 16, 2019
d1b9448
test: Add json deserialization to the full example test
mhthies Dec 16, 2019
6bea50b
json.serialization: add write_aas_to_json_file function
TorbenD Dec 16, 2019
c5cff06
adapter.json.json_serialization: add modul docstring
TorbenD Dec 16, 2019
fd59c7b
example: add example for creation of a submodel template including test
TorbenD Dec 16, 2019
3eba736
json: add function to create an example asset administration shell wi…
TorbenD Dec 16, 2019
8ff9948
example: add example for testing missing object-attribute-combinations
TorbenD Dec 16, 2019
cb9cb25
adapter.json: Rename json_serialization.write_aas_to_json_file, impro…
mhthies Dec 16, 2019
2ad9583
test: Add more tests for JSON deserialization
mhthies Dec 16, 2019
4aab9b7
test: Fix codestyle
mhthies Dec 16, 2019
bbf8b6e
examples: update docstrings and move example for test to test modul
TorbenD Dec 17, 2019
df735ce
test.adapter.json: delete not used example
TorbenD Dec 17, 2019
1a39381
test: Add more expected failure tests for json deserialization
mhthies Dec 17, 2019
cc4e9c6
model.base: make key of Reference immutable (convert to Tuple) for cr…
TorbenD Dec 17, 2019
66477ac
test: Make JSON schema validating tests optional
mhthies Dec 19, 2019
949a243
model: Fix incompliant inheritance of OperationVariable from Submodel…
mhthies Dec 16, 2019
dc6dfae
test: add tests for examples
TorbenD Dec 20, 2019
401c2b0
adapter.json: Fix missing attributes of AAS and Asset in JSON deseria…
mhthies Dec 20, 2019
e32cd2f
adapter.json: Add parameter to deserialization's constructor methods
mhthies Dec 20, 2019
e12ed03
aas.examples, test: restructuring and renaming of packages, modules a…
TorbenD Jan 7, 2020
65267d8
test: Prevent aasJSONSchema from being added to git repository
mhthies Jan 8, 2020
febed71
Remove unused imports, make imports within the packages relative
mhthies Jan 20, 2020
82126f5
add test function for example_aas_mandatory_attributes
TorbenD Jan 20, 2020
05eb8c2
fixed build error
TorbenD Jan 20, 2020
b5b0884
adapter.couchdb: Add first draft of CouchDB database store
mhthies Jan 8, 2020
f5b2356
adapter.couchdb: Add major parts of functionality and tests
mhthies Jan 9, 2020
ec147e8
test: Add CI test for adapter.couchdb using GitLab CI services
mhthies Jan 10, 2020
5a4ed08
adapter.couchdb: Improve documentation and exception handling
mhthies Jan 10, 2020
66db1b1
adapter.couchdb: Add more docstrings, remove TODOs
mhthies Jan 17, 2020
15642ef
test._helper, adapter.json: add test for example_aas_missing_attribut…
TorbenD Jan 20, 2020
62175d0
test, aas: some replacement and renaming of files
TorbenD Jan 20, 2020
4e2042b
test: add test function for example_submodel_template
TorbenD Jan 20, 2020
167d3b9
aas, test: add test function for example concept description
TorbenD Jan 20, 2020
5f8d9c7
aas, test: restructure of test functions
TorbenD Jan 21, 2020
7488c73
test.xml: add initial files
s-heppner Feb 8, 2020
7dd984e
test.adapter.xml: add .gitignore file to ignore AAS.xsd
s-heppner Feb 8, 2020
f3b8cd5
test.adapter.xml: add the other two schemas to the .gitignore
s-heppner Feb 8, 2020
842875c
test.adapter.xml: add test_xml_serialization.py
s-heppner Feb 8, 2020
3691ca5
test.adapter.xml: change name of class XMLSerializationSchemaTest
s-heppner Feb 22, 2020
27c8789
test.adapter.xml: remove json specific comments from serialization test
s-heppner Feb 22, 2020
f3aa08d
AASDataChecker: create AASDataChecker for easier testing of examples
TorbenD Jan 23, 2020
777a487
fix build error in test of couchDB
TorbenD Jan 23, 2020
2c5951d
AASDataChecker: add check of Value List Elements
TorbenD Jan 23, 2020
093a8e4
DataChecker: fixed check of annotation attribute of AnnotatedRelation…
TorbenD Jan 23, 2020
f61c045
model: make description to empy dict instead of None
TorbenD Jan 26, 2020
0cc13cc
fixed build error
TorbenD Jan 26, 2020
18d03f9
Update example data and tests for native value types
mhthies Jan 24, 2020
19928db
examples: integrate check functions into example files
TorbenD Jan 29, 2020
53dc0f2
add tests and fixed code errors
TorbenD Jan 29, 2020
76287be
add tests and fix code errors
TorbenD Jan 29, 2020
34b79e7
fix commits to #234547
TorbenD Jan 29, 2020
add9b76
make imports relative if possible #41'
TorbenD Jan 30, 2020
e4ffe92
test: add exception tests for test_couchdb.py
TorbenD Feb 3, 2020
47d92ce
examples: add logger for failsafe mode and fixing failsafe mode
TorbenD Feb 19, 2020
faa65a0
update xml_serialization and test with changes that appeared through …
s-heppner Feb 28, 2020
9d18dc1
test.adapter.xml: remove resolved todo
s-heppner Mar 4, 2020
e328ace
test.adapter.xml: update test_functions after parameter change in xml…
s-heppner Mar 16, 2020
6cbe4ae
test: Add IEC61360ConceptDescription to json/xml serialization tests
mhthies Mar 17, 2020
0cc2f44
compliance_tool: add unittests for compliance_tool script
TorbenD Mar 12, 2020
db9134e
adapter.aasx: Add first draft of AASX reading/writing
mhthies Mar 6, 2020
0c33743
Add aas.util.traversal
mhthies Mar 18, 2020
8cab92d
test: Add test for AASXReader and AASXWriter, improve coverage report
mhthies Mar 24, 2020
21e4854
adapter.aasx: Add type annotation to fix mypy type check
mhthies Mar 24, 2020
a1fbdc4
adapter.aasx: Rework SupplementaryFileContainer to detect equal files…
mhthies Mar 25, 2020
2b4d7fe
json: update to schema 2.0.1
Apr 9, 2020
1d270dc
adapter: re-publish reader/writer functions
jkhsjdhjs Apr 9, 2020
36018cb
test: add serialize and deserialize test for xml
jkhsjdhjs Apr 4, 2020
17d15af
adapter.xml: rename read_xml_aas_file to read_aas_xml_file
jkhsjdhjs Apr 9, 2020
e1c4879
test: add xml_deserialization tests
jkhsjdhjs Apr 9, 2020
506a51b
adapter: explicitly define INSTANCE as ModelingKind default value
jkhsjdhjs Apr 14, 2020
ce5ff08
test.xml: don't access protected property _kind
jkhsjdhjs Apr 14, 2020
00bd0ca
set correct copyright year for all files
jkhsjdhjs Apr 17, 2020
0a2eaee
adapter: specify type of objects in DictObjectStore
jkhsjdhjs Apr 17, 2020
8ca3bab
test: Fix occasional test failures due to rounding error in test_aasx
mhthies Apr 17, 2020
ddc3faf
adapter.xml: change for current schema
jkhsjdhjs Apr 23, 2020
6041e0e
adapter.xml.xml_deserialization: support schema v2.0.1
jkhsjdhjs May 13, 2020
b34048d
compliance_tool: Add xml extension including tests
TorbenD Apr 27, 2020
ef1bb35
test.adapter.xml: delete aasXMLSchema*.xsd from gitignore
TorbenD Apr 30, 2020
862ae20
adapter, cli: add json schema and change path
TorbenD May 26, 2020
57c2b51
adapter: Improve path handling of Schema files
mhthies May 27, 2020
5a225b9
test: Remove .gitignore files for Schema files
mhthies May 27, 2020
2b3f15f
test.adapter.test_couchdb: Make tests be skipped
s-heppner Oct 13, 2020
a5867fc
adapter: Remove couchdb and according tests.
s-heppner Oct 28, 2020
b0ad89c
adapter.aasx: Allow chosing between XML and JSON serialization when w…
mhthies Sep 24, 2020
c14d486
adapter.xml.xml_deserialization: add read_aas_xml_file_into() function
jkhsjdhjs Oct 7, 2020
f98695d
adapter.xml.xml_deserialization: add read_aas_xml_element()
jkhsjdhjs Oct 8, 2020
e0f7be4
adapter.xml.xml_deserialization: make failsafe and stripped class var…
jkhsjdhjs Oct 26, 2020
b3343b3
adapter.xml.xml_deserialization: change type_ to Referable
jkhsjdhjs Oct 26, 2020
91cb211
adapter.xml.xml_deserialization: add read_aas_xml_file_into() function
jkhsjdhjs Oct 7, 2020
69ef74d
adapter.xml.xml_deserialization: add read_aas_xml_element()
jkhsjdhjs Oct 8, 2020
a5de0e8
adapter.xml.xml_deserialization: make failsafe and stripped class var…
jkhsjdhjs Oct 26, 2020
8c47d79
adapter.xml.xml_deserialization: change type_ to Referable
jkhsjdhjs Oct 26, 2020
c58f673
adapter.aasx: Add write_aas_objects() method
mhthies Oct 7, 2020
77def45
test: Catch zipfile warnings during writing AASX file
mhthies Oct 30, 2020
542547c
Fix typo in tests
mhthies Nov 2, 2020
2382815
test.adapter.xml: improve xml deserialization tests
jkhsjdhjs Oct 29, 2020
2339693
test.adapter.xml.xml_deserialization: make object_class default to En…
jkhsjdhjs Oct 29, 2020
d99e767
test.adapter.json: remove unused imports
jkhsjdhjs Oct 29, 2020
6ee6c70
adapter.json.json_deserialization: support deserializing stripped obj…
jkhsjdhjs Oct 29, 2020
365cd9a
adapter.json.json_serialization: support serializing stripped objects
jkhsjdhjs Oct 29, 2020
1c940ac
model.aas: remove underscore suffix from parameters submodel_ and sec…
jkhsjdhjs Nov 13, 2020
842f00b
Update license headers for EPL-2.0 dual-licensing
mhthies Feb 2, 2021
a726d40
Rebrand project code PyI40AAS → Eclipse BaSyx Python SDK
mhthies Nov 15, 2021
c85ebb9
Move Python package aas → basyx.aas
mhthies Nov 15, 2021
6d671b6
tests: Suppress MyPy warnings about TestCase.assertLogs
mhthies Feb 2, 2022
37a8eff
minor codestyle improvements
jkhsjdhjs Oct 28, 2021
f525c83
Update license headers for MIT license
jkhsjdhjs Apr 19, 2022
0fd4cb1
add whitespace after assert keyword
jkhsjdhjs Aug 13, 2022
07d6a6d
model: prevent creating References without keys
jkhsjdhjs Oct 21, 2022
1b19aef
test.adapter.xml.xml_deserialization: remove unneeded 'type: ignore' …
jkhsjdhjs Nov 3, 2023
b13bd58
test.adapter.xml.xml_deserialization: make `OperationVariable` tests …
jkhsjdhjs Nov 3, 2023
e217e0a
model, adapter, example: add constraint string not empty, adapt Asset…
TorbenD Nov 24, 2020
67b864a
pycodestyle: fixed warnings
TorbenD Nov 24, 2020
60b72c9
test.adapter.xml: fix xml_deserialization tests
jkhsjdhjs Dec 1, 2020
f977c63
submodel.entity: add typ for self.entity_type, add types for return v…
TorbenD Dec 3, 2020
a987b46
test.adapter.xml.test_xml_deserialization: Add "<aas:kind>Template</a…
s-heppner Dec 8, 2020
a31d260
test.adapter.json.test_json_serialization: Add categories to DataElem…
s-heppner Dec 8, 2020
7c4ff0c
test.adapter.json.test_json_deserialization: Add category to DataElem…
s-heppner Dec 8, 2020
aed4648
testfiles: add new test files for v3.0RC01 and fix minor error handli…
TorbenD Dec 8, 2020
ddc0f94
bugfixes: fixes findings in merge request
TorbenD Dec 29, 2020
1118d8b
model.namespace: create namespaces for unique id_short, semantic_id a…
TorbenD Jan 7, 2021
c5d97c1
model.submodelelementcollection: add new types to support attribute a…
TorbenD Jan 12, 2021
6739cd3
adapter.aasx: Update AASXWriter.write_aas() to DotAAS v3.0 spec
mhthies Jan 4, 2021
25815e6
test: Remove outdated AASX test
mhthies Jan 13, 2021
8eb8122
test: fix dysfunctional xml deserialization test
jkhsjdhjs Nov 1, 2021
34d7e6a
remove Asset
jkhsjdhjs Oct 28, 2021
a5e59c9
remove View
jkhsjdhjs Nov 1, 2021
371b82b
remove Constraint
jkhsjdhjs Apr 6, 2022
4e41a20
rename Blob/mimeType File/mimeType to /contentType
jkhsjdhjs Jun 22, 2022
51b9568
rename Identifiable/identification to Identifiable/id
jkhsjdhjs Jun 25, 2022
ffec555
change type of Identifiable/id to str
jkhsjdhjs Jul 18, 2022
36b9c43
test.adapter.aasx: add whitespace after assert
jkhsjdhjs Aug 16, 2022
8e6eb97
model: update SubmodelElementCollection
jkhsjdhjs Oct 17, 2022
ec32c85
add SubmodelElementList
jkhsjdhjs Oct 20, 2022
6bbacd4
begin integration of new XML and JSON schemata
jkhsjdhjs Mar 20, 2023
94acf12
fix some mypy errors
jkhsjdhjs Apr 1, 2023
5ffc4ad
update implementation and adapters for new DataSpecification classes …
jkhsjdhjs Apr 7, 2023
d53ec3d
Change type of all occurrences of `AssetInformation.global_asset_id` …
Apr 25, 2023
beca5c0
update XML/JSON schemata, adapter and test files for updated `AssetIn…
jkhsjdhjs May 15, 2023
a152c61
remove wrapping `Identifier()` around strings
jkhsjdhjs Jul 19, 2023
a15bd3d
change type of `Entity.global_asset_id` to `Identifier`
jkhsjdhjs Jul 20, 2023
99eca87
model.base: Rename GlobalReference to ExternalReference
s-heppner Aug 11, 2023
247b437
Fix PyCodeStyle
s-heppner Aug 11, 2023
314126f
model.base: Rename ModelingKind to ModellingKind (#104)
s-heppner Aug 24, 2023
4581f1d
replace all usages of `LangStringSet` with a `ConstrainedLangStringSet`
jkhsjdhjs Aug 24, 2023
10d3597
Update compliance tool test files
zrgt Oct 17, 2023
3709e91
Update test files
zrgt Oct 27, 2023
e9fca7a
test.adapter.xml: Reintroduce "# type: ignore" tags that got lost in …
s-heppner Nov 21, 2023
4a073ac
test.adapter.xml: remove 'type: ignore' comments
jkhsjdhjs Nov 21, 2023
3465b01
test.adapter.xml: test deserialization without namespace prefixes
jkhsjdhjs Mar 13, 2024
a5aa5c1
test.adater.xml.test_xml_deserialization: simplify
jkhsjdhjs Mar 13, 2024
6ed3797
test.adapter.json: add `BytesIO` test
jkhsjdhjs Mar 13, 2024
f596847
adapter.xml: add function for serializing single objects
jkhsjdhjs Mar 13, 2024
2d10cc2
Reintroduce schema files for testing XML and JSON serialization
s-heppner Mar 4, 2024
2fde078
test: Remove schema files and adapt CI to fetch them
s-heppner Mar 14, 2024
e11c6cc
Update Copyright Notices (#224)
s-heppner Apr 10, 2024
a8f33b7
adapter.aasx: allow deleting files from `SupplementaryFileContainer`
jkhsjdhjs Jun 13, 2024
e189f4b
adapter.xml, test.adapter.xml: add lxml typechecking
jkhsjdhjs Jun 19, 2024
910d9a0
test_xml_deserialization: Add tests for `_tag_replace_namespace` (#284)
JAB1305 Jul 16, 2024
2b3ab76
http-api-oas: move to test/adapter/ directory
jkhsjdhjs Apr 29, 2021
33f8c3e
http-api-oas: split into aas and submodel interface
jkhsjdhjs Apr 29, 2021
9e873b5
adapter.http: make trailing slashes the default
jkhsjdhjs Apr 29, 2021
5a9a895
http-api-oas: remove PATCH route
jkhsjdhjs Apr 29, 2021
87fc39b
http-api-oas: make result types more accurate
jkhsjdhjs Apr 29, 2021
bf2d62f
http-api-oas: add missing 400 responses and fix descriptions
jkhsjdhjs Jul 7, 2021
c4a3ec7
http-api-oas: add links
jkhsjdhjs Jul 7, 2021
f33d079
test: add http api tests
jkhsjdhjs Jul 14, 2021
6b75ae1
test.adapter.http: update w.r.t. the changes of the last 2 years
jkhsjdhjs Dec 11, 2023
b314b30
test.adapter.http: ignore the type of an import to make `mypy` happy
jkhsjdhjs Dec 11, 2023
a0d05fd
adapter.http: update Werkzeug to 3.x
jkhsjdhjs Feb 14, 2024
eeb64c2
test: disable http api tests for now
jkhsjdhjs Feb 14, 2024
b230766
adapter.http: improve codestyle
jkhsjdhjs Feb 14, 2024
ee0c241
test.adapter.http: update license header
jkhsjdhjs Feb 14, 2024
ae32225
adapter.http: allow retrieving and modifying `File` attachments via API
jkhsjdhjs Jun 13, 2024
895eb78
move copied files from basyx-python-sdk to desired folders
somsonson Nov 4, 2024
b1b9895
sdk/basyx/adapter: modified the adapter from the basy-python-sdk repo…
somsonson Nov 4, 2024
a5955b2
sdk/: Add unittests for aasx.py including various testfiles. Fix code…
somsonson Nov 5, 2024
0906826
.github/workflows/ci.yml: import lxml-stubs for CI tests sdk/: fix va…
somsonson Nov 5, 2024
4d24ad8
sdk/basyx/adapter/: redesigned adapter structure to match its use
somsonson Nov 5, 2024
f14d0d2
sdk/basyx/adapter/_generic.py: remove unused file
somsonson Nov 5, 2024
a63c085
move sdk/basyx/aasx.py and fixed various imports
somsonson Nov 5, 2024
2b74f3f
sdk/basyx/tutorial/tutorial_create_simple_aas.py: Add verification step
JAB1305 Oct 15, 2024
0926132
sdk/basyx/tutorial/tutorial_create_simple_aas.py: Add further explana…
JAB1305 Oct 23, 2024
a015464
sdk/test: added unittest to improve coverage. Modified test folder to…
somsonson Nov 11, 2024
5f101ea
Update tutorial_create_simple_aas.py
somsonson Nov 11, 2024
82139cd
sdk/: Remove unused functions and simplify the code. Resolve PR threads.
somsonson Nov 19, 2024
d618cb2
aasx.py: Rename a few functions and check the docstrings. tutorial_cr…
somsonson Nov 29, 2024
7e0e4ef
sdk/basyx/__init__.py: Import aas-core3 in init file to shortcut its …
somsonson Dec 9, 2024
8c53860
tutorial_create_simple_aas.py rename to tutorial_aasx.py
somsonson Dec 12, 2024
84f798c
tutorial_create_simple_aas.py: restored the original tutorial
somsonson Dec 12, 2024
54b32cc
sdk/basyx/__init__.py: added documentation for aas-core3 shortcut
somsonson Dec 12, 2024
a08971f
Update sdk/basyx/__init__.py
s-heppner Dec 13, 2024
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
21 changes: 21 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ jobs:
pip install pycodestyle mypy
cd ./sdk
pip install .
python -m pip install lxml-stubs
- name: Check typing with MyPy
run: |
mypy sdk --exclude sdk/build
Expand Down Expand Up @@ -99,3 +100,23 @@ jobs:
- name: Check documentation for errors
run: |
SPHINXOPTS="-a -E -n -W --keep-going" make -C docs html


package:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ env.X_PYTHON_VERSION }}
uses: actions/setup-python@v2
with:
python-version: ${{ env.X_PYTHON_VERSION }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -q build
- name: Create source and wheel dist
run: |
ls
cd ./sdk
python -m build
4 changes: 4 additions & 0 deletions sdk/basyx/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
from .object_store import *

# Alias `types` as `model` to maintain consistency with the import style of the predecessor project (BaSyx-Python SDK),
# ensuring a familiar experience for users transitioning to the new BaSyx-Python Framework.
from aas_core3 import types as model
1,012 changes: 1,012 additions & 0 deletions sdk/basyx/aasx.py

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions sdk/basyx/object_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@

from aas_core3.types import Identifiable, Referable, Class

# We define types for :class:`aas_core3.types.Identifier` and :class:`aas_core3.types.Referable` for easier referencing.
# We define types for :class:`aas_core3.types.Identifier` for easier referencing.
_IdentifiableType = TypeVar('_IdentifiableType', bound=Identifiable)
_ReferableType = TypeVar('_ReferableType', bound=Referable)


class AbstractObjectProvider(metaclass=abc.ABCMeta):
Expand Down
Binary file added sdk/basyx/tutorial/data/TestFile.pdf
Binary file not shown.
Empty file.
151 changes: 151 additions & 0 deletions sdk/basyx/tutorial/tutorial_aasx.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
#!/usr/bin/env python3
"""
Tutorial for exporting Asset Administration Shells with related objects and auxiliary files to AASX package files, using
the :mod:`~basyx.aasx` module from the Eclipse BaSyx Python Framework.

"""

import datetime
from pathlib import Path # Used for easier handling of auxiliary file's local path

import pyecma376_2 # The base library for Open Packaging Specifications. We will use the OPCCoreProperties class.
from basyx import model
from basyx.aasx import AASXWriter, AASXReader, DictSupplementaryFileContainer
from basyx.object_store import ObjectStore

# step 1: Setting up an SupplementaryFileContainer and AAS & submodel with File objects
# step 2: Writing AAS objects and auxiliary files to an AASX package
# step 3: Reading AAS objects and auxiliary files from an AASX package


########################################################################################
# Step 1: Setting up a SupplementaryFileContainer and AAS & submodel with File objects #
########################################################################################

# Let's first create a basic Asset Administration Shell with a simple submodel.
# See `tutorial_create_simple_aas.py` for more details.
submodel = model.Submodel(id='https://acplt.org/Submodel', submodel_elements=[])

key_types = model.KeyTypes("Submodel")
Referencetype = model.ReferenceTypes("ModelReference")
key = model.Key(value='https://acplt.org/Submodel', type=key_types)
reference = model.Reference(type=Referencetype, keys=[key])

aas = model.AssetAdministrationShell(id='https://acplt.org/Simple_AAS',
asset_information=model.AssetInformation(
asset_kind=model.AssetKind.TYPE),
submodels=[reference])

# Another submodel, which is not related to the AAS:
unrelated_submodel = model.Submodel(
id='https://acplt.org/Unrelated_Submodel'
)

# We add these objects to an ObjectStore for easy retrieval by id.
object_store: ObjectStore = ObjectStore([unrelated_submodel, submodel, aas])


# For holding auxiliary files, which will eventually be added to an AASX package, we need a SupplementaryFileContainer.
# The `DictSupplementaryFileContainer` is a simple SupplementaryFileContainer that stores the files' contents in simple
# bytes objects in memory.
file_store = DictSupplementaryFileContainer()

# Now, we add an example file from our local filesystem to the SupplementaryFileContainer.
#
# For this purpose, we need to specify the file's name in the SupplementaryFileContainer. This name is used to reference
# the file in the container and will later be used as the filename in the AASX package file. Thus, this file must begin
# with a slash and should begin with `/aasx/`. Here, we use `/aasx/suppl/MyExampleFile.pdf`. The
# SupplementaryFileContainer's add_file() method will ensure uniqueness of the name by adding a suffix if an equally
# named file with different contents exists. The final name is returned.
#
# In addition, we need to specify the MIME type of the file, which is later used in the metadata of the AASX package.
# (This is actually a requirement of the underlying Open Packaging Conventions (ECMA376-2) format, which imposes the
# specification of the MIME type ("content type") of every single file within the package.)

with open(Path(__file__).parent / 'data' / 'TestFile.pdf', 'rb') as f:
actual_file_name = file_store.add_file("/aasx/suppl/MyExampleFile.pdf", f, "application/pdf")


# With the actual_file_name in the SupplementaryFileContainer, we can create a reference to that file in our AAS
# Submodel, in the form of a `File` object:

model.File(id_short="documentationFile", content_type="application/pdf", value=actual_file_name)

file = model.File(id_short="documentationFile", content_type="application/pdf", value=actual_file_name)
if submodel.submodel_elements is not None:
submodel.submodel_elements.append(file)


######################################################################
# Step 2: Writing AAS objects and auxiliary files to an AASX package #
######################################################################

# After setting everything up in Step 1, writing the AAS, including the Submodel objects and the auxiliary file
# to an AASX package is simple.

# Open an AASXWriter with the destination file name and use it as a context handler, to make sure it is properly closed
# after doing the modifications:
with AASXWriter("./MyAASXPackage.aasx") as writer:
# Write the AAS and everything belonging to it to the AASX package
# The `write_aas()` method will automatically fetch the AAS object with the given id
# and all referenced Submodel objects from the ObjectStore. It will also scan every object for
# semanticIds referencing ConceptDescription, fetch them from the ObjectStore, and scan all sbmodels for `File`
# objects and fetch the referenced auxiliary files from the SupplementaryFileContainer.
# In order to add more than one AAS to the package, we can simply add more Identifiers to the `aas_ids` list.
#
# ATTENTION: As of Version 3.0 RC01 of Details of the Asset Administration Shell, it is no longer valid to add more
# than one "aas-spec" part (JSON/XML part with AAS objects) to an AASX package. Thus, `write_aas` MUST
# only be called once per AASX package!
writer.write_aas(aas_ids=['https://acplt.org/Simple_AAS'],
object_store=object_store,
file_store=file_store)

# Alternatively, we can use a more low-level interface to add a JSON/XML part with any Identifiable objects (not
# only an AAS and referenced objects) in the AASX package manually. `write_aas_objects()` will also take care of
# adding referenced auxiliary files by scanning all submodel objects for contained `File` objects.
#
# ATTENTION: As of Version 3.0 RC01 of Details of the Asset Administration Shell, it is no longer valid to add more
# than one "aas-spec" part (JSON/XML part with AAS objects) to an AASX package. Thus, `write_all_aas_objects` SHALL
# only be used as an alternative to `write_aas` and SHALL only be called once!
objects_to_be_written: ObjectStore[model.Identifiable] = ObjectStore([unrelated_submodel])
writer.write_all_aas_objects(part_name="/aasx/my_aas_part.xml",
objects=objects_to_be_written,
file_store=file_store)

# We can also add a thumbnail image to the package (using `writer.write_thumbnail()`) or add metadata:
meta_data = pyecma376_2.OPCCoreProperties()
meta_data.creator = "Chair of Process Control Engineering"
meta_data.created = datetime.datetime.now()
writer.write_core_properties(meta_data)

# Closing the AASXWriter will write some required parts with relationships and MIME types to the AASX package file and
# close the package file afterward. Make sure, to always call `AASXWriter.close()` or use the AASXWriter in a `with`
# statement (as a context manager) as shown above.


########################################################################
# Step 3: Reading AAS objects and auxiliary files from an AASX package #
########################################################################

# Let's read the AASX package file, we have just written.
# We'll use a fresh ObjectStore and SupplementaryFileContainer to read AAS objects and auxiliary files into.
new_object_store: ObjectStore = ObjectStore()
new_file_store = DictSupplementaryFileContainer()

# Again, we need to use the AASXReader as a context manager (or call `.close()` in the end) to make sure the AASX
# package file is properly closed when we are finished.
with AASXReader("MyAASXPackage.aasx") as reader:
# Read all contained AAS objects and all referenced auxiliary files
reader.read_into(object_store=new_object_store,
file_store=new_file_store)

# We can also read the metadata
new_meta_data = reader.get_core_properties()

# We could also read the thumbnail image, using `reader.get_thumbnail()`


# Some quick checks to make sure, reading worked as expected
assert 'https://acplt.org/Submodel' in new_object_store
assert actual_file_name in new_file_store
assert new_meta_data.creator == "Chair of Process Control Engineering"
5 changes: 4 additions & 1 deletion sdk/basyx/tutorial/tutorial_objectstore.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from basyx.object_store import ObjectStore
from aas_core3.types import Identifiable, AssetAdministrationShell, AssetInformation, AssetKind
import aas_core3.types as aas_types
from basyx import model as aas_types

aas = AssetAdministrationShell(id="urn:x-test:aas1",
asset_information=AssetInformation(asset_kind=AssetKind.TYPE))
Expand Down Expand Up @@ -78,3 +78,6 @@
# Retrieve parent of list_element by id_short

print(element_list == obj_store.get_parent_referable("list_1"))

print(aas.__dict__)
print(type(submodel1), type(aas))
6 changes: 5 additions & 1 deletion sdk/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "basyx-python-framework-base"
version = "0.1"
dependencies = ["aas-core3.0"]
dependencies = ["aas-core3.0", "pyecma376-2"]
requires-python = ">=3.8, <3.13"
authors = [
{name = "The Eclipse BaSyx Authors"}
Expand All @@ -14,3 +14,7 @@ authors = [
description="The Eclipse BaSyx Python SDK, an implementation of the Asset Administration Shell for Industry 4.0 systems"
readme = "README.md"
license = {file = "./LICENSE"}

[tool.setuptools]
packages = ["basyx"]
py-modules = ['basyx']
52 changes: 52 additions & 0 deletions sdk/test/example_aas.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
from aas_core3 import types as model
from basyx.object_store import ObjectStore
import aas_core3.types as aas_types
from basyx.aasx import DictSupplementaryFileContainer
from pathlib import Path


def create_full_example() -> ObjectStore:
"""
Creates an object store which is filled with an example :class:`~basyx.aas.model.submodel.Submodel`,
:class:`~basyx.aas.model.concept.ConceptDescription` and :class:`~basyx.aas.model.aas.AssetAdministrationShell`
using the functions of this module

:return: :class:`~basyx.aas.model.provider.DictObjectStore`
"""
Referencetype = aas_types.ReferenceTypes("ModelReference")

key_types = aas_types.KeyTypes("Submodel")

key = aas_types.Key(value="some-unique-global-identifier", type=key_types)

reference = aas_types.Reference(type=Referencetype, keys=[key])

submodel = aas_types.Submodel(
id="some-unique-global-identifier",
submodel_elements=[
aas_types.Property(
id_short="some_property",
value_type=aas_types.DataTypeDefXSD.INT,
value="1984",
semantic_id=reference
)
]
)
file_store = DictSupplementaryFileContainer()

with open(Path(__file__).parent.parent / 'basyx' / 'tutorial' / 'data' / 'TestFile.pdf', 'rb') as f:
actual_file_name = file_store.add_file("/aasx/suppl/MyExampleFile.pdf", f, "application/pdf")

if submodel.submodel_elements is not None:
submodel.submodel_elements.append(aas_types.File(id_short="documentationFile",
content_type="application/pdf",
value=actual_file_name))

aas = aas_types.AssetAdministrationShell(id="https://acplt.org/Test_AssetAdministrationShell",
asset_information=aas_types.AssetInformation(
asset_kind=aas_types.AssetKind.TYPE),
submodels=[reference])
obj_store: ObjectStore[model.Identifiable] = ObjectStore()
obj_store.add(aas)
obj_store.add(submodel)
return obj_store
Loading
Loading