simuldb

1from .simuldb import *
2
3__doc__ = simuldb.__doc__
4if hasattr(simuldb, "__all__"):
5    __all__ = simuldb.__all__
class Session:

Combination of [Software] and [Run] metadata associated with the data of one run

run

Run information

software

Used software

class Software:

Version information about the used [Software]

name

Name of software

compile_time

Compilation time

version

Version of software

class Run:

[Run] metadata containing information about the machine and the start time

date
id
class Dataset:

Reference to one data file

This stores an id to identify to file, a hash to verify it and some metadata that is associated with the data. Note that this does not specify exactly where the file is stored.

By default [sha2] is used to generate a SHA-512 hash of the file if the sha feature is enabled. Manually calculating the hash and using from_hash allows for other hash functions as long as the hash is representable as Vec<u8>.

Every time that is serializable into a [Map] can be used as metadata.

id
hash
host
metadata
class Json:

JSON backend

All data is saved in JSON files inside json_folder. The session information is stored directly there with its runs id as filename. This id is also used to create a subfolder where all datasets are stored. For those, the id is used as a filename.

A folder with one session and five datasets could look like this:

9F03105D9451CC3A.json
9F03105D9451CC3A
9F03105D9451CC3A/96ae94e6-cc1a-4621-999c-32a72741e4e8.json
9F03105D9451CC3A/4eac9469-09a4-484c-a7cd-b1aa37d91a6c.json
9F03105D9451CC3A/b9b446a3-78a9-4fe5-b4c1-530759e33282.json
9F03105D9451CC3A/a33a95e6-afd7-4cdf-8e66-54180a77312f.json
9F03105D9451CC3A/c04a2a79-7b13-413f-8f35-523259937101.json
def get_sessions(self, /):
def add_session(self, /, session):
def remove_session(self, /, session):
class JsonSession:

Session representation in JSON backend

def add_dataset(self, /, dataset):
def get_datasets(self, /):
def remove_dataset(self, /, id):
software
path

Folder with datasets

session

Session information

run
class Neo4j:

Neo4j backend

Currently, only writing is supported.

Add metadata is saved as nodes in a Neo4j database. Software and runs are saved as nodes and linked to datasets with relations of type uses and part_of respectively.

Metadata storage

Metadata can be of any type that can be serializable to a map, including arbitrarily nested types. Neo4j does not support values that are maps themselves. To circumvent this, each leaf of the metadata tree is saved as a separate node containing the path to it and its value.

def add_session(self, /, session):
def remove_session(self, /, session):
def get_sessions(self, /):
class Neo4jSession:

Session representation in Neo4j backend

def add_dataset(self, /, dataset):
def remove_dataset(self, /, id):
def get_datasets(self, /):
run
session
software