Chess match database manager V
This post is the fifth in a series of articles about the ChessPosDB application, which allows you to store many chess games in different professional database engines and search for them with a wide variety of options. You can download the program using this link. Here is the link to the first article in this series if you want to start from the beginning. Here, I will show how to query the database with the filters explained in the previous ones. We will also see the chess match editing options, which allow adding comments and new tags.
Querying the database
You must have defined the criteria to select the chess matches before querying the database. To do this, you have to build filters to define these search conditions, such as a specific position, movement, or a series of movements. You can store collections with multiple filters in XML files. Therefore, the first step will be to open one of these files with the File menu options or create a new filter using the editors in the Database menu.
Once you have the filters, you can open the query window using the New Query option in the Database menu:
The query window has several panels and looks like this:
As you can see, it is very similar to the PGN file integration window that we saw in the first article. There is a list for the query results, a chessboard, and a panel of moves to play the chess matches. Below the chessboard, there is a textbox where you to add comments to the current position/movement by pressing the New Comment button, typing the text, and pressing the OK button, or Cancel to discard the commentary. There is also a list of all the chess match tags and their values.
In the toolbar above the game list are the available commands:
The drop-down list shows all the available filters in the current collection, and the button to the left of the drop-down list is to refresh this list when you add new filters or open a new file with another collection. The query button is disabled until you select one of the filters, then you can launch the query:
When the query finishes, you can see the list of chess matches found, and use the rest of the command buttons on the toolbar:
The first button to the left of the query button will remove the selected chess match from the result list, but not from the database. The button with a chessboard icon displays the selected chess match, as in the PGN files integration window. In this case, the purple movements in the movement panel are those that meet the filter conditions; the other movements follow the colour code explained in the first article:
In this example, the selected filter is: First, a queen captures a rook, and, in one of the next four moves, a queen captures the other queen.
With the next button from left to right, you can add new tags to the selected chess matches using the following dialog box:
You can select an existing keyword by selecting it in the Keyword drop-down list or type a new keyword name and press the Add button. Then, type the label value in the Value text box.
With the next two buttons, you can edit the selected chess match labels and comments, as we will see later. Both buttons will open a similar editor, but you can find other chess matches with the same position for each selected position with the second one. We will also see this later.
The next button allows you to delete the selected games from the database, although it will first show a warning message to proceed or cancel the operation.
The last two buttons allow you to export the selected chess matches. The first one will copy the matches to another database; this option is only useful if you want to change the current database engine for a different one. You have to select the target database in the drop-down list; we will see how to configure databases in the next article. With the second button, you can save the selected chess matches in a PGN file:
Chess match editor
The chess match editor window is a query tool for adding comments to the movements or positions and modifying a chess match's tags. You can do this directly from the query window itself, so it is just an alternative with a different interface:
In the edit panel, there are the following controls:
You can select one of the chess match's tags in the Keyword drop-down list to modify its value. It is also possible to delete the selected tag or add a new one. You can edit the main keywords (Match, White, Black, Date, and Result) separately. You can see all the current movement/position comments, if any, in the Comments list, and you can modify them or add new ones using the text box below this list. There are two buttons at the bottom left of the panel to save all the changes or cancel them all.
Chess match player
The chess match player window is similar to the previous editor. Here, there is a new panel that allows querying the database to find other matches with a position equal to the current one and view the next movements:
In the lower-left panel, you can launch this query and obtain a list of results:
You can specify how many movements from the current position you want to show and the result of the chess matches you want to find. You can launch the query using the first button on the toolbar, with the binoculars icon, and you can view the selected match in another window using the button with the chessboard icon. Below the list, there are the thumbnails of the first positions of the chosen chess match.
Creating a new chess match
You can create a new chess match by entering its movements one by one. To do this, use the New Match option in the Database menu:
You have to type the chess match main tags values in the dialog box:
Then, the chess match player window that we have seen in the previous point will open. You can enter the movements of the chess match one by one in the movements panel:
You can add a new movement using the first button to the left of the text box. With the second button, you can delete the last movement. The application will check that the movements entered are valid. The notation must be the same as that in the PGN format.
Consolidating label values
When integrating games in PGN format, we are likely to use files from many different sources. For this reason, the same labels can have slightly different values to refer to the same concept, such as the name of a player or a place. You can use the option Consolidate Keyword Values in the Database menu to unify all these values giving a unique text for all of them:
The following dialog box allows you to carry out this operation:
When you select a keyword, the list on the left side will show all its values. You can apply a filter to show only the values of interest, typing the text in the text box below the list and clicking the button with the magnifying glass. You can select one of the values as the canonical one or type a new canonical value in the corresponding text box. In the list on the right, you can see the values to change by the canonical one. You can also apply a filter to keep only the ones you want to change. When you click the Consolidate button, all the selected values in the list on the right will change to the canonical value.
Export the database
You can export all the chess matches from one database to a different one using the Export Database option in the Database menu:
You can export the data to any database that the application can connect to. You can also save the data in binary files that you can import later on other computers using the File menu import options.
You have to select the destination database or the generic option to export the data to a series of binary files. You have to provide the number of chess matches to export in each block or file in the corresponding text box. You can also select not to export the duplicated chess matches (all their movements and positions are the same). This operation can take many hours if you have many chess matches in the database.
With this, we finish the application options review. In the next article, I will show how to install the database on each of the supported database servers.
Until next time, thanks for reading!