Q & A
This is a conversational introduction to ZGL.
What is ZGL?
How do you pronounce ZGL?
Like “seagull” but with a “z”.
Is ZGL an acronym?
Yes, it stands for the Z Graph Language.
What is a graph?
For example, here is a graph with 4 nodes and 3 edges:
What is a graph definition language?
A language that defines graphs, as opposed to querying7 them.
Does ZGL support queries?
Not at this time, but it may in the future.
What does for humans mean?
It means ZGL is convenient for humans to read and write.
What kind of graphs does ZGL support?
ZGL supports z graphs9, which generalize many kinds of graphs.
What is a z graph?
This is the first I've heard of a z graph.
Right, it is a new term. I made it up.
Why “z”? What does it mean?
Not all questions have answers.
Fair enough. What does directed mean?
Ok, what is a multigraph?
What is a loop?
Remind me of the last part of the z graph9 definition?
Thanks. What is a value?
Would you give advance warning if you were planning to give an hour-long talk about ADTs?
I don't have such a talk prepared. But if I did, I'd be happy to invite you. Thanks for asking!
That's not exactly what I mean. If I understand ADTs, perhaps I can skip ahead?
Sure, if so, feel free to jump ahead to Why does ZGL use ADTs instead of data structures?24.
What is an abstract data type?
An abstract data type (ADT) defines the interface for a data structure20.
Can you give an example of an ADT?
Sure. For example, let's define a Map ADT, which provides a mapping between keys and values. It has these operations:
- new : create a new Map
- clone : make a copy of an existing Map
- get : lookup a key and return its value, if present
- insert : insert a (key, value) pair
These operations define the ADT's interface. Because it is an ADT, Map does not specify a concrete representation, such as a memory layout.
What is a data structure?
A data structure is a particular way of organizing data for particular types of operations.
How do data structures compare with ADTs?
Who invented the ADT?
Can you give more ADT examples?
|list||array, linked list|
|map||association list, B-tree, hash table|
|graph||adjacency list, adjacency matrix, incidence matrix|
Why does ZGL use ADTs instead of data structures?
But what if I want to specify a data structure?
Interesting; I'd like to hear more about your use case(s). Let's move the discussion to the ZGL forum.
Only a little bit more to go to unpack the z graph9 definition!
Ok, what is a node?
What is an entity?
In ZGL, each entity name is aliased to an (unknown) entity id. The entity id cannot be used directly.
/person/Romain_Collin are entity names.
Note: it is convenient to say entity to mean entity name.
What is an edge?
In ZGL, an edge connects a source node and a target node. Like nodes, any value16 may be used as an edge.