This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these template messages) This article includes a list of references, related reading, or external links, but its sources remain unclear because it lacks inline citations. Please help improve this article by introducing more precise citations. (December 2012) (Learn how and when to remove this message) The topic of this article may not meet Wikipedia's general notability guideline. Please help to demonstrate the notability of the topic by citing reliable secondary sources that are independent of the topic and provide significant coverage of it beyond a mere trivial mention. If notability cannot be shown, the article is likely to be merged, redirected, or deleted.Find sources: ".QL" – news · newspapers · books · scholar · JSTOR (December 2012) (Learn how and when to remove this message) (Learn how and when to remove this message)
.QL
Paradigmmulti-paradigm, logic-paradigm, object-oriented-paradigm
DeveloperSemmle
First appeared2007
Typing disciplinestatic, strong
Major implementations
SemmleCode
Influenced by
Datalog

.QL (pronounced "dot-cue-el") 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 logical query language called 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.

Language features

.QL has several language features to make queries concise, intuitive and reusable:

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 numOfMethods
 where numOfMethods = count(Method m| m.getDeclaringType()=c 
                      and m.hasModifier("public"))
       and numOfMethods > 10
 select c.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.

See also

References