HOME XML-SCHEMA XML-EXAMPLES CHESS VARIANTS FBR MBN ANCP FAQ RESOURCES ABOUT

CIF - Move Section


<xs:complexType name="MoveSection" mixed="true"> <xs:complexContent> <xs:extension base="Variation"/> <xs:attribute name="movenumber" type="xs:positiveInteger" use="optional"/> </xs:extension> </xs:complexContent> </xs:complexType> <xs:complexType name="Variation" mixed="true"> <xs:sequence> <xs:element name="prologue" type="Comment" minOccurs="0"/> <xs:element name="prelude" type="Annotation" minOccurs="0"/> <xs:group ref="MoveData" minOccurs="0" maxOccurs="unbounded"/> <xs:element name="epilogue" type="Comment" minOccurs="0"/> </xs:sequence> </xs:complexType> <xs:complexType name="Annotation"> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:group ref="AnnotationData"/> </xs:choice> </xs:complexType> <xs:group name="AnnotationData"> <xs:choice> <xs:element name="announcement" type="xs:string"/> <xs:element name="msg" type="xs:string"/> <xs:element name="tag" type="Tag"/> <xs:element name="reference" type="Reference"/> <xs:element name="resource" type="ExternalResource"/> <xs:element name="eval" type="MoveInfoEval"/> <xs:element name="clock" type="MoveInfoClock"/> <xs:element name="elapsed" type="ElapsedMilliSecs"/> <xs:element name="sent" type="CorrChessSent"/> <xs:element name="diagram" type="Diagram"/> <xs:element name="marker" type="Marker"/> <xs:element name="arrow" type="Arrow"/> <xs:element name="line" type="Line"/> <xs:element name="region" type="Region"/> <xs:element name="value" type="Value"/> </xs:choice> </xs:group> <xs:complexType name="MoveData"> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:group ref="AnnotationData"> <xs:element name="var" type="Variation"/> <xs:element name="pre" type="Comment"/> <xs:element name="post" type="Comment"/> <xs:element name="startstyle" type="MoveStyleID"/> <xs:element name="endstyle" type="MoveStyleID"/> <xs:element name="link" type="GameLink"/> <xs:element name="draw" type="Empty"/> </xs:choice> </xs:complexType>

Each variation/main line may start with a prologue, and may end with an epilogue. A prologue will be displayed always before any move data in current variation or main line, and an epilogue will be displayed always at the end of the move data in current variation/main line, this also means that it will be displayed after any sub-variation of the current variation/main line.

Now we will define type MoveSection more exact with the use of a mix of Backus-Naur Form and XSD, because it's not possible to express the full syntax of the move section only with XSD (XSD only defines structures).

<MoveSection> ::= (<Prologue>? <MoveData> <Epilogue>?)? <MoveData> ::= <Move> <NAG>* <DrawOffered>? ( <PreComment> | <PostComment> | <Announcement> | <Message> )* <Tag>* <Reference>* <Resource>* <Diagram>* <MoveInfo>* <BoardMarker>* <Variation>? <GameLink>* <Move> ::= <CAN> <Flag>? <CAN> ::= <Leg> (',' <Leg>)* | '-' '-' <Leg> ::= <File> <Rank> (<File> <Rank> <Piece>? | '@' <Piece>) <Flag> ::= <EnPassantFlag> | <IllegalFlag> | <InvalidFlag> | <HandicapCastling> | <MirroredCastling> <EnPassantFlag> ::= '^' <InvalidFlag ::= '~' <IllegalFlag> ::= '!' <HandicapCastling> ::= '*' <MirroredCastling> ::= '%' <DrawOffered> ::= <xs:element name="draw" type="Empty"/> <Prologue> ::= <xs:element name="prologue" type="Comment"/> <Epilogue> ::= <xs:element name="epilogue" type="Comment"/> <PreComment> ::= <xs:element name="pre" type="Comment"/> <PostComment> ::= <xs:element name="post" type="Comment"/> <Announcement> ::= <xs:element name="announcement" type="xs:string"/> <Message> ::= <xs:element name="msg" type="xs:string"/> <Tag> ::= <xs:element name="tag" type="tag"/> <Reference> ::= <xs:element name="reference" type="Token"/> <Resource> ::= <xs:element name="resource" type="ExternalResource" <Diagram> ::= <xs:element name="diagram" type="Diagram" <MoveInfo> ::= <xs:element name="eval" type="MoveInfoEval"/> | <xs:element name="clock" type="MoveInfoClock"/> | <xs:element name="elapsed" type="ElapsedMilliSecs"/> | <xs:element name="sent" type="CorrChessSent"/> <BoardMarker> ::= <xs:element name="marker" type="Marker"/> | <xs:element name="arrow" type="Arrow"/> | <xs:element name="line" type="Line"/> | <xs:element name="region" type="Region"/> | <xs:element name="value" type="Value"/> <GameLink> ::= <xs:element name="link" type="GameLink"/> <Variation> ::= <MoveSection>

Note that spaces are allowed between all elements, except between the elements inside <Move>, <CAN>, and <Leg>; this means that <Move> is a string without spaces.

A sub-variation is representing an alternative variation. The alternate move sequence given by a sub-variation is one that may be legally played by first unplaying the move that appears immediately prior to the variation. Regard that a variation can be empty, this is mainly provided for the support of application Scid.

<CAN> may be appended by a special flag <EnPassantFlag>, <IllegalFlag>, <InvalidFlag>, <HandicapCastling>, or <MirroredCastling>, which must be given if the move is an en passant move, or it is illegal, invalid, a handicap castling, or a mirrored castling, respectively. See GameFlags for the meaning of the latter four flags. The en passant flag is required for en passant moves because the reader should recognize this without implementing chess logic.

Example for a flagged move: "e4d3e" is flagged as an en passant move.

Note that NAG here will not be used as an element, it will be used as text (see example below).

Element announcement contains the announcement from side to move, concerning any planned operation. Performing this operation is mandatory, so far if this is possible.

Element msg contains a message sent from the opponent.

Element draw indicates that the opponent has offered a draw after making this move.

Element reference contains a reference to a BLOb defined in sub-element data of element game.

Element resource contains a reference to external data.

The intended display ordering of the elements belonging to a move is:

  1. PreComment
  2. CAN
  3. NAG
  4. MoveInfo
  5. Message
  6. PostComment
  7. Reference
  8. Variation
  9. GameLink

Marker and arrows will be displayed on the board.

CAN (Computer Algebraic Notation) requires a bit more explanation: The first File/Rank pair is denoting the origin square, the second File/Rank pair is denoting the destination square of this move. If this move is a is a pawn promotion a promoted piece letter is following immediately. A castling move will be denoted in this way: the King square is denoting the origin, and the Rook square is denoting the destination ("King takes Rook" notation). In case of a piece drop move a different notation will be used: The first File/Rank pair is denoting the destination square, followed by an 'at' sign, followed by the designator of the dropped piece. There is another special move designation expressing a null move: "--".

Furthermore CAN supports composite moves (multiple legs). A composite move is a comma-separated sequence of legs. Example: "f2h4,h4f6" for moving from f2 via h4 to f6. More than 15 legs are not supported.

Some of the terminals don't need further explanation: File, Rank, and Piece. But regard: Rank must fit the range given by the attribute ranks (in element game). File must fit the range given by the attribute files, and Piece must be a character inside the set given by attribute pieceset. In 3D Chess the square also contains the board specifier, for example: "f2Ch4C" is a move which start on board C, and ends on board C. And in 4D Chess the column and the row will be appended; example: "f2C1f2C2" moves from board C in row 1 to board C in row 2.

All other terminals will be defined again with XSD:

<xs:complexType name="MoveInfoEval"> <xs:simpleContent> <xs:extension base="EvalScore"> <xs:attribute name="engine" type="xs:positiveInteger" use="optional"/> </xs:extension> </xs:simpleContent> </xs:complexType> <xs:simpleType name="EvalScore"> <xs:restriction base="xs:string"> <xs:pattern value="[1-9][0-9]*(:[1-9][0-9]*)?"/> </xs:restriction> </xs:simpleType>

An evaluation score will be given in centi-pawn units, optionally followed by a depth specification delimited with a colon. With the optional attribute engine the source of this evaluation score will be referenced. This engine must be defined in sub-element engine inside the game data section (element data of type GameData).

<xs:complexType name="MoveInfoClock"> <xs:simpleContent> <xs:extension base="Time"> <xs:attribute name="type" type="MoveInfoClockTypeID"/> </xs:extension> </xs:simpleContent> </xs:complexType> <xs:simpleType name="MoveInfoClockTypeID"> <xs:restriction base="xs:string"> <xs:enumeration value="egt"/> <!-- Elapsed game time --> <xs:enumeration value="emt"/> <!-- Elapsed move time --> <xs:enumeration value="clk"/> <!-- Players clock time, time remaining to next time control--> <xs:enumeration value="ct"/> <!-- Players clock time, actual time --> </xs:restriction> </xs:simpleType>

These are the equivalents to the eponymous PGN commands.

<xs:simpleType name="ElapsedMilliSecs"> <xs:restriction base="xs:positiveInteger"/> </xs:simpleType>

The information of the elapsed milliseconds per move will be given when downloading games from FICS, for example.

<xs:simpleType name="CorrChessSent"> <xs:restriction base="Timestamp"/> </xs:simpleType>

Representing the correspondence time stamp, this is the date and time of sending the move. This corresponds to the ccsnt command in PGN, but with a slighty different syntax.

<xs:complexType name="GameLink"> <xs:complexContent> <xs:extension base="GameHead"> <xs:attribute name="position" type="LinkPosition" use="optional"/> <xs:attribute name="representation" type="xs:string" use="optional"/> </xs:extension> </xs:complexContent> </xs:complexType> <xs:simpleType name="LinkPosition"> <xs:restriction base="xs:string"> <xs:enumeration value="mainline"/> <xs:enumeration value="subvariation"/> </xs:restriction> </xs:simpleType>

For convenience and simplicity the full game information is allowed for the definition of a game link, but in practice only a subset of the following elements is useful:

  • event.title
  • event.site
  • event.date
  • event.country
  • event.type
  • event.rounds
  • player.name
  • player.nation
  • player.gender
  • player.species
  • player.birth
  • player.death
  • player.team
  • player.teamcountry
  • player.ids (but only for organization=":FIDE")
  • characteristics.gamedate
  • characteristics.gametime
  • characteristics.result
  • characteristics.round
  • time.mode
  • time.control
  • extraneous.gameID
  • extraneous.board
  • extraneous.section
  • extraneous.stage
  • source.title
  • source.publisher
  • source.publication
  • source.version
  • source.date
  • tags.pgn
  • tags.private

The optional attribute representation contains the string representation of the link, e.g. "Karpov-Kasparov, 1-0 (34), Leiden 1982". This representation will be used by applications not supporting game links. Normally this attribute should be available, but under special circumstances it might not be possible to have a string representation.

Follow the link for the definition of the remaining types Comment, Marker, and Arrow, and Line, and Region. Value.

Extension for Tandem chess games (Bughouse)

For Tandem chess games an extension is required which will be defined informal: The move element <CAN> can be preceded by | (vertical bar), which designates: "Now the game continues on the other board with the following move." If the main line is starting with a vertical bar then the first move is done on the second board, otherwise the first move is done on the first board.

Example: Below a Bughouse game in BPGN notation is given:

1A. d4 {298} 1a. e6 {298} 2A. e4 {296} 2a. Nf6 {297} 3A. Bd3 {294} 1B. e4 {290} 1b. Nc6 {299} 3a. Nc6 {295} 4A. e5 {292} 2B. Nc3 {287}

Now we write the move section in CIF with the identical game data (the time remaining information normally will be written inside the info section, not inside the move section):

<moves> d2d4 e7e6 e2e4 g8f6 f1d3 | e2e4 b8c6 | b8c6 e7e5 | b1c3 </moves>


Google translation

Share this page

C/CIF at Sourceforge

C/CIF at Sourceforge

C/CIF at Launchpad

C/CIF at Launchpad