Difference between revisions of "Chess Query Language"

From Chessprogramming wiki
Jump to: navigation, search
Line 1: Line 1:
 
'''[[Main Page|Home]] * [[Chess]] * Chess Query Language'''
 
'''[[Main Page|Home]] * [[Chess]] * Chess Query Language'''
  
The '''Chess Query Language''' (CQL) is a structured [https://en.wikipedia.org/wiki/Query_language 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-2019 and is free. The current version is '''6.0''' and the documentation and download of the executable can be found on the website of Gady Costeff <ref>[http://gadycosteff.com/cql/index.html CQL Introduction] by [[Gady Costeff]]</ref>.
+
The '''Chess Query Language''' (CQL) is a structured [https://en.wikipedia.org/wiki/Query_language 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-2021 and is free. The current version is '''6.1''' and the documentation and download of the executable can be found on the website of Gady Costeff <ref>[http://www.gadycosteff.com/cql/ CQL Introduction] by [[Gady Costeff]]</ref>.
  
 
=Sample query=  
 
=Sample query=  

Revision as of 21:10, 20 June 2021

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-2021 and is free. The current version is 6.1 and the documentation and download of the executable can be found on the website of Gady Costeff [1].

Sample query

[2] [3]

;; 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