{
  "document": {
    "version": 1,
    "kind": "studio-plan",
    "metadata": {
      "name": "Materialize two demo orders",
      "description": "Persist known order facts to the selected ontology store",
      "projectId": "22222222-2222-4222-8222-222222222222",
      "workspaceId": "11111111-1111-4111-8111-111111111111"
    },
    "graph": {
      "id": "demo-order-copy",
      "nodes": [
        {
          "id": "read-orders",
          "kind": "ingress",
          "label": "Read ontology demo orders",
          "inputs": [],
          "outputs": [
            {
              "key": "out",
              "label": "Orders",
              "direction": "output",
              "interface": {
                "shape": "collection"
              }
            }
          ],
          "policy": {},
          "ingress": {
            "dataEndpointId": "33333333-3333-4333-8333-333333333333",
            "mode": "full",
            "output": "orders",
            "strategy": "parser"
          }
        },
        {
          "id": "map-orders",
          "kind": "ontology-mapping",
          "label": "Map Order facts",
          "inputs": [
            {
              "key": "in",
              "label": "in",
              "direction": "input",
              "interface": {
                "shape": "collection"
              }
            }
          ],
          "outputs": [
            {
              "key": "out",
              "label": "out",
              "direction": "output",
              "interface": {
                "shape": "ont-fact-set"
              }
            }
          ],
          "policy": {},
          "ontologyMapping": {
            "packageId": "33333333-3333-4333-8333-333333333333",
            "inputs": {
              "orders": "orders"
            },
            "output": "order_facts",
            "mode": "upsert",
            "entities": [
              {
                "class": "https://example.com/operations#Order",
                "id": {
                  "template": "{entity_id}"
                },
                "properties": {
                  "https://example.com/operations#orderId": {
                    "from": "order_id",
                    "as": "string"
                  },
                  "https://example.com/operations#status": {
                    "from": "status",
                    "as": "string"
                  },
                  "https://example.com/operations#total": {
                    "from": "total",
                    "as": "number"
                  }
                },
                "identities": [
                  {
                    "sourceNamespace": "ontology-demo-postgres",
                    "sourceKey": "order_id",
                    "sourceId": {
                      "from": "order_id"
                    }
                  }
                ],
                "provenance": {
                  "system": "ontology-demo"
                }
              }
            ],
            "relationships": []
          }
        },
        {
          "id": "store-orders",
          "kind": "ontology_materializer",
          "label": "Materialize Order facts",
          "inputs": [
            {
              "key": "in",
              "label": "in",
              "direction": "input",
              "interface": {
                "shape": "ont-fact-set"
              }
            }
          ],
          "outputs": [],
          "policy": {},
          "ontologyMaterializer": {
            "packageId": "33333333-3333-4333-8333-333333333333",
            "inputs": {
              "facts": "order_facts"
            },
            "dataEndpointId": "55555555-5555-4555-8555-555555555555",
            "mode": "upsert",
            "validation": {
              "unknownTerms": "reject_fact_set",
              "invalidRecords": "reject_fact_set",
              "cardinality": "enforce",
              "datatype": "enforce"
            }
          }
        }
      ],
      "edges": [
        {
          "id": "read-map",
          "fromNodeId": "read-orders",
          "fromOutput": "out",
          "toNodeId": "map-orders",
          "toInput": "in"
        },
        {
          "id": "map-store",
          "fromNodeId": "map-orders",
          "fromOutput": "out",
          "toNodeId": "store-orders",
          "toInput": "in"
        }
      ]
    }
  },
  "commitMessage": "Initial two-row fixture"
}
