.QL
From Wikipedia, the free encyclopedia
.QL | |
---|---|
Paradigm | multi-paradigm,logic-paradigm,object-oriented-paradigm |
Appeared in | 2007 |
Developer | Semmle |
Typing discipline | static, strong |
Major implementations | SemmleCode |
.QL [ˈdotˈkjuˈɛl] is an object-oriented query language used to retrieve data from relational database management systems. It is reminiscent of the standard query language SQL and the object-oriented programming language Java. .QL is an object-oriented variant of a logic programming language known in the databases community as Datalog. Hierarchical data can therefore be naturally queried in .QL in a recursive manner.
Queries written in .QL are optimised, compiled into SQL and can then be executed on any major relational database management system. .QL query language is being used in SemmleCode to query a relational representation of Java programs.
.QL is developed at Semmle Limited and is based on the company's proprietary technology.
Contents |
[edit] Language Features
.QL has several language features to make queries concise, intuitive and reusable:
- Extensible type hierarchy
- Methods and predicates
- Definition before use
[edit] Example query
The sample query below illustrates use of .QL to query a Java program. This is how one would select all classes that contain more than ten public methods:
from Class c, int numofm where numofm = count(Method m| m.getDeclaringType()=c and m.hasModifier("public")) and numofm > 10 select c.getPackage(), c, numofm
In fact, this query selects not only all classes with more than ten public methods, but also their corresponding packages and the number of methods each class has.
[edit] See also
- SQL - Structured Query Language
- OQL - Object Query Language
- Datalog - logic programming language
- SemmleCode - Software testing tool that uses .QL language
[edit] References
- Hervé Gallaire and Jack Minker. Logic and Databases. Plenum Press, New York,1978.
- Serge Abiteboul and Paris C. Kanellakis. Object identity as a query language primitive. In SIGMOD Rec, pages 159-173, ACM Press, 1989.
- Oege de Moor, Elnar Hajiyev and Mathieu Verbaere. Object-oriented queries over software systems. In proceedings of the 2007 ACM SIGPLAN symposium on Partial evaluation and semantics-based program manipulation, page 91, ACM Press, 2007.
[edit] External links
- .QL language reference
- Semmle Limited creators of .QL
|