dm_read_yaml: Read YAML

Description Usage Arguments Details Examples

View source: R/dm.R

Description

Reads a file in YAML format and returns a data model object.

Usage

1

Arguments

file

A file in YAML format

text

A YAML formated character string

Details

YAML description should include table names (first level), columns (second level) and column attributes (third level). Expected (but not required) column attributes are key (Yes|No), ref (Name of referenced table), comment (column description).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
dm <-
  dm_read_yaml(text = "

    Person:
      Person ID: {key: yes}
      Name:
      E-mail:
      Street:
      Street number:
      City:
      ZIP:

    Order:
      Order ID: {key: yes}
      Customer: {ref: Person}
      Sales person: {ref: Person}
      Order date:
      Requested ship date:
      Status:

    Order Line:
      Order ID: {key: yes, ref: Order}
      Line number: {key: yes}
      Order item: {ref: Item}
      Quantity:
      Price:

    Item:
      Item ID: {key: yes}
      Item Name:
      Description:
  ")

bergant/datamodelr documentation built on March 6, 2021, 5:47 a.m.