### Repository https://github.com/programarivm/pgn-chess  PGN Chess is a simple, friendly, and powerful PGN (Portable Game Notation) library for running chess games from within PHP applications. It is a chess board representation that can be used in chess engines, chess applications and chess algorithms. ### New Features [Feature/db seed #6](https://github.com/programarivm/pgn-chess/pull/6) is a new command that searches for valid games in a PGN file and seeds the PGN Chess database accordingly: - `db-seed.php` Example: ``` php db-seed.php Alekhine.pgn This will search for valid PGN games in the file. Large files (for example 50MB) may take a few seconds to be inserted into the database. Do you want to proceed? (Y/N): y Good! This is a valid PGN file. 3201 games were inserted into the database. ``` Now, you can get information from a particular player, Elo ranges, FIDE titles, or any other imaginable combination of properties as shown in the following example. ``` SELECT * FROM games WHERE White LIKE '%Alekhine%' AND Eco='C50'; ``` > Remember: the games are syntactically valid. This cool feature is intended to add knowledge/intelligence to the PGN Chess system in the medium term. For further information please visit section [4. Command Line Interface (CLI)](https://github.com/programarivm/pgn-chess#4-command-line-interface-cli) ### Technology Stack - PHP - PDO - MySQL ### Roadmap The next thing to do is to write and share an amazing post on how to easily load tons of games into a chess database for multiple purposes! The feedback generated will help to spot bugs and improve the current features. Who knows, perhaps at some point we could even use PGN Chess to create an open chess database as discussed at [Let's create a free, open, chess database](https://www.reddit.com/r/chess/comments/1559f8/lets_create_a_free_open_chess_database/). I already shared this roadmap on the Google+ community [Chess](https://plus.google.com/+Programarivm/posts/7eNXWrSJWSq). Also, a database seeded with millions of chess games allows to train a machine learning model through a SQL interface as it is described next. Command line: php ml-train-naive-bayes.php naive-bayes.txt PHP code: ``` use PGN\MachineLearning\NaiveBayesTrainer; require_once __DIR__ . '/../../vendor/autoload.php'; (new NaiveBayesTrainer($argv[1]))->train('SELECT * FROM games'); ``` ### Would you help make this library better? Contributions are welcome. - Feel free to send a pull request - Drop an email at info@programarivm.com with the subject "PGN Chess Contributions" - Leave me a comment on [Twitter](https://twitter.com/programarivm) - Say hello on [Google+](https://plus.google.com/+Programarivm) Many thanks. ### GitHub Account https://github.com/programarivm
author | programarivm |
---|---|
permlink | seed-a-sql-database-with-pgn-games |
category | utopian-io |
json_metadata | {"tags":["utopian-io","development","chess","php"],"image":["https://cdn.steemitimages.com/DQmSZXHw9vKjUhbeNMM6NzVkEyTsLYgsqxQR4F7Ecwg2RAV/eer-database.jpg"],"links":["https://github.com/programarivm/pgn-chess","https://github.com/programarivm/pgn-chess/pull/6","https://github.com/programarivm/pgn-chess#4-command-line-interface-cli","https://www.reddit.com/r/chess/comments/1559f8/lets_create_a_free_open_chess_database/","https://plus.google.com/+Programarivm/posts/7eNXWrSJWSq","https://twitter.com/programarivm","https://plus.google.com/+Programarivm","https://github.com/programarivm"],"app":"steemit/0.1","format":"markdown"} |
created | 2018-08-21 16:40:21 |
last_update | 2018-08-22 21:19:42 |
depth | 0 |
children | 6 |
last_payout | 2018-08-28 16:40:21 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 21.401 HBD |
curator_payout_value | 6.995 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 2,904 |
author_reputation | 2,631,258,794,707 |
root_title | "Seed a SQL Database with PGN Games" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 68,932,258 |
net_rshares | 20,668,164,471,715 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
azizbd | 0 | 29,601,665,058 | 30% | ||
yuxi | 0 | 3,034,483,100 | 10% | ||
helo | 0 | 26,448,943,048 | 100% | ||
doughtaker | 0 | 10,961,266,911 | 50% | ||
rafalski | 0 | 16,470,272,675 | 42% | ||
utopian-io | 0 | 19,609,762,088,232 | 28.32% | ||
favcau | 0 | 25,840,005,413 | 50% | ||
steemtaker | 0 | 2,295,380,860 | 6% | ||
jahedkhan | 0 | 92,414,268 | 3% | ||
idontgnu | 0 | 135,033,205 | 12% | ||
amosbastian | 0 | 33,919,902,216 | 51.49% | ||
grzesiekb | 0 | 130,381,131,229 | 100% | ||
guangzhoulife | 0 | 187,360,172 | 12% | ||
voyagesofcarla2 | 0 | 219,595,061 | 6% | ||
cjd | 0 | 167,130,149 | 12% | ||
reazuliqbal | 0 | 29,136,631,936 | 100% | ||
properfraction | 0 | 760,179,871 | 100% | ||
umich | 0 | 1,230,954,364 | 12% | ||
statsexpert | 0 | 3,614,651,997 | 60% | ||
quochuy | 0 | 24,508,916,254 | 100% | ||
plgonzalezrx8 | 0 | 441,429,504 | 12% | ||
soundworks | 0 | 211,877,722 | 9.29% | ||
tanzil2020 | 0 | 179,269,303 | 50% | ||
mightypanda | 0 | 19,023,967,631 | 100% | ||
boomtube | 0 | 609,730,502 | 100% | ||
avengersayem2 | 0 | 556,693,127 | 100% | ||
gamerbd | 0 | 558,751,849 | 100% | ||
steem-ua | 0 | 697,814,746,058 | 29.61% |
* Good use of try/catch, and object programming in general * You have renamed many files, can you explain why?  Your contribution has been evaluated according to [Utopian policies and guidelines](https://join.utopian.io/guidelines), as well as a predefined set of questions pertaining to the category. To view those questions and the relevant answers related to your post, [click here](https://review.utopian.io/result/3/3321112). ---- Need help? Write a ticket on https://support.utopian.io/. Chat with us on [Discord](https://discord.gg/uTyJkNm). [[utopian-moderator]](https://join.utopian.io/)
author | helo |
---|---|
permlink | re-programarivm-seed-a-sql-database-with-pgn-games-20180822t162914965z |
category | utopian-io |
json_metadata | {"tags":["utopian-io"],"image":["https://cdn.steemitimages.com/DQmdMjdA9MJt7YScFepuGxSmMJtNwFmZfqQijMtxE3tWHLM/image.png"],"links":["https://join.utopian.io/guidelines","https://review.utopian.io/result/3/3321112","https://support.utopian.io/","https://discord.gg/uTyJkNm","https://join.utopian.io/"],"app":"steemit/0.1"} |
created | 2018-08-22 16:29:15 |
last_update | 2018-08-22 16:29:15 |
depth | 1 |
children | 2 |
last_payout | 2018-08-29 16:29:15 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 4.473 HBD |
curator_payout_value | 1.454 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 697 |
author_reputation | 121,547,934,535,311 |
root_title | "Seed a SQL Database with PGN Games" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 69,034,436 |
net_rshares | 4,186,971,120,845 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
azizbd | 0 | 4,144,233,108 | 4% | ||
mys | 0 | 10,765,537,843 | 10.17% | ||
pixelfan | 0 | 14,204,635,774 | 9% | ||
espoem | 0 | 16,006,251,142 | 15% | ||
utopian-io | 0 | 4,128,590,732,096 | 5.6% | ||
favcau | 0 | 12,920,002,706 | 25% | ||
mops2e | 0 | 339,728,176 | 10% |
Hi @helo, thanks for your feedback. I believe those changes are okay, they are just a natural consequence of the refactoring process that is taking place -- by the way, I just pushed this [Documentation](https://pgn-chess.readthedocs.io/en/latest/). By following the convention `<object>-<action>` as in `db-create`the commands names are a bit more readable.
author | programarivm |
---|---|
permlink | re-helo-re-programarivm-seed-a-sql-database-with-pgn-games-20180822t181611698z |
category | utopian-io |
json_metadata | {"tags":["utopian-io"],"users":["helo"],"links":["https://pgn-chess.readthedocs.io/en/latest/"],"app":"steemit/0.1"} |
created | 2018-08-22 18:16:12 |
last_update | 2018-08-22 19:33:09 |
depth | 2 |
children | 0 |
last_payout | 2018-08-29 18:16:12 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.036 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 360 |
author_reputation | 2,631,258,794,707 |
root_title | "Seed a SQL Database with PGN Games" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 69,042,880 |
net_rshares | 25,768,991,613 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
helo | 0 | 25,768,991,613 | 100% |
Thank you for your review, @helo! So far this week you've reviewed 8 contributions. Keep up the good work!
author | utopian-io |
---|---|
permlink | re-re-programarivm-seed-a-sql-database-with-pgn-games-20180822t162914965z-20180824t163008z |
category | utopian-io |
json_metadata | "{"app": "beem/0.19.42"}" |
created | 2018-08-24 16:30:09 |
last_update | 2018-08-24 16:30:09 |
depth | 2 |
children | 0 |
last_payout | 2018-08-31 16:30:09 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.017 HBD |
curator_payout_value | 0.003 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 107 |
author_reputation | 152,955,367,999,756 |
root_title | "Seed a SQL Database with PGN Games" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 69,244,163 |
net_rshares | 15,097,742,821 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
espoem | 0 | 14,775,001,054 | 15% | ||
mops2e | 0 | 322,741,767 | 10% |
Hi @programarivm! We are @steem-ua, a new Steem dApp, computing UserAuthority for all accounts on Steem. We are currently in test modus upvoting quality Utopian-io contributions! Nice work!
author | steem-ua |
---|---|
permlink | re-seed-a-sql-database-with-pgn-games-20180822t183238z |
category | utopian-io |
json_metadata | "{"app": "beem/0.19.54"}" |
created | 2018-08-22 18:32:39 |
last_update | 2018-08-22 18:32:39 |
depth | 1 |
children | 0 |
last_payout | 2018-08-29 18:32:39 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 189 |
author_reputation | 23,214,230,978,060 |
root_title | "Seed a SQL Database with PGN Games" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 69,044,127 |
net_rshares | 0 |
Congratulations @programarivm! You have completed the following achievement on Steemit and have been rewarded with new badge(s) : [](http://steemitboard.com/@programarivm) Award for the number of comments <sub>_Click on the badge to view your Board of Honor._</sub> <sub>_If you no longer want to receive notifications, reply to this comment with the word_ `STOP`</sub> **Do not miss the last post from @steemitboard:** [SteemitBoard and the Veterans on Steemit - The First Community Badge.](https://steemit.com/veterans/@steemitboard/steemitboard-and-the-veterans-on-steemit-the-first-community-badge) > You can upvote this notification to help all Steemit users. Learn why [here](https://steemit.com/steemitboard/@steemitboard/http-i-cubeupload-com-7ciqeo-png)!
author | steemitboard |
---|---|
permlink | steemitboard-notify-programarivm-20180822t224323000z |
category | utopian-io |
json_metadata | {"image":["https://steemitboard.com/img/notify.png"]} |
created | 2018-08-22 22:43:21 |
last_update | 2018-08-22 22:43:21 |
depth | 1 |
children | 0 |
last_payout | 2018-08-29 22:43:21 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 856 |
author_reputation | 38,975,615,169,260 |
root_title | "Seed a SQL Database with PGN Games" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 69,060,421 |
net_rshares | 607,577,041 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
programarivm | 0 | 607,577,041 | 100% |
Hey @programarivm **Thanks for contributing on Utopian**. Weβre already looking forward to your next contribution! **Want to chat? Join us on Discord https://discord.gg/h52nFrV.** <a href='https://v2.steemconnect.com/sign/account-witness-vote?witness=utopian-io&approve=1'>Vote for Utopian Witness!</a>
author | utopian-io |
---|---|
permlink | re-seed-a-sql-database-with-pgn-games-20180822t233036z |
category | utopian-io |
json_metadata | "{"app": "beem/0.19.42"}" |
created | 2018-08-22 23:30:36 |
last_update | 2018-08-22 23:30:36 |
depth | 1 |
children | 0 |
last_payout | 2018-08-29 23:30:36 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 305 |
author_reputation | 152,955,367,999,756 |
root_title | "Seed a SQL Database with PGN Games" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 69,063,274 |
net_rshares | 0 |