A model persistance layer for EOQ3 based on pyecore
Project description
eoq3pyecorempl - A model persistance layer for EOQ3 based on pyecore
This is a model persitancy layer (MPL) based on pyecore. This MPL behaves similar to a WorkspaceDomain in EOQ2. A workspace directory containing M2 and M1 models in
- .ecore and .
- *.xml
format is parsed and uploaded to a domain as a workspace model.
Usage
Imports:
from eoq3pyecorempl import PyEcoreWorkspaceMpl
Init and connect the MPL:
mpl = PyEcoreWorkspaceMpl(WORKSPACE_PATH)
Load the workspace directory:
mpl.Load()
Connect to the domain and upload the workspace model:
mpl.Connect(domain)
Accessing a M2 model:
res = domain.Do( Get(Cls("workspacemdbmodel__Resource").Sel(Pth("name").Equ("oaam.ecore"))) )
Accessing a M2 model:
res = domain.Do( Get(Cls("workspacemdbmodel__Resource").Sel(Pth("name").Equ("MinimalFlightControl.oaam"))) )
Accessing the model content:
res = domain.Do( Get(Cls("workspacemdbmodel__Resource").Sel(Pth("name").Equ("MinimalFlightControl.oaam")).Idx(0).Pth("content")) )
See also pyeoq/Test/Eoq3/test_pyecorempl.py for working code.
Workspace
A valid WORKSPACE_PATH could look like
-
Meta
- oaam.ecore
-
MinimalFlightControl.oaam
-
Library.xml
Subfolders are not mandatory.
Such a workspace directory can be found at pyeoq/Test/Eoq3/testdata/Workspace.
Documentation
For more information see EOQ3 documentation: https://eoq.gitlab.io/doc/eoq3/
Author
2024 Bjoern Annighoefer
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for eoq3pyecorempl-2.9.1-py3-none-any.whl
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 | bc6d5530923757dd35dba8fc3b15c224c3e5c7c42429e5c6450f8046297e6dba |
|
| MD5 | 8d940e3f02baeebe8f640e10b30f3dd4 |
|
| BLAKE2b-256 | da30548c054b48926beaf300cdb2efb9faccf44d8489a55672e54c3a694931d3 |