metadataThe following filters match game metadata: information about a game that does not depend on an particular position:
||ELO of player is in specified range|
||argument matches PGN event field|
||game number lies in range|
||argument matches specified player name|
||game result equal to argument|
||argument matches site field of game in PGN header|
||year of game is in range|
Metadata filters in the CQL headerEach of these can be specified in the CQL header, not just the body, e.g.
cql(input mega.pgn player white "Kasparov" elo black 2500 3000 year 1980 1989) matewould find all games in which Kasparov, playing white, mated an opponent rated at least 2500 in the decade of the 1980s.
This has the same effect as putting the filters in the body, like this:
cql(input mega.pgn) player white "Kasparov" elo black 2500 3000 year 1980 1989 mate )The first formulation has the minor advantage of not testing the metadata filters at each position.
Metadata filters on the command lineThe
playerfilters can be specified on the command line as well using the appropriate options. For example, to run CQL on only games 10 through 100, use
cql --gamenumber 10 100 cql_filenamewhere cql_filename is the filename of the
.cqlfile containing the CQL commands.
See the command line options for more information on using the command line.
Sorting metadata filtersEach of the metadata filters that accept a range is sortable. The sort can be specified either in the CQL header or in the CQL body. For example, to sort games after 2000 by year, use
cql (input mega.pgn sort year 2000 2017)