Read records out as a loadable sample set
const url = 'http://localhost:11044/api/v1/samples/export';const options = { method: 'POST', headers: {'X-Embabel-Api-Key': '<X-Embabel-Api-Key>', 'Content-Type': 'application/json'}, body: '{"labels":["example"],"limit":1,"mode":"SHAPE_ONLY","name":"example","realm":"example","source":"example"}'};
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/export \ --header 'Content-Type: application/json' \ --header 'X-Embabel-Api-Key: <X-Embabel-Api-Key>' \ --data '{ "labels": [ "example" ], "limit": 1, "mode": "SHAPE_ONLY", "name": "example", "realm": "example", "source": "example" }'Returns exactly the body POST /samples accepts, so an exported file can be loaded elsewhere with no translation. Select by source (what one sample set loaded) or by labels, or both; labels alone take every record of that type in the world. Defaults to shape-only: labels, property keys and edges, with the values and ids replaced. Ask for WITH_VALUES deliberately — a support case rarely needs them, and ids are routinely email addresses.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”What to read out. name and realm (required) are copied onto the exported set. labels selects records carrying any of them (empty means any label) and source only the records that sample set loaded; at least one of the two is required. limit caps the nodes returned, in id order (default 500, not clamped). mode is SHAPE_ONLY (the default; values and ids replaced) or WITH_VALUES (verbatim). Only edges between exported nodes are included, and matched/truncated in the answer say whether the limit cut the selection
Body of POST /samples/export: which records of this world to read out as a loadable sample set, and how much of their content to keep
object
Take records carrying any of these labels; empty means any label, which is allowed only with a source
Most nodes to return, taken in id order; 500 when omitted
SHAPE_ONLY (the default) keeps labels, property keys and edges, replaces ids, drops display names and blanks values; WITH_VALUES keeps ids, display names and values verbatim. Internal properties are left out either way
Name to give the exported set
Realm name to record on the exported set
Take only records the sample set of this name loaded. Required when labels is empty
Responses
Section titled “Responses”The set
Answer of POST /samples/export: the selected records as a sample set in the body POST /samples accepts, and whether the limit cut it short
object
Relationships between exported nodes only, named by the ids used in nodes
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
How many records the selection found before the limit was applied
Name of the exported set, as the request gave it
The exported records in id order, at most the request’s limit, each under its first label other than the internal ones
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
Realm name recorded on the set, as the request gave it
True when the selection found more records than nodes holds

