Skip to content
Snippets Groups Projects
Commit e1a77209 authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

Merge branch 'dev' into f-json-converter

parents 07ae221f 8b61db10
No related branches found
No related tags found
2 merge requests!53Release 0.1,!9ENH: introduce JSON converter
Definitions:
type: Definitions
#include "description.yml"
# Converter-Provenance
# DataAnalysis/project_dir/measurement/match/identifier
# Structure-Element-Provenance
# DataAnalysis/2020_SpeedOflight/2020-11-10_kram
DataAnalysis: # name of the converter
type: Directory_djskfj
match: DataAnalysis
subtree: &template
project_dir: # name of the first subtree element which is a converter
type: Directory
match: (?P<date>.*?)_(?P<identifier>.*)
records:
Project: # this is an identifiable in this case
parents:
- Project # not needed as the name is equivalent
date: $date
identifier: $identifier
subtree:
measurement: # new name for folders on the 3rd level
type: Directory
match: (?P<date>[0-9]{4,4}-[0-9]{2,2}-[0-9]{2,2})(_(?P<identifier>.*))?
records:
Measurement:
date: $date
identifier: $identifier
project: $Project
subtree:
README:
type: MarkdownFile # this is a subclass of converter File
# function signature: GeneralStore, StructureElement
# preprocessors: custom.caosdb.convert_values
match: ^README\.md$
# how to make match case insensitive?
subtree:
description:
type: DictTextElement
match_value: (?P<description>.*)
match_name: description
records:
Measurement:
description: $description
responsible_single:
type: DictTextElement
match_name: responsible
match_value: &person_regexp ((?P<first_name>.+) )?(?P<last_name>.+)
records: &responsible_records
Person:
first_name: $first_name
last_name: $last_name
Measurement: # this uses the reference to the above defined record
responsible: +$Person # each record also implicitely creates a variable
# with the same name. The "+" indicates, that
# this will become a list entry in list property
# "responsible" belonging to Measurement.
responsible_list:
type: DictListElement
match_name: responsible
subtree:
Person:
type: TextElement
match: *person_regexp
records: *responsible_records
ExperimentalData: # name of the converter
type: Directory
match: ExperimentalData
subtree: *template
SimulationData: # name of the converter
type: Directory
match: SimulationData
subtree: *template
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment