This article has multiple issues. Please helpimprove it or discuss these issues on thetalk page.(Learn how and when to remove these messages) (Learn how and when to remove this message)
|
| .QL | |
|---|---|
![]() | |
| Paradigm | multi-paradigm,logic-paradigm,object-oriented-paradigm |
| Developer | Semmle |
| First appeared | 2007 |
| Typing discipline | static,strong |
| Majorimplementations | |
| SemmleCode | |
| Influenced by | |
| Datalog | |
.QL (pronounced "dot-cue-el") is an object-oriented query language used to retrieve data from relationaldatabase management systems. It is reminiscent of the standard query languageSQL and the object-oriented programming languageJava. .QL is an object-oriented variant of a logical query language calledDatalog. 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 inSemmleCode to query a relational representation of Java programs.
.QL is developed at Semmle Limited and is based on the company's proprietary technology.
.QL has several language features to make queries concise, intuitive and reusable:
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:
fromClassc,intnumOfMethodswherenumOfMethods=count(Methodm|m.getDeclaringType()=candm.hasModifier("public"))andnumOfMethods>10selectc.getPackage(),c,numOfMethods
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.