Page MenuHomePhabricator

Supporting PGN chess notation data
Open, Needs TriagePublic

Description

We are seeking for option to store chess games (PGN format; without comments) to be shared between wikis.

Example:

1. e4 e5 2. f4 exf4 3. Bc4 Qh4 4. Kf1 b5 5. Bxb5 Nf6 6. Nf3 Qh6 7. d3 Nh5 8. Nh4 Qg5 9. Nf5 c6 10. g4 Nf6 11. Rg1 cxb5 12. h4 Qg6 13. h5 Qg5 14. Qf3 Ng8 15. Bxf4 Qf6 16. Nc3 Bc5 17. Nd5 Qxb2 18. Bd6 Bxg1 19. e5 Qxa1 20. Ke2 Na6 21. Nxg7 Kd8 22. Qf6 Nxf6 23. Be7

See relevant discussion here: Wikidata:Property proposal/Portable Game Notation.

Wikidata

  • Assuming each move takes 8-12 chars, and a common game takes 30-40 moves, and long game takes 60 moves => a string of 720 chars is probably safe enough for most games.
  • Current limitation for Wikidata string (hardcoded defined in ValidatorBuilders::getCommonStringValidators) is 400 =>which supports 33-50 moves

Hence to support it in wikidata, we need to have a new type (medium/long length string) with different validator

Alternatives
If we believe it is (technical) abuse of wikidata to store medium length strings, it might be possible to store it in Commons, and refer it from Wikidata.

  • This mean Commons support for pgn (maybe somewhat similar to Tabular Data/Map data) and once we have such option, to add a new property type for linking it similar to tabular/map data

(maybe @Yurik can give good comments regarding this alternative)

Event Timeline

thanks to @Esc3300 for indicating it - a somewhat similar issue related to string length is discussed in T154660 (suggested 4000 => more than 300 moves, which is definitely enough)