Database Reference
In-Depth Information
Fig. 9.2 G query to find students and supervisors and query GraphLog query to find all students
working on Ontology
Fig. 9.3 Hypernode database schema and instance
also contains aggregate operators that allow the path length and node degree to
be found. The graph-based query language G+ provided a starting point for Graph-
Log [ 14 ]. GraphLog differs from G+ with a more general data model, the use of
negation, and the computational traceability. GraphLog queries are graph patterns
that ask for patterns that must be present or absent in the database graph. Edges in
queries represent edges or paths in the database. Each pattern defines a set of new
edges (i.e., a new relation) that are added to the graph whenever the pattern is found.
An edge used in a query graph either represents a base relation or is itself defined in
another query graph. GraphLog supports computing aggregate functions and sum-
marizing along paths. Figure 9.2 shows an example of a GraphLog query.
Hyperlog
Hyperlog [ 15 ] is a declarative query and update language for the Hypernode Model
(Fig. 9.3 ). It visualizes schema information, data, and query output as sets of nested
graphs, which can be stored, browsed, and queried in a uniform way.
A hyperlog query consists of a number of graphs (templates), which are matched
against the hypernodes and generate graphical output.
The user chooses which variables in the query should have their instantiations
output in the query result. Hyperlog programs contain sets of rules. The body of a
rule is composed of a number of queries, which may contain variables. The head of a
rule is also a query and indicates the updates (if any) to be undertaken for each match
of the graphs in the body. In order to illustrate the template and the query in the
Hyperlog query language, we give an example in Fig. 9.4 : the template can find the
Search WWH ::




Custom Search