|
1 | | -from bam_masterdata.datamodel.object_types import Instrument |
| 1 | +from bam_masterdata.datamodel.object_types import ExperimentalStep |
2 | 2 | from bam_masterdata.parsing import AbstractParser |
3 | 3 |
|
4 | 4 |
|
5 | 5 | class MasterdataParserExample(AbstractParser): |
6 | 6 | def parse(self, files, collection, logger): |
7 | | - instrument_input = Instrument( |
8 | | - name="Example Input Instrument", |
9 | | - manufacturer="Example Manufacturer", |
10 | | - bam_oe="OE_VP.1", |
11 | | - bam_location_complete="UE_08_0_101", |
12 | | - ) |
13 | | - instrument_input_id = collection.add(instrument_input) |
14 | | - instrument_output = Instrument( |
15 | | - name="Example Output Instrument", |
16 | | - manufacturer="Example Manufacturer", |
17 | | - bam_oe="OE_VP.1", |
18 | | - bam_location_complete="UE_08_0_101", |
19 | | - ) |
20 | | - instrument_output_id = collection.add(instrument_output) |
21 | | - _ = collection.add_relationship(instrument_input_id, instrument_output_id) |
| 7 | + synthesis = ExperimentalStep(name="Synthesis") |
| 8 | + synthesis_id = collection.add(synthesis) |
| 9 | + measurement = ExperimentalStep(name="Measurement") |
| 10 | + measurement_id = collection.add(measurement) |
| 11 | + _ = collection.add_relationship(synthesis_id, measurement_id) |
22 | 12 | logger.info( |
23 | | - "Parsing finished: Added examples input and output instruments and their relation." |
| 13 | + "Parsing finished: Added examples synthesis and measurement experimental steps." |
24 | 14 | ) |
0 commit comments