Skip to content

Commit

Permalink
Add AEP: Add a schema to ORM classes
Browse files Browse the repository at this point in the history
AiiDA's Python API provides an object relational mapper (ORM) that
abstracts the various entities that can be stored inside the provenance
graph and the relationships between them. In most use cases, users use
this ORM directly in Python to construct new instances of entities and
retrieve existing ones, in order to get access to their data and
manipulate it.

A current shortcoming of the ORM is that it is not possible to
programmatically introspect the schema of each entity: that is to say,
what data each entity stores. This makes it difficult for external
applications to provide interfaces to create and or retrieve entity
instances. It also makes it difficult to take the data outside of the
Python environment since the data would have to be serialized. However,
without a well-defined schema, doing this without an ad-hoc solution is
practically impossible.

Clear data schemas for all ORM entities would enable the creation of
external applications to work with the data stored in AiiDA's provenance
graph. A typical example use case would be a web API whose interface, to
create and return ORM entities from an AiiDA profile, would be
dynamically generated by programmatically introspecting the schema of
all ORM entities stored within it. Currently, the interface has to be
manually generated for each ORM entity, and data (de)serialization has
to be implemented.
  • Loading branch information
sphuber committed Jan 18, 2024
1 parent 6cb8a28 commit 7965597
Show file tree
Hide file tree
Showing 3 changed files with 483 additions and 0 deletions.
Loading

0 comments on commit 7965597

Please sign in to comment.