In a custom grammar, I want to write a few lines of Cypher which let me reference a nickname within the scope of this set of statements.
For example, I want this Aspen
default:
attributes:
Event: title
grammar:
-
match:
- (Person a) and (Person b) met through Graphs4Good.
- (Person a) met (Person b) at Graphs4Good.
template: |
{{{a}}}<-[:INCLUDES]-({{{intro:uniq}}}):Introduction)-[:INCLUDES]->{{{b}}}
({{{intro:uniq}}})-[:OCCURRED_AT]->(Event { title: "Graphs4Good Kickoff" })
{{{a}}}-[:KNOWS]-{{{b}}}
----
(Karin) [organized] (Event, Graphs4Good Kickoff)
Matt and Alyssa met through Graphs4Good.
Alyssa met Joel at Graphs4Good.
As you can see, the nickname identifier is unique to each evaluation of the template. We can reference the nickname as a string value anywhere in the template, taking care to wrap it in parens when we reference it as a node: ({{{intro:uniq}}})-[:AND_SO_FORTH]->
The convention could be an slug (here, intro), followed by :uniq to indicate it should autoincrement the nickname to preserve uniqueness.
In a custom grammar, I want to write a few lines of Cypher which let me reference a nickname within the scope of this set of statements.
For example, I want this Aspen
to include this Cypher:
As you can see, the nickname identifier is unique to each evaluation of the template. We can reference the nickname as a string value anywhere in the template, taking care to wrap it in parens when we reference it as a node:
({{{intro:uniq}}})-[:AND_SO_FORTH]->
The convention could be an slug (here,
intro
), followed by:uniq
to indicate it should autoincrement the nickname to preserve uniqueness.