Artefact.Cypher (Artefact v0.1.1)

Copy Markdown View Source

Derives Cypher from an %Artefact{}.

Lossy: position and style are not represented in Cypher.

Summary

Functions

Emit a Cypher CREATE statement — always creates new nodes.

Emit a parameterised Cypher CREATE — returns {cypher, params} for driver use (e.g. Bolty).

Emit an inline Cypher MERGE string — upserts without twins, pasteable into Neo4j Browser.

Emit parameterised Cypher MERGE — returns {cypher, params} for driver use (e.g. Bolty).

Functions

create(artefact)

Emit a Cypher CREATE statement — always creates new nodes.

Nodes are emitted first with their Arrows id as a Cypher variable, ensuring nodes shared across multiple relationships are created once. Relationships follow, referencing those variables.

create_params(artefact)

Emit a parameterised Cypher CREATE — returns {cypher, params} for driver use (e.g. Bolty).

merge(artefact)

Emit an inline Cypher MERGE string — upserts without twins, pasteable into Neo4j Browser.

Each node is merged on its uuid; labels and properties are SET afterwards.

merge_params(artefact)

Emit parameterised Cypher MERGE — returns {cypher, params} for driver use (e.g. Bolty).