Note: You should first read Understanding Exhibit Database.
Recall that data in a Exhibit database can be represented as a graph, e.g.,
Exhibit expressions are mainly used to traverse such a graph. That is, given some nodes in the graphs, evaluating an Exhibit expression retrieves other nodes that are somehow related to the original nodes. For example, given the "The DaVinci Code" item node (the blue circle on the left in the graph above), evaluating .author.label returns "Dan Brown (writer)". Given the 6347343 value node, evaluating !number-of-copies-sold.author returns "Dan Brown".
At this time of writing, an Exhibit expression consists of a single path. A path consists of a sequence of one or more property IDs, each preceded by a hop operator. The . hop operator traverses along an arrow (forward) while the ! hop operator traverses against an arrow (backward).
Here are some more examples (you can imagine yourself how the data looks like as graphs):
- evaluating
.hasAuthor.teachesAt.locatedInon some papers returns the locations of the schools where the authors of those papers teach; - evaluating
.spouseOf!parentOfon some people returns their parents-in-laws. - evaluating
!shot!arrestedon John F. Kennedy returns the police officers who arrested his assassinator.
A path can also start with one of a few predefined variables, currently including
-
value(referring to the current item or value on which the expression is being evaluated) and -
index(referring to the index of the current item or value in a sequence of items or values)
value is understood if there is no such variable at the beginning of a path. That is, you can also write .spouseOf!parentOf as value.spouseOf!parentOf.
This is just the basic. Refer to this page for more advanced features.


