Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

eoq3pyecorempl-2.9.1.tar.gz (15.8 kB view hashes)

Uploaded Source

Built Distribution

eoq3pyecorempl-2.9.1-py3-none-any.whl (17.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page