Basic Navigation
He that breaks a thing to find out what it is has left the path of wisdom.
-- J.R.R. Tolkien
-- J.R.R. Tolkien
<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns="http://abstractgamers.org/schemas/reports/2010" targetNamespace="http://abstractgamers.org/schemas/reports/2010" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ag="http://abstractgamers.org/schemas/reports/2010" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs:annotation> <xs:documentation> This is the schema for game reports submitted to IAGO's Records and Ranking service (http://records.abstractgamers.org). All dates are assumed to be UTC unless an appropriate time zone is given. Please take care as these dates will affect how ratings are calculated. </xs:documentation> </xs:annotation> <xs:complexType name="player"> <!-- The name is the key used to link moves to players. The names *must* be unique! --> <xs:attribute name="name" type="xs:normalizedString" use="required"/> <xs:attribute name="anonymous" type="xs:boolean" use="optional" default="false" /> <!-- The IAGOID attribute is no longer used. Each user will have to tell IAGO what username they use on what services. The system will automatically determine if the given player name matches any IAGO records. --> </xs:complexType> <xs:complexType name="team"> <xs:sequence> <xs:element name="player" type="player" minOccurs="1" maxOccurs="unbounded"/> </xs:sequence> <xs:attribute name="id" type="xs:normalizedString" use="required"/> </xs:complexType> <xs:simpleType name="events"> <xs:restriction base="xs:string"> <xs:enumeration value="match"/> <xs:enumeration value="tournament"/> <xs:enumeration value="ladder"/> </xs:restriction> </xs:simpleType> <!-- This is the ROOT element --> <xs:element name="report"> <xs:complexType> <xs:sequence> <!-- Any general, overall comments could be made here. Not sure what this would actually be used for in practice --> <xs:element name="comments" type="xs:string" minOccurs="0" maxOccurs="1"/> <!-- There must be a <team> tag for each group of participants. A <team> may (and usually will) consist of a single <player>. --> <xs:element name="team" type="team" minOccurs="2" maxOccurs="unbounded"/> <!-- Now there is a series of required "tags" (to use PGN lingo) --> <xs:element name="dates" minOccurs="1" maxOccurs="1"> <xs:complexType> <xs:attribute name="start" type="xs:dateTime" use="optional"/> <xs:attribute name="end" type="xs:dateTime" use="required"/> </xs:complexType> </xs:element> <!-- "match" describes just a normal game. "tournament" and "ladder" flag the game differently. If the event is a IAGO-run one, then a iagoid is required. --> <xs:element name="event" minOccurs="1" maxOccurs="1"> <xs:complexType> <xs:attribute name="type" type="events" use="required"/> <xs:attribute name="iagoid" type="xs:normalizedString" use="optional"/> <xs:attribute name="name" type="xs:normalizedString" use="optional"/> </xs:complexType> </xs:element> <xs:element name="round" type="xs:nonNegativeInteger" minOccurs="0" maxOccurs="1"/> <!-- Now you can add any tags you wish --> <xs:element name="tag" minOccurs="0" maxOccurs="unbounded"> <xs:complexType> <xs:attribute name="name" type="xs:normalizedString" use="required"/> <xs:attribute name="value" type="xs:string" use="required"/> </xs:complexType> </xs:element> <!-- The <results> tag lists the <team>s with their appropriate "place". The actual value of the "place" attribute is irrelevant, as long as it is in ascending order, with the smallest value being first place and so on. --> <xs:element name="results" minOccurs="1" maxOccurs="1"> <xs:complexType> <xs:sequence> <xs:element name="team" minOccurs="2" maxOccurs="unbounded"> <xs:complexType> <xs:attribute name="id" type="xs:normalizedString" use="required"/> <xs:attribute name="place" type="xs:nonNegativeInteger" use="required"/> <xs:attribute name="score" type="xs:normalizedString" use="optional"/> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> <!-- Here is the list of moves made in the game --> <xs:element name="move" minOccurs="0" maxOccurs="unbounded"> <xs:complexType> <xs:sequence> <xs:element name="text" type="xs:string" minOccurs="1" maxOccurs="1"/> <xs:element name="mark" type="xs:normalizedString" minOccurs="0" maxOccurs="1"/> <xs:element name="comment" minOccurs="0" maxOccurs="unbounded"> <xs:complexType> <xs:simpleContent> <xs:extension base="xs:string"> <xs:attribute name="player" type="xs:normalizedString" use="required"/> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element> </xs:sequence> <xs:attribute name="player" type="xs:normalizedString" use="required"/> </xs:complexType> </xs:element> <!-- Here is an optional log of chat messages that occurred during the game. --> <xs:element name="chat" minOccurs="0" maxOccurs="unbounded"> <xs:complexType> <xs:simpleContent> <xs:extension base="xs:string"> <xs:attribute name="from" type="xs:normalizedString" use="required"/> <xs:attribute name="timestamp" type="xs:dateTime" use="required"/> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element> </xs:sequence> <!-- IAGO identifier for the particular game: Chess, Homeworlds, etc... --> <xs:attribute name="gameid" type="xs:normalizedString" use="required"/> <!-- IAGO identifier for the submitting service (some sort of "anonymous" submitter is needed) --> <xs:attribute name="submitter" type="xs:normalizedString" use="required"/> <!-- This is some sort of unique identifier attached to this particular report. It must be unique across all reports submitted by the specified submitter. Most services have some form of game ID number for each game played. This would be perfectly acceptable. --> <xs:attribute name="reportid" type="xs:normalizedString" use="required"/> <!-- This is used to indicate a human moderated game (so "no" cheating). This can be used to calculate different ratings or weight them differently. --> <xs:attribute name="moderated" type="xs:boolean" use="optional" default="false"/> <!-- The "submitted" and "rated" attributes are no longer used. Submission date will be stored separately and the records system will determine on the fly whether or not the game should be rated. --> </xs:complexType> <!-- Uniqueness requirements --> <xs:unique name="playerNames"> <xs:selector xpath="./ag:team/ag:player"/> <xs:field xpath="@name"/> </xs:unique> <xs:unique name="teamids"> <xs:selector xpath="./ag:team"/> <xs:field xpath="@id"/> </xs:unique> <!-- keys --> <xs:key name="Players"> <xs:selector xpath="./ag:team/ag:player"/> <xs:field xpath="@name"/> </xs:key> <xs:key name="TeamIDs"> <xs:selector xpath="./ag:team"/> <xs:field xpath="@id"/> </xs:key> <!-- keyrefs --> <!-- The "player" attribute of the <move> tag must exist in the <team>/<player> definition. --> <xs:keyref name="PlayersRef" refer="Players"> <xs:selector xpath="./ag:move"/> <xs:field xpath="@player"/> </xs:keyref> <!-- The TeamIDs given in the results section must match the initial <team> definitions. --> <xs:keyref name="TeamIDsRef" refer="TeamIDs"> <xs:selector xpath="./ag:results/ag:team"/> <xs:field xpath="@id"/> </xs:keyref> </xs:element> </xs:schema>
Obviously this needs to be discussed and expanded.
<?xml version="1.0" encoding="utf-8"?> <report xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://abstractgamers.org/schemas/reports/2010" gameid="chess" submitter="sdg" reportid="14682"> <team id="1"> <player name="Alice" anonymous="true" /> </team> <team id="2"> <player name="Bob"/> </team> <dates start="1697-02-01T00:00:00Z" end="1697-02-02T00:00:00Z"/> <event type="tournament" name="IAGO Chess Tournament 2009" iagoid="0"/> <tag name="FEN" value="rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"/> <results> <team id="2" place="1" /> <team id="1" place="2" /> </results> <move player="Alice"> <text>e2-e4</text> </move> <move player="Bob"> <text>e7-e5</text> <comment player="Bob Smith">I'm surprised you didn't try the Sicilian!</comment> </move> <move player="Alice"> <text>a2-a4</text> <mark>??</mark> </move> <chat from="Alice" timestamp="1697-02-01T00:00:00Z">Good luck!</chat> <chat from="Bob" timestamp="1697-02-01T02:00:00Z">Thanks! You too!</chat> <chat from="Chris" timestamp="1697-02-01T04:00:00Z">Mind if I watch too?</chat> </report>