Graph Repository Query Language (GReQL)
Description
The Graph Repository Query Language (GReQL) is a query language for TGraphs, based on GRAL. GRAL is an object oriented Z-based specification language, also developed by our work group.
GReQL itself is easy to learn. Similar to SQL queries in relational databases, a typical GReQL query specifies the range of some free variables, poses GRAL conditions on these variables and finally describes the desired output.
The most powerful concept in GReQL are regular path expressions. A path expression describes a path in the graph. Path expressions can be used to test if pairs of nodes are connected via the specified path. A path expression also denotes the set of nodes which can be reached from a starting node via the path.
Features
- query results can be stored as plain text, as XML documents, or as HTML for direct visualization
- querying of graph properties (degree, acyclic tests, node/edge types)
- Basic mathematical functions and aggregations for statistics (sum, average, count)
- nested GReQL queries as sub-queries
- complex GRAL predicates with "existence" and/or "for all" quantors
- re-use of former query results as input for subsequent queries
Example
The following GReQL query is taken out of a program analysis context. Given two nodes caller and callee of type Identifier, the WITH part specifies in a regular path expression that these two nodes must be connected via a path of:
- one or more edges of class
isDeclaratorIn, - one edge of class
isCompoundStatementIn, - zero or more edges of class
isStmtIn, - and finally one edge of class
isFunctionNameIn.
FROM caller, callee: V{Identifier}
WITH
caller
-->{isDeclaratorIn}+
<--{isCompoundStatementIn}
<--{isStmtIn}*
<--{isFunctionNameIn}
callee
REPORT
caller.name AS Caller, callee.name AS Callee
END Note the stylized arrows and the class names in the path expression: Edge directions and classes, which are integral part of TGraphs, may be specified in a convenient way. Also grouping and alternatives known from standard regular expressions are supported.
Implementation
There are two different versions of GReQL. GReQL is based on the GraLab class library, GReQL 2 is based on the JGraLab class library. GReQL (2) provides many standard functions and allows to extend the language with complex algorithms and program defined functions.
- Commandline GReQL (CLG) is a stand-alone application with a small script language. CLG can be used to automate GReQL queries in batch jobs. Previous query results can be loaded processed by subsequent GReQL queries.
- Inline GReQL is a C++ class library to embed GReQL power into C++ source projects.
- GReQL 2 is a Java class library to embed GReQL 2 power into Java source projects. GReQL 2 is an equivalent of Inline GReQL.
- GReQLScript - the Java equivalent of CLG - is in development.
All mentioned GReQL versions are available on Linux and Microsoft Windows.
Using GReQL 2 one can access the schema of a graph, unlike GReQL.
Download and licensing
GReQL may be obtained free of charge for academic research and private projects. Commercial license available. Please contact Prof. Dr. Jürgen Ebert for further information.
Fields of Application
GReQL is currently used in our project GUPRO; GReQL 2 is used in ReDSeeDS.
Project Members
B 108
+49 261 287 -2722
ebert at uni-koblenz.de
B 015
+49 261 287 -2747
dbildh at uni-koblenz.de
B 121
+49 261 287-2706
riediger at uni-koblenz.de
B 015
+49 261 287 -2749
hschwarz at uni-koblenz.de
Publications
2008
- [Bildhauer2008ADT]
Daniel Bildhauer: Auswertung der TGraphanfragesprache GReQL 2. 2008. VDM Verlag Dr. Müller. Saarbrücken. - [Bildhauer2008QSA]
Daniel Bildhauer, Jürgen Ebert: Querying Software Abstraction Graphs. 2008. Working Session on Query Technologies and Applications for Program Comprehension (QTAPC 2008), collocated with ICPC 2008.
2006
- [Bildhauer2006EIF]
Daniel Bildhauer: Ein Interpreter für GReQL 2 - Entwurf und prototypische Implementation. 2006. Diplomarbeit. Universität Koblenz-Landau, Institut für Softwaretechnik. - [Marchewka2006G2]
Katrin Marchewka: GReQL 2. 2006. Diplomarbeit. Universität Koblenz-Landau, Institut für Softwaretechnik.
2003
- [Knebel2003GT]
Simon Knebel, Bernt Kullbach: GReQL Testanfragen. Universität Koblenz-Landau, Institut für Softwaretechnik. 2003. Projektbericht. Koblenz.
2001
- [Kamp2001GEA]
Manfred Kamp, Bernt Kullbach: GReQL - Eine Anfragesprache für das GUPRO-Repository - Sprachbeschreibung (Version 1.3). Universität Koblenz-Landau, Institut für Softwaretechnik. 2001. Projektbericht. Koblenz. - [Kullbach2001CLG]
Bernt Kullbach: Command Line GReQL (CLG). Benutzerhandbuch. CLG-Version 1.0. Universität Koblenz-Landau, Institut für Softwaretechnik. 2001. Projektbericht. Koblenz.
1998
- [Kamp1998GEA1]
Manfred Kamp: GReQL - eine Anfragesprache für das GUPRO-Repository. in Jürgen Ebert, Rainer Gimnich, H. Stasch, Andreas Winter: GUPRO -- Generische Umgebung zum Programmverstehen. 1998. kein Verlag zugeordnet. pp 173-202. - [Kamp1998GEA]
Manfred Kamp: GReQL - Eine Anfragesprache für das GUPRO-Repository - Sprachbeschreibung (Version 1.2). Universität Koblenz-Landau, Institut für Informatik. 1998. Fachberichte Informatik. Koblenz.
1997
- [Dahm1997ADG]
Peter Dahm: Architektur des GReQL-Auswerters. Universität Koblenz-Landau, Institut für Softwaretechnik. 1997. Projektbericht. Koblenz. - [Gabler1997FEF]
B. Gabler: FunBiG - Eine Funktionsbibliothek für GReQL. Universität Koblenz-Landau, Institut für Softwaretechnik. 1997. Projektbericht. Koblenz. - [Polock1997ESO]
David Polock: Ein statischer Optimierer für GRAL- und GReQL-Ausdrücke. Universität Koblenz-Landau, Institut für Softwaretechnik. 1997. Diplomarbeit. Koblenz.
1996
- [Kamp1996GEA]
Manfred Kamp: GReQL - eine Anfragesprache für das GUPRO-Repository 1.1. Universität Koblenz-Landau, Institut für Softwaretechnik. 1996. Projektbericht. Koblenz.
Kontakt