Grammar Overview

ZGL is a data interchange language (also known as a data exchange language).

Here is an example-based overview to ZGL:

element example(s) note
boolean true   false
integer 23   0x17   0b10001
float 2.7182   3.0e8
string "a gifted raconteur"
#"dijo "¡cuidado!"#
date 2021-03-18
datetime 2021-03-18T16:31:00-04:00
URL https://www.zg-lang.org
expression delimiter , 
list [5, 12, "thirteen"] 
set #{"Picard", "Ryker", "Data"} 
map {"x": 3, "y": 4, "z": 5} 
quantity <2.54 cm>   <1.21 gigawatts>
variable born_in
entity name /person/Mark_Twain
path core   ::units::metric
item terminator ;
use :use ::history::Roman;
bind π = 3.14159;
ZGL = /language/Z_Graph_Language;
alias :alias /person/FDR /person/Franklin_Delano_Roosevelt;
graph ZGL homepage https://www.zg-lang.org ; 
graph with group
π is {
  /math/real_number,
  /math/irrational_number,
};

Notes

①  URLs must be terminated with whitespace.  See decision log.

②  Trailing commas are allowed.

③  Lists, sets, and maps are heterogenous collections.

④  Quantities are scalars.

⑤  = immutably binds a value to a variable.

⑥  Entity ids cannot be accessed directly.  If you want two entity names to point to the same entity id, use :alias.

⑦  Zero or more entity names may be aliased to each entity id.  In other words, not all entity ids have corresponding entity names.

Last update:
2021-03-26