Database Reference
In-Depth Information
Fig. 9.1 PhD students and their supervisors (tables and corresponding graph)
For each category, we will run several queries using the following example of a
PhD student database as shown in Fig. 9.1 . We will show how these graph database
languages support graph features (path, neighborhood, etc.).
9.2.2.1 Visual Query Languages
Visual query languages aim to provide the functionality of textual query languages
to users who are not technical database experts and also to improve the productivity
of expert database users [ 41 ]. In general, these languages allow users to draw a
query as a graph pattern with the help of a graphical interface. The result is the
collection of all subgraphs of the database matching the desired pattern [ 11 - 13 ].
G, G+, and GraphLog
G[ 12 ] is a visual query language based on regular expressions that allow simple
formulation of recursive queries. G enables users to pose queries, including transi-
tive closure, which is not expressible in relational query languages. A graphical
query Q (example Fig. 9.2 ) is a set of labeled directed multigraphs, in which the
node labels of Q may be either variables or constants, and the edge labels are
regular expressions defined over n-tuples of variables and constants. A path is exp-
ressed on a G query initially by the means of two types of edges: dashed edges
correspond to paths of arbitrary length in the graph and solid edges correspond to
paths of fixed length. In G, simple paths are traversed using certain non-Horn clause
constructs available in Prolog. However, it does not support cycles, find the short-
est path, or calculate node distance. Moreover, G does not support aggregation
functions.
G evolved into a more powerful language called G+ [ 13 ], in which a query graph
remains as the basic building block. A simple query in G+ has two elements, a
query graph that specifies the class of patterns to search, and a summary graph,
which represents how to restructure the answer obtained by the query graph. G+
provides primitive operators such as depth-first search, shortest path, transitive closure,
and connected components. It can easily find a regular simple path. The language
Search WWH ::




Custom Search