This page is part of the edition ring, it describes:
  • SGF file fundamentals
  • GoKnot support of SGF
  • Updating and healing SGF files
  • Splitting game collections

    The next page on the ring describes publishing issues.


SGF file fundamentals


    What normal users (not programmers or SGF database maintainers) need to know about SGF is only:
  • What is SGF? is explained here.
  • There are old versions of the standard. Such files must be converted using "Convert SGF file to FF4.0".
  • There are SGF files containing errors, edited manually, created by unstable software, etc. What to do with them is explained in "Updating and healing SGF files" below.
  • There are SGF files containing game collections. I.e., more than one game in the same file. What to do with them is explained in "Splitting game collections" below.
  • It is not a great idea to edit SGF files manually using Notepad or other text editors.

    The complete official SGF reference can be found here.


GoKnot support of SGF


    This note is technical, you can skip it if you do not understand SGF details:

    The following SGF properties are supported by GoKnot:

Mandatory properties: FF, GM, SZ, CA
Game description properties: AP, AN, BR, BT, CP, DT, EV, GN, GC, ON, OT, PB, PC, PW, RE, RO, RU, SO, TM, US, WR, WT, HA, KM
Node properties: C, N, V
HO: is converted to (NotAHotSpot, HotSpot, VeryHotSpot)
UC, DM, GB, GW: are converted to (NoAnnotation, Unclear, PositionIsEven, GoodForBlack, VeryGoodBlack, GoodForWhite, VeryGoodWhite)
Move properties: B, W, BL, WL, OB, OW
BM, DO, IT, TE: are converted to (NoMoveAnnot, BadMove, VeryBadMove, Doubtful, Interesting, GoodMove, VeryGoodMove)
AB, AW: In GoKnot, with no loss of potential other than not being able to store illegal games, there is a node zero which may not contain moves, odd numbered nodes which contain one black move each and even numbered nodes which contain one white move. If a node should contain more than one move, for example, to define a position, GoKnot will insert the required number of nodes (and pass moves) automatically. Therefore, AB and AW are supported Ok. The only difference is: GoKnot inserts many nodes to produce the same resulting position. The node number will not match the (expected) original node number. SGF files do not define move numbers, except when the (seldom used) MN property is declared.
PL: (Next player.) If defined at the end of the file, GoKnot will insert a pass move, if required, to match the next player.
MN: If the move number is defined, GoKnot will rename the node as "Move number XX" if the node's name was not set by N.
Symbols: CR, SQ, TR, LB
DD, MA, SL: are converted to symbols.
AR, LN: are converted to pairs of symbols. These symbols cannot be edited. If you edit a node containing these symbols, they are erased.

    The following SGF properties are not supported by GoKnot:

ST: (Is simply ignored.) Using the HTML assistant you can see all nodes together, therefore ST no longer makes sense.
FG: (A warning is displayed at this and the following not supported properties.) Intended for publishing, defines when a board should be drawn. GoKnot has more publishing options than that.
PM, VW: print move numbers, partial board views. Board options have similar features.
KO, AE: enable illegal moves, clear stones. GoKnot does not support illegal moves.

    Any non-standard SGF properties are not preserved when you open and save a game using GoKnot.


Updating and healing SGF files

When you select the menu option "Convert old SGF file to FF4.0" you are calling SGFC to do the job and, when finished, GoKnot opens the file created by SGFC.
SGFC is the reference implementation for the SGF FF[4] standard.
It was created by Arno Hollosi, the official maintainer of the standard. License
Therefore, it can be stated that, if it is not supported by SGFC it is not SGF.

    Understanding this, you understand why it is a good idea to open any doubtful file (not just old versions) via SGFC.

    "Convert old SGF file to FF4.0" is another way to open SGF files. It does not modify the original file. It makes a copy at the same path (or at a temporary path if the source path cannot be written to) with the name "oldname(FF4).sgf" where "oldname.sgf" was the original name. That copy is written by SGFC and GoKnot opens the copy instead of the original file. The console displays any errors. For example:
 SGFC V1.15  - Smart Game Format Syntax Checker & Converter
               Copyright (C) 1996-2005 by Arno Hollosi
               EMail: <ahollosi@xmp.net>
 ----------------------------------------------------------
Line:5 Col:47 - Error 23: property <AP> expects compose type value (value deleted): [GoWiki by Arno & Morten]
Game signature - tree 1: '------ ------'
C:\MAI2\GOKNOT\SGF\EARRED.SGF: 1 error(s)  

Loading .. C:\MAI2\GOKNOT\SGF\EARRED(FF4).sgf
         NAME : The ear-reddening move
End of loading.
234 White  .. Pass  (No prisoners)

Splitting game collections

When you select the menu option "Split game collection to many files" you are calling SGFC to do the job and, when finished, GoKnot opens the first file created by SGFC.
SGFC is the reference implementation for the SGF FF[4] standard.
It was created by Arno Hollosi, the official maintainer of the standard. License
Therefore, it can be stated that, if it is not supported by SGFC it is not SGF.

    A game collection is a set of games in the same file. Creating game collections is a very bad idea. They are not supported by GoKnot (at least, they can be split) and they are not supported by most programs either. In GoKnot you could merge any number of games using "Include variation in gametree" building a gigantic gametree. That would still not be a game collection, even if it had many variations for the first move. It would still have only one root node and only one "Game description".

    This is similar to the previous function. The only difference is in the file names. Instead of renaming "file.sgf" to "file(FF4).sgf" it renames "file.sgf" to "file_001.sgf", "file_002.sgf", "file_003.sgf" .. as many as games are found in the game collection. GoKnot just opens the first game in the collection. If you select "Open gametree" while the first file is open, the file dialog will open in the folder containing all the files.



  G o K n o t   H e l p
Version   2.0  
Help index
Download GoKnot at  
www.dybot.com/GoKnot