{
  "version": 1,
  "id_rendering": "type-prefixed",
  "on_missing_endpoint": "create",
  "on_duplicate_object": "first-wins",
  "nodes": [
    {
      "id": "orders",
      "label": "Orders",
      "op": {
        "type": "source",
        "source_id": "northwind",
        "table": "Orders"
      }
    },
    {
      "id": "order_details",
      "label": "Order Details",
      "op": {
        "type": "source",
        "source_id": "northwind",
        "table": "Order Details"
      }
    },
    {
      "id": "customers",
      "label": "Customers",
      "op": {
        "type": "source",
        "source_id": "northwind",
        "table": "Customers"
      }
    },
    {
      "id": "employees",
      "label": "Employees",
      "op": {
        "type": "source",
        "source_id": "northwind",
        "table": "Employees"
      }
    },
    {
      "id": "products",
      "label": "Products",
      "op": {
        "type": "source",
        "source_id": "northwind",
        "table": "Products"
      }
    },
    {
      "id": "shippers",
      "label": "Shippers",
      "op": {
        "type": "source",
        "source_id": "northwind",
        "table": "Shippers"
      }
    },
    {
      "id": "shipped_orders",
      "label": "Shipped orders",
      "op": {
        "type": "filter",
        "input": "orders",
        "condition": {
          "type": "not",
          "condition": {
            "type": "is-null",
            "column": "ShippedDate"
          }
        }
      }
    }
  ],
  "mappings": [
    {
      "type": "single",
      "label": "Customers",
      "node": "customers",
      "target": {
        "type": "object",
        "object_type": {
          "type": "constant",
          "value": "customer"
        },
        "id": {
          "type": "column",
          "column": "CustomerID"
        },
        "attributes": [
          {
            "name": "company",
            "source_column": "CompanyName"
          },
          {
            "name": "country",
            "source_column": "Country"
          }
        ]
      }
    },
    {
      "type": "single",
      "label": "Employees",
      "node": "employees",
      "target": {
        "type": "object",
        "object_type": {
          "type": "constant",
          "value": "employee"
        },
        "id": {
          "type": "column",
          "column": "EmployeeID"
        },
        "attributes": [
          {
            "name": "name",
            "source_column": "LastName"
          },
          {
            "name": "title",
            "source_column": "Title"
          }
        ],
        "timestamp": {
          "type": "value",
          "source": {
            "type": "column",
            "column": "HireDate"
          }
        }
      }
    },
    {
      "type": "single",
      "label": "Products",
      "node": "products",
      "target": {
        "type": "object",
        "object_type": {
          "type": "constant",
          "value": "product"
        },
        "id": {
          "type": "column",
          "column": "ProductID"
        },
        "attributes": [
          {
            "name": "name",
            "source_column": "ProductName"
          },
          {
            "name": "list price",
            "source_column": "UnitPrice",
            "value_type": "Float"
          }
        ]
      }
    },
    {
      "type": "single",
      "label": "Shippers",
      "node": "shippers",
      "target": {
        "type": "object",
        "object_type": {
          "type": "constant",
          "value": "shipper"
        },
        "id": {
          "type": "column",
          "column": "ShipperID"
        },
        "attributes": [
          {
            "name": "company",
            "source_column": "CompanyName"
          }
        ]
      }
    },
    {
      "type": "single",
      "label": "Orders",
      "node": "orders",
      "target": {
        "type": "object",
        "object_type": {
          "type": "constant",
          "value": "order"
        },
        "id": {
          "type": "column",
          "column": "OrderID"
        },
        "attributes": [
          {
            "name": "freight",
            "source_column": "Freight",
            "value_type": "Float"
          },
          {
            "name": "ship country",
            "source_column": "ShipCountry"
          }
        ],
        "timestamp": {
          "type": "value",
          "source": {
            "type": "column",
            "column": "OrderDate"
          }
        }
      }
    },
    {
      "type": "single",
      "label": "Reports to",
      "node": "employees",
      "target": {
        "type": "o2o",
        "source": {
          "id": {
            "type": "column",
            "column": "EmployeeID"
          },
          "object_type": {
            "type": "constant",
            "value": "employee"
          }
        },
        "target": {
          "id": {
            "type": "column",
            "column": "ReportsTo"
          },
          "object_type": {
            "type": "constant",
            "value": "employee"
          }
        },
        "qualifier": {
          "type": "constant",
          "value": "reports to"
        }
      }
    },
    {
      "type": "single",
      "label": "Order lines",
      "node": "order_details",
      "target": {
        "type": "object",
        "object_type": {
          "type": "constant",
          "value": "order line"
        },
        "id": {
          "type": "template",
          "template": "{OrderID}-{ProductID}"
        },
        "attributes": [
          {
            "name": "quantity",
            "source_column": "Quantity",
            "value_type": "Integer"
          },
          {
            "name": "unit price",
            "source_column": "UnitPrice",
            "value_type": "Float"
          },
          {
            "name": "discount",
            "source_column": "Discount",
            "value_type": "Float"
          }
        ]
      }
    },
    {
      "type": "single",
      "label": "Order has line",
      "node": "order_details",
      "target": {
        "type": "o2o",
        "source": {
          "id": {
            "type": "column",
            "column": "OrderID"
          },
          "object_type": {
            "type": "constant",
            "value": "order"
          }
        },
        "target": {
          "id": {
            "type": "template",
            "template": "{OrderID}-{ProductID}"
          },
          "object_type": {
            "type": "constant",
            "value": "order line"
          }
        },
        "qualifier": {
          "type": "constant",
          "value": "contains"
        }
      }
    },
    {
      "type": "single",
      "label": "Line of product",
      "node": "order_details",
      "target": {
        "type": "o2o",
        "source": {
          "id": {
            "type": "template",
            "template": "{OrderID}-{ProductID}"
          },
          "object_type": {
            "type": "constant",
            "value": "order line"
          }
        },
        "target": {
          "id": {
            "type": "column",
            "column": "ProductID"
          },
          "object_type": {
            "type": "constant",
            "value": "product"
          }
        },
        "qualifier": {
          "type": "constant",
          "value": "product"
        }
      }
    },
    {
      "type": "single",
      "label": "Place order",
      "node": "orders",
      "target": {
        "type": "event",
        "event_type": {
          "type": "constant",
          "value": "place order"
        },
        "id": {
          "type": "template",
          "template": "{OrderID}"
        },
        "timestamp": {
          "type": "value",
          "source": {
            "type": "column",
            "column": "OrderDate"
          }
        },
        "objects": [
          {
            "object": {
              "id": {
                "type": "column",
                "column": "OrderID"
              },
              "object_type": {
                "type": "constant",
                "value": "order"
              }
            },
            "qualifier": {
              "type": "constant",
              "value": "order"
            }
          },
          {
            "object": {
              "id": {
                "type": "column",
                "column": "CustomerID"
              },
              "object_type": {
                "type": "constant",
                "value": "customer"
              }
            },
            "qualifier": {
              "type": "constant",
              "value": "customer"
            }
          },
          {
            "object": {
              "id": {
                "type": "column",
                "column": "EmployeeID"
              },
              "object_type": {
                "type": "constant",
                "value": "employee"
              }
            },
            "qualifier": {
              "type": "constant",
              "value": "sales rep"
            }
          }
        ]
      }
    },
    {
      "type": "single",
      "label": "Order due",
      "node": "orders",
      "target": {
        "type": "event",
        "event_type": {
          "type": "constant",
          "value": "order due"
        },
        "id": {
          "type": "template",
          "template": "{OrderID}"
        },
        "timestamp": {
          "type": "value",
          "source": {
            "type": "column",
            "column": "RequiredDate"
          }
        },
        "objects": [
          {
            "object": {
              "id": {
                "type": "column",
                "column": "OrderID"
              },
              "object_type": {
                "type": "constant",
                "value": "order"
              }
            },
            "qualifier": {
              "type": "constant",
              "value": "order"
            }
          }
        ]
      }
    },
    {
      "type": "single",
      "label": "Hire employee",
      "node": "employees",
      "target": {
        "type": "event",
        "event_type": {
          "type": "constant",
          "value": "hire employee"
        },
        "id": {
          "type": "template",
          "template": "{EmployeeID}"
        },
        "timestamp": {
          "type": "value",
          "source": {
            "type": "column",
            "column": "HireDate"
          }
        },
        "objects": [
          {
            "object": {
              "id": {
                "type": "column",
                "column": "EmployeeID"
              },
              "object_type": {
                "type": "constant",
                "value": "employee"
              }
            },
            "qualifier": {
              "type": "constant",
              "value": "employee"
            }
          }
        ]
      }
    },
    {
      "type": "single",
      "label": "Ship order",
      "node": "shipped_orders",
      "target": {
        "type": "event",
        "event_type": {
          "type": "constant",
          "value": "ship order"
        },
        "id": {
          "type": "template",
          "template": "{OrderID}"
        },
        "timestamp": {
          "type": "value",
          "source": {
            "type": "column",
            "column": "ShippedDate"
          }
        },
        "objects": [
          {
            "object": {
              "id": {
                "type": "column",
                "column": "OrderID"
              },
              "object_type": {
                "type": "constant",
                "value": "order"
              }
            },
            "qualifier": {
              "type": "constant",
              "value": "order"
            }
          },
          {
            "object": {
              "id": {
                "type": "column",
                "column": "ShipVia"
              },
              "object_type": {
                "type": "constant",
                "value": "shipper"
              }
            },
            "qualifier": {
              "type": "constant",
              "value": "carrier"
            }
          }
        ]
      }
    }
  ]
}
