PGNXML Standard for Chess Notation
1.0 Introduction
This is a proposed standard for the communication and storage of
chess game information. This is a full implementation of the
PGN (Portable Game Notation) standard,
including support for FEN and subvariations.
Since this is a proposed standard, I'd like to elicit feedback
from within the chess community on its usability and
functionality.
2.0 Overview
PGNXML is currently implemented as an XML Data Schema. This
was the original Schema proposal to the
w3c.
This work is now refered to as XDR.
The current plan is to migrate it to the new XML Schema
specification as soon
as some conforming implementations are available for testing.
2.1 Goals
One of the guiding goals of the PGNXML standard was to presume a
simple web browser client which will not have much chess
knowledge and just needs sufficient information to navigate the
XML and provide a playback through the provided PGNXML game.
2.2 The PGNXML Schema
The current schema is contained in
pgn.xdr. The associated conforming xml
file is in p2x.xml.
The p2x.xml file was generated from the
pgn_test.pgn source file
using an automated conversion routine, which will convert any
standard pgn file to a PGNXML conforming XML file.
2.3 ChessPGN Tool
The ChessPGN
tool is useful for converting from a generic PGN
format file to a PGNXML formatted file. The conforming output
can then be tested against the XDR file.
3.0 The PGNXML Hierarchy
The primary XML root is <PGNGAMES>
A PGNGAMES element will consist of 0 or more <game> elements. Each
<game> element must contain 1 <info> and 1 <moves> element.
3.1 <info>
The info tags are enumerated in the
XML Schema, but the basic
tags are:
- <Event>
- <Site>
- <Date Year="nn" Month="nn" Day="nn" >
- <EventDate Year="nn" Month="nn" Day="nn" >
- <Round> (numeric content)
- <White Elo="nn" USCF="nn" NA="xx" Country="xx"
Type="xx" Title="xx">
- <Black Elo="nn" USCF="nn" NA="xx" Country="xx"
Type="xx" Title="xx">
- <Result>
- <ECO>
- <Termination>
- <Annotator>
- <Mode>
- <PlyCount> (numeric content)
- <Prologue>
- <Epilogue>
- <FEN ActiveColor="xx" CastlingAvailability="xx"
EnPassantTargetSquare="xx" DrawCount="nn" MoveCount="nn">
3.2 <moves>
A <moves> tag consists of:
- <move n="nn" state="xx" annotation="xx" promote="x"
from="xx" to="xx" NAG="nn" display="xx">
- <text> (move comments)
- <move> (variation)
- <end> (end of move sequence)
- <end> (end of move sequence)
Issues
- PGN uses both a Date and EventDate tags. Do we really need
both? Should EventDate be subsumed within the Event
element?
Brad Merrill
<zbrad@cybercom.net>
Last modified: Tue Sep 12 11:19:07 Pacific Daylight Time 2000