# Data Ingestion

# Technical Support: Data Ingestion

This page summarizes the ingestion approach used in the demo repository, focusing on reusable patterns rather than dataset specifics.

# High-level approach

  1. Define node and edge schemas (or validate they exist).
  2. Upsert nodes by stable keys.
  3. Create relationships via edges.
  4. Commit in batches.

# Example ingestion pattern (C#)

The demo connector illustrates this structure:

await graph.CreateNodeSchemaAsync<Schema.Nodes.Device>();
await graph.CreateNodeSchemaAsync<Schema.Nodes.Part>();
await graph.CreateEdgeSchemaAsync(typeof(Schema.Edges));

var deviceNode = graph.TryAdd(new Schema.Nodes.Device { Name = device.Name });
var partNode   = graph.TryAdd(new Schema.Nodes.Part   { Name = part.Name });
graph.Link(partNode, Node.FromKey(nameof(Schema.Nodes.Device), device.Name),
           Schema.Edges.PartOf, Schema.Edges.HasPart);

await graph.CommitPendingAsync();

# What to take away for production projects

  • Use stable keys to keep ingestion idempotent.
  • Encode relationships explicitly (don’t expect them to be inferred).
  • Add observability (counts, durations, error logs).
  • Plan for schema evolution and reprocessing.

# Cross-links to product docs