Metadata-Version: 2.1
Name: eoq3pyecorempl
Version: 2.9.2
Summary: A model persistance layer for EOQ3 based on pyecore
Author-email: Bjoern Annighoefer <bjoern.annighoefer@ils.uni-stuttgart.de>
Project-URL: Homepage, https://gitlab.com/eoq/py/eoq3pyecorempl
Project-URL: Issues, https://gitlab.com/eoq/py/eoq3pyecorempl/-/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: eoq3
Requires-Dist: eoq3pyecoreutils

# 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 

* <modelname>.ecore and <user model>.<modelname>
* *.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
