The following architecture has the aim to cover and support the goals presented in the motivation section.
As you can see, OSP-core provides the standard data format and API, and the wrappers take care of mapping that format to and from the backend specific syntax and API.
In order to simplify and generalise the usage as much as possible, the backend specific and syntactic knowledge should be abstracted to ontology concepts that encompass all third party tools.
For that, a 3 layer schema is used:
- The Semantic layer are the classes generated from the ontology and follow the CUDS API.
- The Interoperability layer maps the changes in the semantic layer to calls in the syntactic layer.
- The Syntactic layer provides access to the backend.
The closer to the user, the closer to the ontology concepts. The abstraction is replaced by specificity when you move towards the backend.
For a full explanation on the architecture and design, go to detailed design.
OSP-core is the main component of the SimPhoNy framework. It is independent of any backend and provides the basic ontology based data structures for the seamless exchange of data between wrappers.
OSP-core requires an ontology file to create the appropriate CUDS classes.
Said ontology must be in a YAML format as defined by our specification.
version: "0.0.1" namespace: "CUBA" ontology: ENTITY: description: The root of the ontology. subclass_of:  NOTHING: description: A class without any individuals. subclass_of: - CUBA.ENTITY ################ RELATIONSHIP: description: The root of all relationships. subclass_of: - CUBA.ENTITY ACTIVE_RELATIONSHIP: description: The root of all active relationships. Active relationships express that one cuds object is in the container of another. subclass_of: - CUBA.RELATIONSHIP ################ WRAPPER: description: The root of all wrappers. These are the bridge to simulation engines and databases. subclass_of: - CUBA.ENTITY ATTRIBUTE: description: The root of all attributes. subclass_of: - CUBA.ENTITY
OSP-core can also be used with EMMO (European Materials and Modelling Ontology). Tools for converting EMMO from the OWL format to YAML are provided. See more here.
Upon installation of OSP-core, each ontology class (except from attributes and relationships) becomes a python class.
Since each ontology has a namespace, it can be used to import the classes and create cuds objects:
from osp.core import cuba, another_namespace entity = cuba.Entity() other_entity = another_namespace.SomeOtherEntity()
The sessions are the interoperability classes that connect to where the data is stored. In the case of wrappers, they take care of keeping consistency between the backends (e.g. databases) and the internal registry.
When you add an object to a wrapper, a copy of the object is created in the registry belonging to the session of the wrapper.
To simplify the understanding and development of session classes, we have created a hierarchy:
As you can see, CoreSession is the default one used when instantiating a new object in your workspace.
Like we have mentioned in previous sections, wrappers allow the user to interact through the cuds API with different backends.
Since each backend is different, for more detailed documentation of each wrapper we suggest going through the different available repositories.
For more technical information regarding wrappers, particularly for wrapper developers, we recommend visiting wrapper development.
For the installation and usage of the framework, we highly encourage the use of a virtual environment:
~/test$ python3 -m venv SimPhoNy ~/test$ source SimPhoNy/bin/activate (SimPhoNy) ~/test$
First, the repository must be cloned:
git clone firstname.lastname@example.org:simphony/osp-core.git
Once available locally, the project must be installed. The default installation is:
cd osp-core python3 setup.py install
After installing OSP-core, you can install an ontology file using pico:
pico install <path/to/ontology.yml>
The installation of a wrapper is similar. First, the repository is cloned:
git clone email@example.com:simphony/wrappers/<some-wrapper>.git cd some-wrapper
Local wrapper installation¶
With OSP-core installed, if the wrapper has its own ontology, it must be installed:
pico install <path/to/ontology.yml>
For the wrappers that require the installation of a backend, a
install_engine.sh script is provided.
It will automatically call
install_engine_requirements.sh, where the engine specific requirements are installed.
Now the wrapper can be installed:
python3 setup.py install