Skip to content

Read records out as a loadable sample set

POST
/api/v1/samples/export
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.

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

Media typeapplication/json

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
labels
required

Take records carrying any of these labels; empty means any label, which is allowed only with a source

Array<string>
limit
required

Most nodes to return, taken in id order; 500 when omitted

integer format: int32
mode
required

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

string
Allowed values: SHAPE_ONLY WITH_VALUES
name
required

Name to give the exported set

string
realm
required

Realm name to record on the exported set

string
source

Take only records the sample set of this name loaded. Required when labels is empty

string

The set

Media type*/*

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
edges
required

Relationships between exported nodes only, named by the ids used in nodes

Array<object>

One relationship of a sample set, between nodes named by id

object
from
required

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

string
properties
required

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
key
additional properties
to
required

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

string
type
required

Relationship type: a letter, then up to 63 letters, digits or underscores

string
matched
required

How many records the selection found before the limit was applied

integer format: int32
name
required

Name of the exported set, as the request gave it

string
nodes
required

The exported records in id order, at most the request’s limit, each under its first label other than the internal ones

Array<object>

One node of a sample set, as loaded by POST /samples and returned by POST /samples/export

object
displayName

Name the node is shown by; null leaves any name it already has. Null in a shape-only export

string
id
required

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, …

string
label
required

The node’s label: a letter, then up to 63 letters, digits or underscores

string
properties
required

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
key
additional properties
realm
required

Realm name recorded on the set, as the request gave it

string
truncated
required

True when the selection found more records than nodes holds

boolean