Load a sample set
const url = 'http://localhost:11044/api/v1/samples';const options = { method: 'POST', headers: {'X-Embabel-Api-Key': '<X-Embabel-Api-Key>', 'Content-Type': 'application/json'}, body: '{"edges":[{"from":"example","properties":{"additionalProperty":"example"},"to":"example","type":"example"}],"matched":1,"name":"example","nodes":[{"displayName":"example","id":"example","label":"example","properties":{"additionalProperty":"example"}}],"realm":"example","truncated":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:11044/api/v1/samples \ --header 'Content-Type: application/json' \ --header 'X-Embabel-Api-Key: <X-Embabel-Api-Key>' \ --data '{ "edges": [ { "from": "example", "properties": { "additionalProperty": "example" }, "to": "example", "type": "example" } ], "matched": 1, "name": "example", "nodes": [ { "displayName": "example", "id": "example", "label": "example", "properties": { "additionalProperty": "example" } } ], "realm": "example", "truncated": true }'Nodes are marked :_Sample and tagged with the set name, so the set can be removed later without touching anything real. Loading the same set twice merges rather than duplicates.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”The sample set to write. name (required) tags every node so the set can be removed by it; realm (required, non-blank) is not checked against what is installed; nodes (at least one) each carry a plain-identifier label, an id unique within the set, an optional displayName and properties with no leading-underscore keys; edges join nodes by from/type/to id, with at least one end in this set, and carry their own properties under the same key rule. Nodes are merged on label, id and the user’s scope, so a second load does not duplicate. matched and truncated from an export are accepted and ignored. Any problem refuses the whole set with 400 before anything is written
Body of POST /samples: a named set of fictional records for one realm. Its nodes are marked :_Sample and tagged with the set’s name, so the set can be removed without touching real records. POST /samples/export answers this same shape.
object
Relationships to create, each with at least one end among this set’s nodes; empty when omitted
One relationship of a sample set, between nodes named by id
object
Id of the start node: one of the set’s nodes, or an existing node in this world. Nothing is created when no node has it
The relationship’s own property values, by key; a key starting with _ is refused. Exported with the edge and written back by a load, so a set carries what its joins say, not only that they exist; a shape-only export keeps the keys and blanks the values as it does a node’s
object
Id of the end node: one of the set’s nodes, or an existing node in this world. Nothing is created when no node has it
Relationship type: a letter, then up to 63 letters, digits or underscores
Accepted so an export loads back as written, and ignored
Name of the set, tagged on every node it loads; DELETE /samples/{name} removes it. Must not be blank
The records to load, at least one; ids must be unique within the set
One node of a sample set, as loaded by POST /samples and returned by POST /samples/export
object
Name the node is shown by; null leaves any name it already has. Null in a shape-only export
Identity of the node within its label in this world; loading merges on it, so loading a set again updates rather than duplicates. Edges name nodes by it. A shape-only export replaces it with n1, n2, …
The node’s label: a letter, then up to 63 letters, digits or underscores
Further property values set on the node, by key; a key starting with _ is refused. A shape-only export keeps the keys and blanks the values: text becomes …, numbers 0, lists item by item, booleans are kept
object
Name of the realm whose types the set populates. Must not be blank
Accepted so an export loads back as written, and ignored
Example generated
{ "edges": [ { "from": "example", "properties": { "additionalProperty": "example" }, "to": "example", "type": "example" } ], "matched": 1, "name": "example", "nodes": [ { "displayName": "example", "id": "example", "label": "example", "properties": { "additionalProperty": "example" } } ], "realm": "example", "truncated": true}Responses
Section titled “Responses”Loaded
What a sample-data load did, or why it refused. The same shape either way: a refusal is this with ok false and the reasons in problems
object
How many edges were written. Zero on a refusal
How many nodes were written. Zero on a refusal
Whether the set was loaded. False means nothing was written and problems says why
Why the load was refused, one sentence per problem. Empty when ok is true
The set was refused; the body lists why
What a sample-data load did, or why it refused. The same shape either way: a refusal is this with ok false and the reasons in problems
object
How many edges were written. Zero on a refusal
How many nodes were written. Zero on a refusal
Whether the set was loaded. False means nothing was written and problems says why
Why the load was refused, one sentence per problem. Empty when ok is true

