Skip to main content

Elements

Elements are the nodes and relations of the graph. Every element has an id, a type (the node label or relation type) and data, its properties. Relations additionally have a start and an end node. An element can have one file, which can be uploaded at once or in chunks with a resumable upload. The schema of its type validates the properties of an element, and the access model decides who can read and write it.

The properties are stored in several databases internally, see databases. This is invisible when using the element endpoints, but matters when writing search steps which target one of the databases directly, e.g. a Cypher path query.

Special fields

A handful of fields are managed by the API and always written the same way:

FieldNeo4jMongoDBElasticsearch
idproperty_id (document identifier)_id (document identifier)
typelabel / relation typecollection nameindex name
namepropertypropertyfield
createdAtnative DateTimeUTCDateTimedate (sent as an RFC 3339 string)
createdByproperty (id of the user)property (id of the user)field (id of the user)
updatedAtnative DateTimeUTCDateTimedate (sent as an RFC 3339 string)
updatedByproperty (id of the user)property (id of the user)field (id of the user)
hasFilebooleanbooleanboolean

The type of nodes (their label) and relations has to start with a letter, followed by up to 127 letters, digits or underscores (^[A-Za-z][A-Za-z0-9_]{0,127}$); other values are rejected with 400 Bad Request. New types additionally follow a casing rule: node labels are written in UpperCamelCase (SavedSearch) and relation types in SCREAMING_SNAKE_CASE (HAS_FILE). Types which exist already keep their names, see names.

createdAt and updatedAt are timestamps maintained automatically by the server. createdBy and updatedBy are the ids of the users who created or last changed the element, also maintained by the server. In responses, these four properties are located together at the end of data, in the order createdAt, createdBy, updatedAt, updatedBy. hasFile is a cheap boolean mirror of whether an element currently has a file attached, kept alongside the element data itself so collection and search listings can show it without the more expensive file metadata lookup. For the full list of properties which the API reserves from direct writes, see reserved properties.

Null values

Setting a property to null does not store a null value, it deletes the property. This also applies when replacing an element, where any existing property not mentioned in the request body is treated as if it had been set to null. See also PATCH /<uuid>.

Empty objects and lists

The values of properties keep their JSON shape on every level: an empty object is returned as {} and an empty list as [], they are never converted into each other. A property written as {"a": {}, "b": [], "c": {"d": {}}} is read back exactly like that, also in collections, in search results with element hydration, in backups and in the properties of the schema of a type, which are {} if the schema defines no properties. Where an empty object is valid, e.g. for an object property, [] is accepted as well and stays a list.

Geo values

Properties which the schema defines as one of the geo types are returned as GeoJSON by default, or as WKT if the request sends Prefer: geometry=wkt, see response format.