Syntax Example Explanation
Edges. Edges between nodes are notated with an arrow. Comments are prefixed with a #.
# All edges:
A -> B
A list of every edge in the haystack graph.
Negated edges. Edges that must not exist in the motif are notated with a negated arrow.
A -> B
B ~> A
A list of every edge in the haystack graph for which the reciprocal edge does not exist.
Edge types. Edges may have "type" as well as an existence annotation. Edge type is indicated with square brackets:
A -[inhibits] B
B ~[excites] A
Every two nodes (A, B) in the graph for which A inhibits B and B does not excite A.
Macros. Macros can be used to template repeated complex structure in a motif:
# Nodes that are connected in only one direction:
unidirectional(n, m) {
    n -> m
    m ~> n
}
# All triangles for which edges exist in only one direction:
unidirectionalTriangle(x, y, z) {
    unidirectional(x, y)
    unidirectional(y, z)
    unidirectional(z, x)
}

unidirectionalTriangle(A, B, C)
unidirectionalTriangle(C, D, E)
Graphs with unidirectional triangles between A, B, C and C, D, E.