-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathGEOFF
More file actions
39 lines (31 loc) · 1.55 KB
/
GEOFF
File metadata and controls
39 lines (31 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
Geoff Syntax Specification
==========================
document := subgraph (_ boundary _ subgraph)*
boundary := "~~~~"
subgraph := [element (_ element)*]
element := comment | hook | path
comment := "/*" <<any text excluding sequence "*/">> "*/"
hook := ":" ~ label [~ ":" ~ key] ~ ":" "=>" node
path := node (forward_path | reverse_path | two_way_path)*
forward_path := "-" relationship "->" node
reverse_path := "<-" relationship "-" node
two_way_path := "<-" relationship "->" node
node := named_node | anonymous_node
named_node := "(" ~ node_name [label_list] [_ property_map] ~ ")"
anonymous_node := "(" ~ [label_list] [_ property_map] ~ ")"
relationship := "[" ~ ":" type ["!" [key]] [_ property_map] ~ "]"
label_list := ":" label ["!" key] (":" label)*
label := name | JSON_STRING
property_map := "{" ~ [key_value (~ "," ~ key_value)* ~] "}"
node_name := name | JSON_STRING
name := (ALPHA | DIGIT | "_")+
type := name | JSON_STRING
key_value := key ~ ":" ~ value
key := name | JSON_STRING
value := array | JSON_STRING | JSON_NUMBER | JSON_BOOLEAN | JSON_NULL
array := empty_array | string_array | numeric_array | boolean_array
empty_array := "[" ~ "]"
string_array := "[" ~ JSON_STRING (~ "," ~ JSON_STRING)* ~ "]"
numeric_array := "[" ~ JSON_NUMBER (~ "," ~ JSON_NUMBER)* ~ "]"
boolean_array := "[" ~ JSON_BOOLEAN (~ "," ~ JSON_BOOLEAN)* ~ "]"
* Mandatory whitespace is represented by "_" and optional whitespace by "~"