Difference between revisions of "Chess Query Language"

From Chessprogramming wiki
Jump to: navigation, search
(Created page with "'''Home * Chess * Chess Query Language''' The '''Chess Query Language''' (CQL) is a structured [https://en.wikipedia.org/wiki/Query_language query language]...")
 
Line 44: Line 44:
 
=External Links=  
 
=External Links=  
 
* [http://www.gadycosteff.com/cql/doc/introduction.html CQL Introduction] by [[Gady Costeff]]
 
* [http://www.gadycosteff.com/cql/doc/introduction.html CQL Introduction] by [[Gady Costeff]]
 +
* [http://www.arves.org/arves/index.php/en/magazine-eg/chess-query-language-5 Chess Query Language 5] from [https://de.wikipedia.org/wiki/ARVES ARVES]
 
* [https://web.archive.org/web/20140130143815/http://www.rbnn.com/cql/ CQL Manual] hosted by the [https://en.wikipedia.org/wiki/Internet_Archive Internet Archive]
 
* [https://web.archive.org/web/20140130143815/http://www.rbnn.com/cql/ CQL Manual] hosted by the [https://en.wikipedia.org/wiki/Internet_Archive Internet Archive]
 
* [http://www.xs4all.nl/~timkr/chess2/cql.htm Chess Query Language] from [https://en.wikipedia.org/wiki/Tim_Krabb%C3%A9 Tim Krabbé's] Chess Site
 
* [http://www.xs4all.nl/~timkr/chess2/cql.htm Chess Query Language] from [https://en.wikipedia.org/wiki/Tim_Krabb%C3%A9 Tim Krabbé's] Chess Site

Revision as of 11:36, 22 August 2018

Home * Chess * Chess Query Language

The Chess Query Language (CQL) is a structured query language to search for games, problems, and studies that match specific themes from a collection in Portable Game Notation. CQL was developed by Gady Costeff and Lewis Stiller. It is Copyright (c) 2003-2018 and is free. The CQL Manual is hosted by the Internet Archive [1] [2] .

The current version is 5.1 and the documentation and download of the executable can be found on the website of Gady Costeff [3].

Sample query

[4] [5]

;; look for positions where a rook circles in a 4x3 rectangle
;; we use the rectangle g2, d2, d6, g6 together with shift and flip
;;
(match :pgn input.pgn
       :output output.pgn
       :forany piece [Rr]
       (position
        $piece[g2]
        :and (
              (position :gappedsequence ((position :movefrom $piece[g6,d2] :moveto ?g2)))
              (position :gappedsequence ((position :movefrom $piece[d6,g2] :moveto ?d2)))
              (position :gappedsequence ((position :movefrom $piece[d6,g2] :moveto ?g6)))
              (position :gappedsequence ((position :movefrom $piece[g6,d2] :moveto ?d6)))
             )
        :shift
        :flip
       )
)

See also

Publications

Forum Posts

External Links

References

Up one Level