Skip to content
Snippets Groups Projects
Select Git revision
  • bc072f236150e2575da9db56231b5d0e485a269f
  • main default protected
  • dev
  • f-unmod
  • f-checkidentical
  • f-simple-breakpoint
  • f-new-debug-tree
  • f-existing-file-id
  • f-no-ident
  • f-collect-problems
  • f-refactor-debug-tree
  • v0.13.0
  • v0.12.0
  • v0.11.0
  • v0.10.1
  • v0.10.0
  • v0.9.1
  • v0.9.0
  • v0.8.0
  • v0.7.1
  • v0.7.0
  • v0.6.0
  • v0.5.0
  • v0.4.0
  • v0.3.0
  • v0.2.0
  • v0.1.0
27 results

scifolder_cfood.yml

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    scifolder_cfood.yml 3.34 KiB
    # This is only a scifolder test cfood with a limited functionality.
    # The full scifolder cfood will be developed here:
    # https://gitlab.indiscale.com/caosdb/src/crawler-cfoods/scifolder-cfood
    
    ---
    metadata:
      crawler-version: 0.9.0
    ---
    Definitions:
      type: Definitions
      #include "description.yml"
    
    Data:  # name of the converter
      type: Directory
      match: (.*)
      subtree:
        DataAnalysis:  # name of the converter
          type: Directory
          match: DataAnalysis
          subtree: &template
            project_dir:  # name of the first subtree element which is a converter
              type: Directory
              match: ((?P<date>[0-9]{4,4})_)?(?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: TextElement
                          match_value: (?P<description>.*)
                          match_name: description
                          records:
                            Measurement:
                              description: $description
                        responsible_single:
                            type: TextElement
                            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_value: *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