The IPTC Sports Content Working Group welcomes feedback on this guidance document. Please contact office@iptc.org with your feedback and suggestions.

1. Introduction

Sports fixtures and results have long been an important part of the output of news agencies and media organisations and this activity continues to grow in line with the increasing world-wide interest in sport.

Historically, providers had to balance the need for detailed information with the constraints imposed by having to deliver timely transmissions of data over the (then) low-speed data circuits available. This led to sparse plain text or field-delimited data feeds that required precise formatting and processing in order to produce the required output, which was driven by the space constraints of print media.

Today, the picture is very different. The rise of the Web combined with the emergence of a global sports industry has created a demand for more detailed results and statistics. Although timeliness remains a key priority, modern communications and processing power have removed many of the old restrictions.

The legacy formats are therefore no longer adequate, but if the response to modern needs is a proliferation of specialised data formats, this will over time make the exchange and application of sports data more costly and difficult.

SportsML-G2 is designed to offer a flexible, extensible framework built on the re-usable components of NewsML-G2 that can handle all types of sports information using standard technology, including:

  • Schedules (fixtures)

  • Results

  • Multi-media sports news

  • Standings (for example league tables, player order-of-merit, rankings)

  • Team statistics, including actions such as "fumbles", "tackles"

  • Player statistics, including career statistics and play statistics.

  • Match statistics, including "plays", or "actions"

  • Betting or wagering information

  • Venue information, including weather

Rather than try to fit all sports into a single generic model, special add-in modules enable widely-differing sports, such as golf, baseball and motor racing, to be accommodated within the standard framework.

1.1. About This Guide

This guide refers to SportsML-G2 v3.1. For implementation of earlier versions of SportsML refer to earlier versions of these guidelines.

1.2. Further resources

Please visit iptc.org/standards/sportsml-g2 for further links to SportsML-G2 resources.

There is also a SportsML-G2 user group forum at https://groups.io/g/iptc-sportsml/ for all those interested in SportsML-G2 wishing to seek advice and share experiences.

1.3. What changed in SportsML 3.1

SportsML 3.1 was released in June 2019.

Changes in version 3.1 include:

  • "round-number" attribute added to baseEventMetadataComplexType

  • Fix typo in header comment for tennis plugin

  • Fixed examples to use the correct qcodes nprt:given, nrol:short etc for names

  • Added "events-discarded" to outcomeTotalsComplexType and "result-status" to base3StatsComplexType to support events where players or teams can discard some of their results. Corrected description of "distance" in "actionAttributes"

1.4. Previous versions

SportsML 3.0 was a comprehensive update, released in July 2016.

SportsML 2.2 was released in October 2011. The most important changes in this version of Sportsml were documentation improvments, additions to the core schema, enhancements to the soccer plugin and adjustments to the tournament model. For a full list of changes, see http://dev.iptc.org/SportsML-22-ChangesAdditions

2. Business Advantages

The NewsML-G2 data model is well suited to the exchange of sports information. By its nature, sport has many entities: teams, players, officials, leagues and so on that are routinely stored as structured data and can be used, updated, and re-used over time. These can be exchanged as Concepts and Knowledge Items.

Sports Events may therefore be modelled as actions and relationships involving these known entities, and by coding these in XML, the full value of this information can be harnessed using standard technology:

  • Information can be easily imported into databases

  • Using XSLT information can be transformed to specific format for the Web, print, mobile etc, or other XML formats.

  • The information can be used directly by dynamic applications using Java or similar tools.

  • Providers and receivers are not restricted in their choice of taxonomies. This is crucial in sport where value-added knowledge bases may be maintained by different data owners.

  • Extension points allow the standard to be adapted and customised to special needs within the standard framework

Finally, by building expertise around a single, extensible standard, information owners, providers, and consumers can benefit from reduced costs, greater reliability and faster time-to-market for compelling applications based on the rich variety of sports statistics and content that is increasingly available.

3. Getting started

A SportsML document always starts with the tag <sports-content>. So your first lines will look something like this:

<?xml version="1.0" encoding="UTF-8"?>
<sports-content xmlns="http://iptc.org/std/SportsML/2008-04-01/"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://iptc.org/std/SportsML/2008-04-01/
    ......../schema/sportsml-loose.xsd">
</sports-content>

The above code is valid SportsML, but it does not contain any valuable data. So let’s add some:

<sports-event>
  <sports-metadata event-status="post-event"/>
  <team>
      <team-metadata>
          <name first="Manchester" last="United" full="Manchester United"/>
      </team-metadata>
      <team-stats score="1" event-outcome="loss"/>
  </team>
  <team>
      <team-metadata>
          <name first="Barcelona" />
      </team-metadata>
      <team-stats score="3" event-outcome="win"/>
  </team>
</sports-event>

Here we have added some metadata regarding a soccer match between Manchester United and Barcelona (The Champions League final in 2011). We have described that the match ended 3-1 and we have also marked up who won and who lost. This data can now be used to create the following output in HTML:

Manchester United

1

Barcelona

3

Let’s dig a bit more into the code. First we start marking up the event with the <sports-event> tag. This is the tag you will be using when marking up a sports event - hence the name. To tell that the match score is final we set the <sports-metadata> tag to set the event-status attribute to post-event.

Then we use the <team> and <team-metadata> tags to mark up information about the participating teams. You can add as many teams as you like. So if you were to mark up a cycling competition, all teams participating will be marked up using this structure.

To tell the outcome of this particular sport event we use the <team-stats> tags, and we used the score and event-outcome attributes to mark up the result. So a parser can now use the event-outcome to determine which of the teams won or lost the match.

4. Basic Structure of SportsML

Now that you have seen a first short example of SportsML, let’s dive a little bit more into the structure of a SportsML document.

As we described in the previous section, the root element in SportsML is <sports-content>. This element requires a child <sports-metadata> element. You can then add zero or more of the following elements:

  • <sports-event>

  • <tournament>

  • <schedule>

  • <standing>

  • <statistic>

  • <article>

The first five of these items hold XML structures built upon various combinations of team and player elements. The article element is intended to hold a news story recommended to adhere to the News Industry Text Format, or NITF.

Data structures for these items are outlined as follows:

sports-event

A set of teams or a set of players, followed by optional information about officials/referrees, play-by-play actions, highlights, and awards

tournament

Broken into tournament-divisions, which have rounds of sports-events

schedule

A structured set of sports-events.

standing

A set of teams or players.

statistic

Also a set of teams or players.

article

A container for an NITF news article.

Each of these structures has an envelope for metadata. For example, <event-metadata> holds properties that describe when and where the event takes place and whether the game has started or not.

4.1. Keys and Identifiers

Behind SportsML is a comprehensive strategy for unambiguously identifying which player, team, league, sport, and event is being covered.

These values are generally stored in attributes we call "keys." For example, a team-key might equal "t.7". Where does one go to look up which team has the key of "t.7"? In what we call a Resource File.

The Resource File is an XML file that lists and defines which keys are allowed where. The IPTC has come up with its own contents for Resource Files. However, publishers are free to create their own files, either based on the IPTC’s, or containing whole new sets of values.

Besides listing items like leagues, conferences, associations, and teams, Resource Files also contain lists of controlled vocabularies used to describe other properties. For example, the various states of health a player is in could be described as "injured" or "fine," or could be described in much more detail.

A quick aside: In an ideal world, we might also have a central repository for all player-keys in major sports, regardless of which team they’re on or country they’re in. This is obviously a long-term goal, and suggestions for how agencies could go about putting such a reference database together are welcomed.

5. SportsML: Team Sports

In this section we will describe team sports and then of course the <team> element with its sub element <team-metadata>. But let us start with the definition of a team sport.

According to Wikipedia a team sport is "any sport which involves players working together towards a shared objective."

A team sport is an activity in which a group of individuals, on the same team, work together to accomplish an ultimate goal which is usually to win. This can be done in a number of ways such as outscoring the opposing team. Team members set goals, make decisions, communicate, manage conflict, and solve problems in a supportive, trusting atmosphere in order to accomplish their objectives. This can be seen in sports such as hockey, football, baseball, soccer, basketball, volleyball, tennis, water polo, lacrosse, rugby league, rugby union, cricket, and many others."

This is why SportsML has created a team element where you can assign players (individuals), managers and more.

So let’s dive into the team element.

5.1. The <team> element

This element is used to define one of more teams in a sport event (like a competition). The team element is followed by a team-metadata and you can so add team-stats and player. More about these elements later. The element has only one attribute, which is id. An ID in XML cannot start with numbers, so you need to have one character before add any number to a team. In our example we have used the shortened name of the team, but in the real world your IDs will either come from some federation (national or international) or from a the source of your sports results data.

Within the <team> element you must add the <team-metadata> element. This element is used to describe the team. Here you state the name of the team, origin and so on. It can be as complex or simple as you like - or as your system allows. Below is an example of a quite complex team definition:

<team id="example.com">
    <team-metadata home-page-url="www.example.com" alignment="home">
        <name first="Example" last="Com" full="Example.Com" />
        <home-location city="London" country="England" />
    </team-metadata>
</team>

In the next section, you will learn how to mark up a match and add players and player actions.

6. Adding Actions

Now that we have a little bit more grasp of SportsML, let’s add some more data to our example. Having the final result is a good thing. Now let us add the half time score and also how many goals were scored in each period.

<sports-event>
    <sports-metadata event-status="post-event"/>
    <team id="manutd">
        <team-metadata>
            <name first="Manchester" last="United" full="Manchester United"/>
        </team-metadata>
        <team-stats score="1" event-outcome="loss">
            <sub-score score="1" period-value="1"/>
            <sub-score score="0" period-value="2"/>
        </team-stats>
    </team>
    <team id="barca">
        <team-metadata>
            <name first="Barcelona" />
        </team-metadata>
        <team-stats score="3" event-outcome="win">
            <sub-score score="1" period-value="1"/>
            <sub-score score="2" period-value="2"/>
        </team-stats>
    </team>
</sports-event>

As you can see we have now added two elements sub-score inside the team-stats element. And we are telling in which period the goal came and also how many goals were scored in that period.

So in a sports results document, we could now publish this result as:

Manchester United - Barcelona 1-3 (1-1)

Let us now look at how to add a bit more data to this result. We are missing goal scorers, so let us add those.

6.1. Player actions and SportsML plugins

So we have now given our document valuable data about the site and the event, but we have not told anything about the actions that happened in the event. So let’s add some information about goals scored in the match. When it happened, who scored and so on. Again we will only add those parts added, as the document now is going to much longer and then harder to read.

First we have to add the players. This is done between the team elements. Here we am adding the Barcelona players:

<player id="barca7">
    <player-metadata uniform-number="7" nationality="Spain">
        <name first="David" last="Villa"  full="David Villa" />
    </player-metadata>
</player>
<player id="barca10">
    <player-metadata uniform-number="10" nationality="Argentina">
        <name first="Lionel" last="Messi"  full="Lionel Messi" />
    </player-metadata>
</player>
<player id="barca17">
    <player-metadata uniform-number="17" nationality="Spain">
        <name first="Pedro" last="Rodríguez"  full="Pedro Rodríguez" />
    </player-metadata>
</player>

And here we add the Manchester United player (here we have added the whole team structure to show):

<team id="manutd">
    <team-metadata>
        <name first="Manchester" last="United" full="Manchester United"/>
    </team-metadata>
    <team-stats score="1" event-outcome="loss">
        <sub-score score="1" period-value="1"/>
        <sub-score score="0" period-value="2"/>
    </team-stats>
    <player id="manutd10">
        <player-metadata uniform-number="10" nationality="England">
            <name first="Wayne" last="Rooney" full="Wayne Rooney" />
        </player-metadata>
        <player-stats score="1" >
            <sub-score score="1" period-value="1" />
        </player-stats>
    </player>
</team>

In order to add actions you need to use the plugin for the sport you are to create datafile from. Since we are creating a soccer results file, we must therefore use the soccer plugin. There is no need to add any references to include this plugin, it is always available in SportsML. So you simply need to use those elements and attributes that are related to this plugin.

This is how it looks with the soccer plugin:

<event-actions>
    <event-actions-soccer>
        <action-soccer-score player-idref="barca17" minutes-elapsed="27" />
        <action-soccer-score player-idref="manutd10" minutes-elapsed="34" />
        <action-soccer-score player-idref="barca10" minutes-elapsed="54" />
        <action-soccer-score player-idref="barca7" minutes-elapsed="69" />
    </event-actions-soccer>
</event-actions>

So with this data we now have marked up the scores for the match. We have, as you may notice not written any names, but refered to the ID we have given the player.

With the code above we can now publish the following results text:

Manchester United - Barcelona 3-1 (1-1) Scores: 0-1 Pedro Rodriguez (27), 1-1 Wayne Rooney (34), 1-2 Lionel Messi (54), 1-3 David Villa (69).

In the next section we shall add more information about the event site.

7. Adding Statistics

We have come a long way since the first document which only contained a <sports-content> element. We have added `<action>`s so that we can mark up who scored and some other events that happened during the match. And we now have a result file that looks something like this:

Manchester United - Barcelona 1-3 (1-1) Scores: 0-1 Pedro Rodriguez(27), 1-1 Wayne Rooney (34), 1-2 Lionel Messi (54), 1-3 David Villa (69).

But we are stilling missing some data: those related to the site and other statistics.

Let’s add where the match was played and how many people were there. And why not also indicate how many people this stadium can hold so that, if you want, you could do some math and tell how full/empty the stadium was, and a little bit more. In order to add this information, we need to use the <event-metadata> element. We will show just this part in the code below:

<event-metadata start-date-time="2011-05-28T204500+00">
    <site>
        <site-metadata capacity="90000" home-page-url="http://www.wembleystadium.com/" surface="grass" >
            <name first="Wembley" last="Stadium" />
            <home-location city="London" country="England" timezone="Europe/London" />
        </site-metadata>
        <site-stats attendance="87695" />
    </site>
</event-metadata>

Let’s explain the code above:

First we have added when the event took place with the start-date-time attribute in <event-metadata>.

Then we have added the <site>, <site-metadata> and <site-stats> elements to mark up information about the site. So now we can write up this code, and we can even link to the website for the stadium:

Manchester United - Barcelona 1-3 (1-1) Wembley Stadium, London, England. Attendenace: 87695 Scores: 0-1 Pedro Rodriguez(27), 1-1 Wayne Rooney (34), 1-2 Lionel Messi (54), 1-3 David Villa (69).

8. Single Sports

Single sports are sports where you compete as an individual. Examples of single sports are athletics, cross country skiing, alpine skiing, rowing, canoing and so on. It does not mean that you cannot be part of a team. It does how ever imply that the result the individual gets is for his/hers benefit and not necessary the team. There are exceptions to this "rule":

An athlete in a single sport may compete in a competition where the team earns points. An example is the Olympic Games where the country the athlete competes for receives points when the athlete wins or is better than 6th place in that particular event.

Let’s now start creating some information to a single sport event. And we then have to introduce (or re-introduce if you have read all pages up until this one) the player element.

8.1. The player element

To mark up a single sport event you can choose to just use the <player> element. As with the <team> element, the <player> element requires a metadata element as its first child. If you have come this far, you have probably read about the <player> element, but let’s repeat just in case you haven’t.

The player element is used to mark up information about a participant in a sport event (competition). It contains the following sub-elements:

Element name Element description

<player-metadata>

Element used to describe the participant. Here you add information about name, home-location, career-phase, injury-phase and more.

<player-stats>

Element used to give statistic information about the participant. You use this element to give the participant score, awards and so on.

<wagering-stats>

Element used for odds and wagering.

<associate>

Element used to add participants to the competition that has some other role than athlete (as an active participant in the competition).

You use this element to add for instance a referee, the manager of the team and so on.

This element also requires <associate-metadata> and its sub-elements like <name> and so on. This to give descriptive data about the associate.

<affiliation>

Element used to add affilates to the cometition/team.

Now that we have some information about the <player> element, let’s create an example:

<player id="cyclist1234">
    <player-metadata gender="male" nationality="Norwegian" uniform-number="1234">
        <name last="Doe "first="John" full="John Doe" />
        <home-location country="Norway" city="Oslo" />
        <career-phase name="example.com" phase-status="active" phase-type="professional"/>
    </player-metadata>
    <player-stats score="4:04:01.1" event-outcome="win">
        <award place="1" />
    </player-stats>
</player>

Now let’s go through some of the parts in this example, which we have created as an complex one just to show how much information can be insert into this element (there are more attributes. We have only used the most common ones)

In the player element we have created an ID - an self explaining one, cyclist and the bib-number. Then in the metadata-section we have added gender, nationality and bib (uniform-number). we have also given the athlete a name and associated him with a country and a city. In the career-phase element we have also associated him with a team, though without using the team element. You can also see that the athlete is active and that he is a professional.

Then in the stats element we have added the score (or the time in this example) and that the athlete won the event and that he was awarded the win.

With this amount of data we can produce the following different sports results text:

1: John Doe, Norway 4:04:01.1

Winner: John Doe, Norway 4:04:01.1

1: Doe, John - Norway 4:04:01.1

1: John Doe, example.com, Norway 4:04:01.1

If we had another athlete with phase-type="amateur", we could produce a result list with the professionals first and the amateurs second.

To create a result list of single sport participants you would just add more players elements in the document and then rendered this in which ever way is natural for your publication or bureau.

9. Tournaments

Tournaments are one of the more complex things to mark up. Not only are there many different tournament structures but you may choose to mark up a portion or a tournament in its entirety.

Examples of different kinds of tournaments would be: Olympics biathlon, Tour de France, UEFA Champions League, The Golden League for Athletics, The PGA Tour, World Cup Skiing, an Italian Serie A football season and the World Curling Championships. Even a North American professional sports league season could be rendered as a tournament involving stages such as pre-season, regular season and post-season.

You might also decide only to send portions of a tournament. Some providers might want to send the entire PGA season in a single XML document, thereby transmitting the whole structure. Others might wish to only send one stage at a time e.g. The Masters.

This section will guide you through the best practices in marking up a tournament.

9.1. Tournament elements

The following are the most important tournament elements, from broad to narrow.

Element name Element description

tournament

The root element for the tournament portion you are representing.

tournament-division

This is a mandatory element under tournament and an optional one under tournament-stage. This marks the level for which there is a single overall award, toward which the tournament events culminate. Generally this is a division by sport and/or gender and the award would be a cup, a medal, a placement in the standings, etc. For example, in World Cup Alpine Skiing is divided by gender within that division are stages at different locations (Innsbruck, Whistler, etc.) and within each stage are divisions by discipline (Downhill, Slalom, Giant Slalom and Super G). For a tennis tournament the divisions could combine gender and award eg. Women’s doubles, Men’s singles, etc. Note: the division referred to is the division within a tournament, not that within a league (such as the Eastern division of the American League of Major League Baseball).

tournament-stage

Stages can be the different locations thoughtout a season, for example in PGA, Formula 1, Tour de France or World Cup Skiing. They can also be the successive winnowing stage of a competition. For example in the FIFA World Cup: qualifier, groups and knockout. There is a stage-type vocabulary with which to classify stages. The terms are: hosted, group, single-group, series, single-elimination, home-and-home and qualification. These are explain in the documentation of the core vocabulary.

tournament-round

A round is a division of the competition within a stage. It is generally the last divisible level of a tournament into which actual comptetive events (sports-event in SportsML) are organized. In North American professional sports it could be a single series or it could be the components for a total time score as in World Cup bobsleigh. In the FIFA World Cup knockout stage, the rounds would be round of 16, quarter-finals, semi-finals, bronze and champion. In Champions league it could be the same of the "legs" of the home-and-home competitions. The same typing vocabulary mentioned above for stages can be applied to rounds.

sports-event

The actual competition. Optional if it’s a field of individuals playing in rounds, as with golf.

9.2. Examples of different structures

Below are examples of diferent tournament styles and how to mark them up.

Tournament name Tournament style SportsML Xpath Sample and Comment

Summer Olympic Athletics

Two disciplines of athletics: 100m and shot-put. For a multi-sport tournament such as Olympics, it is recommended to create one tournament doc per sport.

tournament/tournament-division/tournament-stage/tournament-round

Sample (sportsml-tournament-olympic.xml)

Each discipline is a division, leading to a single medal. Each division is comprised of rounds in elimination bracket style. All athletics disciplines could be added to this.

FIFA World Cup

Begins with a groups stage followed by elimination stage. Each stage contains rounds.

tournament/tournament-division/tournament-stage/tournament-round

Sample (sportsml-tournament-fifawc.xml)

Use <tournament-stage> to separate the two stages. Each group is a round. In the elimination stage, each phase (Group of 16, semi-finals, etc.) is a round.

UEFA Champions League

First a group stage, then knockout, followed by stage comprising final match. (Sample has just knockout and final.)

tournament/tournament-division/tournament-stage/tournament-round

Sample (sportsml-tournament-uefacl.xml)

The knockout stage has a type "home-and-home". Each "leg" of the home-and-home series is a round and each of the two events is numbered and given a series index. The final match is a different stage because of the change in type (single-elimination). It is placed within a round element because there is no further division of events.

Scandanavian Domestic elite Soccer

Each match is assigned to a round. In each round all teams play one game so the number of games in the round should equal the number of teams divided by two. Teams compete for placement in the final standings. A common format across Europe.

tournament/tournament-division/tournament-round

Norwegian Soccer (sportsml-tournament-norsoc.xml) Swedish Soccer (sportsml-tournament-swesoc.xml) Each game week is represented as a round. Number of events should be total number of teams divided by two. A standing under tournament-division shows the running total in the competition.

PGA Tour: Bob Hope Classic

Rounds within stages.

tournament/tournament-division/tournament-stage/tournament-round

Sample (sportsml-tournament-pgafedex.xml) The 2011 event required a tie-breaker stage. Regular 4-round match plus tie-breaker are rendered as stages.

Tennis: Davis Cup

A series of rounds in classic bracket style.

tournament/tournament-division/tournament-round

Sample (sportsml-tournament-tendavis.xml) No real stages other than the advancement rounds, therefore tournament-stage is not necessary.

Luge: Singles World Championship

A single event award among the top seasonal performers.

tournament/tournament-division

Sample (sportsml-tournament-lugewc.xml) No need to render stages and rounds because the event transpires in a single event.

Biathlon: World Cup Season

A number of contests through the winter at different locations. The season standings leader wins the cup.

tournament/tournament-division/tournament-round

Sample (sportsml-tournament-biathwc.xml) Each newly located contest is a stage. Each portion of the single hosted contest (eg. 20 km, 12.5 km pursuit) is a <sports-event>.

9.3. Some tournament markup guidelines

9.3.1. Divisions

Divisions are required under the tournament element. But why, if there is only one division? This was a design decision to maintain consistency across instances in order to convey that the structure beneath progresses toward a single award. Often the high-level division is important (eg. a two-gender tennis tournament) but even when it’s not (eg. a men’s hockey tournament with a single gender and discipline) it’s a good idea to maintain consistent structure.

9.3.2. Multi-sport events

It is not recommended to mark up an entire tournament like the Olympics. The highest level you should begin with is the major sport category (Alpine Skiing, Cycling, Athletics, etc.). You would then use two nested divisions: first by gender and then by discipline.

9.3.3. Group phases

The group phase of a tournament such as the FIFA World Cup can be represented as comprising multiple stages, one for each group, even though the groups play in parallel to one another.

9.3.4. Tournaments and Standings

Standings for different portions of a tournament should be placed at the appropriate level. For example, the overall standings for a World Cup season (like biathlon in the samples above) would be placed beneath the top division level (the gender divider). Standings for any particular contest would be placed beneath the round designating the hosted contest.

9.3.5. Rounds and Stages

Details can be added to rounds and stages, such as the number of games in a series — both minimum and maximum for a "best-of" series. The number of rounds and stages can also be specified. To identify a series within a round use the "series-index" attribute of <event-metadata>.

10. Embedding SportsML in NewsML-G2 documents

SportsML-G2 content can be conveyed either standalone using the <sports-content> element or within NewsML-G2 Items (that is News Items, Package Items, Concept Items, Knowledge Items and Planning Items). For more on NewsML-G2, see the NewsML-G2 Guidelines.

The structure of a SportsML-G2 document conveying a single piece of content, or multiple renditions of the same content, matches that of a NewsML-G2 News Item, as shown in the diagram below.

The <newsItem>, <itemMeta> and <contentMeta> components are implemented as discussed in the NewsML-G2 Basics, which readers are encouraged to study first. Although a full description of all of the many features of SportsML-G2 is beyond the scope of this Guide, this Chapter documents the implementation of specific SportsML-G2 features and shows by example how its use may be extended.

SportsML G2Item
Figure: Structure of a SportsML-G2 document matches NewsML-G2

As shown in the diagram, the <contentSet> wrapper appropriate to SportsML-G2 is <inlineXML>, which wraps valid XML content.

10.1. XML Schema and Catalogs

The schema used by the <newsItem> wrapper is NewsML-G2, although the document is conveying SportsML-G2, because a NewsML-G2 <newsItem> is being used to convey the information. Starting with version 3 SportsML-G2 uses the same namespace as NewsML-G2 so the SportsML child elements of the <inlineXML> wrapper of the document are from the same namespace.

The @standard is "NewsML-G2" and the appropriate @version value should reflect the version of NewsML-G2 being used, in the examples it is "2.23". For all versions of NewsML-G2 after 2.24, the @conformance attribute MUST be present with a value of "power".

The Catalog references for a SportsML-G2 document are more likely to contain references to proprietary, or non-IPTC, catalogs. The IPTC Catalog, or those IPTC schemes that are mandatory, MUST be referenced. The IPTC Subject NewsCodes also have a comprehensive classification of sports, and the IPTC recommends their use as an aid to inter-operability.

Other provider-specific catalogs may be referenced. In the examples in this Chapter, we will use references to catalogs provided by kind permission of XML Team (www.xmlteam.com), an IPTC member and a specialist provider of sports information, and also a leading contributor to the SportsML community. Note that catalogs can be referenced using <catalogRef> and @href to a catalog file, and/or the <catalog> element may be used to reference the controlled vocabulary (scheme) using the <scheme> child element with @alias and @uri attributes.

<catalogRef
    href="http://www.iptc.org/std/catalog/catalog.IPTC-G2-Standards_37.xml" />
    <catalog>
        <scheme alias="fixture" uri="http://xmlteam.org/newscodes/fixture#" />
    </catalog>

10.2. Item Metadata

A typical <itemMeta> block may include the following:

<itemMeta>
    <itemClass qcode="ninat:text"/>
    <provider qcode="ex-web:www.xmlteam.com"/>
    <versionCreated>2022-10-19T16:00:00Z</versionCreated>
    <pubStatus qcode="stat:usable"/>
    <fileName>xt.5932656-preview.xml</fileName>
</itemMeta>

Note that it contains a recommended <filename> for the item.

10.3. Content Metadata

In the following <contentMeta> block, the provider expresses the following facts about the content:

  • When it was created

  • Where the content was created

  • Who created the content (note, not necessarily the provider of the SportsML-G2 document – see <provider> in Item Metadata)

  • Alternative Identifiers for the content. Two will be given in the example, and the NewsML-G2 Specification recommends that they be distinguished using @type.

  • The genre of the content, in this case a preview of a major league baseball fixture. In the example it is expressed more than once, using different controlled vocabularies.

  • What, or whom, the content is about, including the fixture, teams and players, plus the classification of the sport (in this case using the IPTC Media Topic NewsCodes)

<contentMeta>
    <contentCreated>2016-10-19T12:17:00-05:00</contentCreated>
    <located qcode="ex-city:Philadelphia">
        <broader qcode="ex-reg:Pennsylvania" />
        <broader qcode="ex-cntry:USA" />
    </located>
    <creator qcode="ex-web:sportsnetwork.com">
        <name>The Sports Network</name>
    </creator>
    <altId type="ex-idtype:tsn-id" id="sportsnetwork.com-5932656" />
    <altId type="ex-idtype:revision-id"
        id="l.mlb.com-2009-e.19358-pre-event-coverage-sportsnetwork.com" />
    <genre qcode="ex-spfixt:pitcher-preview">
        <name xml:lang="en-US">Game Pitcher Preview</name>
        <broader qcode="spct:event-summary" />
    </genre>
    <genre qcode="spct:event-summary" />
    <genre type="ex-xts-genre:tsn-fixture" qcode="ex-tsn-fixture:mlbpreviewxml" />
    <language tag="en-US" />
    <subject qcode="medtop:15000000">
        <name xml:lang="en-US">sport</name>
    </subject>
    <subject qcode="medtop:20000849">
        <name xml:lang="en-US">Baseball</name>
        <broader qcode="medtop:15000000" />
    </subject>
    <subject qcode="league:l.mlb.com">
        <name xml:lang="en-US">Major League Baseball</name>
        <broader qcode="medtop:15000000" />
        <sameAs qcode="subj:15007001" />
    </subject>
    <subject type="spct:conference" qcode="ex-vendconf:l.mlb.com-c.national">
        <name xml:lang="en-US">National</name>
        <broader qcode="vendleague:l.mlb.com" />
    </subject>
    <subject type="cpnat:event" qcode="ex-vendevent:l.mlb.com-2007-e.19358" />
    <subject type="spct:team" qcode="ex-vendteam:l.mlb.com-t.19">
        <name>Philadelphia Phillies</name>
    </subject>
    <subject type="spct:team" qcode="ex-vendteam:l.mlb.com-t.26">
        <name>Arizona Diamondbacks</name>
    </subject>
    <subject type="cpnat:person" qcode="ex-vendperson:l.mlb.com-p.456">
        <name role="nrol:full">Doug Davis</name>
        <sameAs qcode="ex-fssID:45679" />
    </subject>
    <subject type="cpnat:person" qcode="ex-vendperson:l.mlb.com-p.123">
        <name role="nrol:full">Freddy Garcia</name>
        <sameAs qcode="ex-fssID:45680" />
    </subject>
    <headline>Pitcher Preview: Arizona Diamondbacks (29-23) at Philadelphia
        Phillies (26-24),7:05 p.m.</headline>
    <slugline separator="-">AAV!PREVIEW-ARI-PHI</slugline>
</contentMeta>

10.4. InlineXML and the Sports Content component

Up to this point in the example, NewsML-G2 components have been re-used "as is" with minor variations. SportsML-G2 is a mark-up language specifically for sport, therefore as one might expect, it has structures and properties appropriate to those needs.

This becomes clear in the <contentSet> component. The content will be conveyed as SportsML-G2. The appropriate wrapper for this type of content is <inlineXML>.

<contentSet>
    <inlineXML contenttype="application/sportsml+xml">
        <sports-content>

The Inline XML wrapper must contain a complete XML document from any namespace – in this case <sports-content> is the root element of a SportsML-G2 document. From version 3 on SportsML uses the same namespace as NewsML-G2.

The optional child elements <sports-metadata> and <article> are not documented here. The contents of <sports-metadata> have migrated to the <itemMeta> and <contentMeta> components, and <article> may be conveyed as a text using NewsML-G2.

It may be noted that the SportsML-G2 properties do not adhere to the NewsML-G2 convention of using "camel case" names (for example <sports-event> is used, not <sportsEvent>. This is to maintain backward compatibility with previous versions of SportsML, which existed as a standalone format before the creation of NewsML-G2.

Sports Content may hold the following child elements:

10.4.1. Schedules or Fixtures <schedule>

A series of games, usually grouped by date. Also known as a fixture list.

10.4.2. Sports Event <sports-event>

Contains metadata and data about a sporting competition – a sporting content that generally ends with a winner.

10.4.3. Standing <standing>

A series of team or individual records; facts about a team or player’s performances during a match, competition, season or career,

10.4.4. Statistics, Tables <statistic>

A table comparing the performance of teams or players, such as a league table, order of merit, world ranking. Regular statistics may be linked to fixtures or competitions using a QCode.

10.4.5. Tournament <tournament>

A structured series of competitions within a sport that may be held over a period of time, for example, Rugby World Cup, UEFA Champions League, American Football Conference.

For the purposes of this example, we will discuss the properties of Sports Event.

11. Sports Event wrapper in more detail

Sports Event MUST contain either a <player> OR a <team> child element. It SHOULD also contain an <event-metadata> OR <event-stats> child element.

Trying to fit different sports, for example golf and tennis, into a common structure would be impractical, if not impossible, without imposing severe limitations on the comprehensiveness of coverage. Using a plug-in model, SportsML-G2 can be extended to cover actions for virtually any sport.

Sports currently catered for are: American football, baseball, basketball, curling, golf, ice hockey, association football (aka soccer), motor racing, rugby football, tennis and volleyball.

11.1. Event Metadata <event-metadata>

The contents of <event-metadata> are sports-specific: for example, for rugby, the time added to the match by the officials may be indicated.

Additionally, there are properties for recording the Event Sponsor and details of the Event Venue, The following information might apply to the Australian Open men’s tennis final:

<event-metadata key="ex-vendkey:l.atp.com-2009-e.19358"
    event-status="speventstatus:mid-event"
    start-date-time="2016-01-28T19:05:00+11:00">
    <event-sponsor
        type="main"
        name="Kia Motors">
    </event-sponsor>
    <site>
        <site-metadata capacity="15,000" surface="ex-vendst:Plexicushion"
        home-page-url="www.australianopen.com" key="ex-site:aus209">
            <name>Rod Laver Arena, Melbourne Park</name>
        </site-metadata>
        <site-stats attendance="13,879" temperature="38"
        temperature-units="Centigrade" />
    </site>
</event-metadata>

There is a choice of many attributes of <event-metadata> to record detailed information about an event, its timing, the venue and predicted weather – even its suitability for record-breaking on the day.

11.2. Event Statistics <event-stats>

Currently has a child element of <event-stats-motor-racing> which has attributes that enable the property to record summary events for a complete motor race such as laps covered, caution flags, margin of victory. For other sports, these statistics are carried at the <team> and <player> level.

11.3. Team <team>

Contains information about a team, its players, management, home location, and performance statistics. For example, a typical (not comprehensive <team> component:

<team id="l.mlb.com-t.16">
    <team-metadata key="ex-vendteam:l.mlb.com-t.16" alignment="home">
        <name role="nrol:full">Philadelphia Phillies</name>
        <name part="nprt:common">Philadelphia </name>
        <name part="nprt:nickname">Phillies</name>
    </team-metadata>
    <player id="l.mlb.com-p.20339">
        <player-metadata position-event="spbblposition:1" key="ex-vendperson:l.mlb.com-p.20339">
            <name role="nrol:full">Freddy Garcia</name>
            <name part="nprt:given">Freddy</name>
            <name part="nprt:family">Garcia</name>
        </player-metadata>
        <player-stats>
            <player-stats-baseball>
                <stats-baseball-pitching earned-runs="4.81" wins="1" losses="3"
                winning-percentage=".250"/>
            </player-stats-baseball>
        </player-stats>
    </player>
</team>

11.4. Player <player>

Contains information about sports competitors, their membership of teams, personal information and statistics. The example below shows how a player component might be used to record performance statistics in a rugby match:

<player id="l.irb.org.worldcup-p.51">
    <player-metadata key="ex-vendperson:l.irb.org.worldcup-p.51"
        position-event="sprgxposition:right-wing"
        uniform-number="14" status="starter">
        <name role="nrol:full">Vincent Clerc </name>
    </player-metadata>
    <player-stats score="0">
        <player-stats-rugby>
            <stats-rugby-offensive tries-scored="0" conversion-attempts="0"
            conversions-scored="0"
            penalty-goal-attempts="0" penalty-goals-scored="0"
            handling-errors="0" kicks-total="9" kicks-into-touch="5" runs="10"
            metres-gained="10"/>
            <stats-rugby-defensive tackles="10" tackles-missed="4"/>
            <stats-rugby-foul cautions-total="0" ejections-total="0"/>
        </player-stats-rugby>
    </player-stats>
</player>

11.5. Award <award>

A medal, cup, placing or other type of award, which can be assigned to an event, a team or a player using a local idref.

<player id="P1">
    <player-metadata
        key="ex-vendperson:us.olympics.swim.123">
        <name role="nrol:full" >Michael Phelps</name>
    </player-metadata>
</player>
<award award-type="spaward:medal" name="Gold Medal"
    player-or-team-idref="P1" />

11.6. Event Actions <event-actions>

From version 3 all actions are generic. Here is a possible action structure for a point in a tennis match:

<player id="P1">
    <player-metadata key="ex-vendperson:atp001">
        <name role="nrol:full">Roger Federer</name>
    </player-metadata>
</player>
<player id="P2">
    <player-metadata key="ex-vendperson:atp002">
        <name role="nrol:full">Rafael Nadal</name>
    </player-metadata>
</player>
<actions>
    <action set="3" game="10">
        <action shot-type="ex-sptenshot:volley"
            receiver-score="sptengameresult:30"
            serve-number="ex-vendtenserve:first"
            server-score="sptengameresult:game">
            <participant idref="P1" role="ex-vendtenrole:server"/>
            <participant idref="P2" role="ex-vendtenrole:receiver"/>
            <participant idref="P1" role="ex-vendtenrole:ball-winner"/>
        </action>
    </action>
</actions>

11.7. Highlight <highlight>

A textual highlight for the event. An example of its use would be to provide a commentary-style text report on the progress of a match that could be used in a dynamic online application:

<highlight id="h.718300" class="PRE_KICK-OFF">
    Liverpool make three changes from the side that drew with Wigan. Out go Babel, Lucas and
    Benayoun. In come Riera, Kuyt and Alonso. Robbie Keane meanwhile isn't even in the squad
    amid rumours that he is set to re-join Spurs.
    <sports-property formal-name="minutes-elapsed" value="0" />
</highlight>
<highlight id="h.718351" class="KICK_OFF">
    We are underway here at a chilly Anfield.
    <sports-property formal-name="minutes-elapsed" value="0" />
</highlight>
<highlight id="h.718358" class="COMMENT">
    Good counter attack from Liverpool as Fabio Aurelio overlaps down the left and plays it
    into Steven Gerrard, but Frank Lampard does well to track back and tackle his England team-mate.
    <sports-property formal-name="minutes-elapsed" value="2" />
</highlight>
...
<highlight id="h.718402" class="YELLOW_CARD">
    Javier Mascherano is booked for a clumsy tackle on John Obi Mikel.
    <sports-property formal-name="minutes-elapsed" value="21" />
</highlight>
...
<highlight id="h.718579" class="GOAL">
    LIVERPOOL 1-0 CHELSEA. Fabio Aurelio crosses from the left-hand side and TORRES dives in to
    head home and score a vital goal for Liverpool.
    <sports-property formal-name="minutes-elapsed" value="89" />
</highlight>
Note the use of @class to refine the semantic of each highlight property. The highlight element can hold any content.

11.8. Officials <officials>

A container for one or more officials taking part in the event. The child elements <official-metadata> and <official-stats> hold information about the official, including rating information. For example:

<officials>
    <official>
        <official-metadata key="ex-vendperson:fifa02345"
            Position-event="spsocposition:referee">
            <name role="nrol:full">Keith Burkinshaw</name>
        </official-metadata>
        <official-stats>
            <rating rating-issuer="FIFA" rating-maximum="8"
            rating-value="8" />
        </official-stats>
    </official>
</officials>

11.9. Wagering Statistics <wagering-stats>

The betting on an event uses the <wagering-stats> component, which has possible child properties for expressing moneyline, odds, runline, straight spread and total score. The following example shows that the UK bookmaker William Hill is offering odds on an event of 10-1 from 8-1, together with a timestamp.

<wagering-stats comment="Multiple wagering-odds can be given">
    <wagering-odds bookmaker-key="ex-book:uk23456"
        bookmaker-name="William Hill"
        date-time="20090202T15:00:00Z"
        numerator="10"
        denominator="1"
        numerator-opening="8"
        denominator-opening="1">
    </wagering-odds>
</wagering-stats>
LISTING 1: A complete sample SportsML-G2 document

All Scheme Aliases used in the listing below indicate IPTC NewsCodes vocabularies, except for the following alias values: ex-city, ex-cntry, ex-conf, ex-dclass, ex-event, ex-fssID ex-idtype, ex-league, ex-person, ex-player ex-reg, ex-spcpnat, ex-tsn, _ex-team, ex-web and ex-xts-genre.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<newsItem xmlns="http://iptc.org/std/nar/2006-10-01/"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:nitf="http://iptc.org/std/NITF/2006-10-18/"
    xmlns:xs="http://www.w3.org/2001/XMLSchema" standard="NewsML-G2"
    xsi:schemaLocation="http://iptc.org/std/nar/2006-10-01/ 
        ./NewsML-G2_2.31-spec-All-Power.xsd"
    standardversion="2.31" version="1" conformance="power" xml:lang="en-US"
    guid="urn:newsml:sportsml.org:20160502:xt.prog.20150606005942-43710-16.068-event-stats-progressive">
    <catalogRef
        href="http://www.iptc.org/std/catalog/catalog.IPTC-G2-Standards_37.xml" />
    <catalogRef href="http://www.iptc.org/std/catalog/catalog.IPTC-Sports_1.xml" />
    <itemMeta>
        <itemClass qcode="ninat:text" />
        <provider qcode="ex-web:xmlteam.com">
            <name>XML Team Solutions, Inc.</name>
        </provider>
        <versionCreated>2015-06-06T00:59:42-04:00</versionCreated>
        <pubStatus qcode="stat:usable" />
        <fileName>xt.prog.20150606005942-43710-16.068-event-stats-progressive</fileName>
    </itemMeta>
    <contentMeta>
        <contentCreated>2015-06-06T00:59:42-04:00</contentCreated>
        <located qcode="ex-city:Philadelphia">
            <broader qcode="ex-reg:Pennsylvania" />
            <broader qcode="ex-cntry:CA" />
        </located>
        <creator qcode="ex-web:sportsnetwork.com">
            <name>The Sports Network, Inc.</name>
        </creator>
        <genre qcode="spfixt:event-stats-progressive">
            <name xml:lang="en-US">Progressive Event Statistics</name>
            <broader qcode="spct:event-summary" />
        </genre>
        <genre qcode="spct:event-summary" />
        <language tag="en-US" />
        <subject type="spct:season" literal="2015" />
        <subject type="spct:season-type" qcode="spct:season-regular" />
        <subject qcode="medtop:15000000">
            <name xml:lang="en-US">sport</name>
        </subject>
        <subject qcode="medtop:20000849">
            <name xml:lang="en-US">Baseball</name>
            <broader qcode="medtop:15000000" />
        </subject>
        <subject qcode="ex-vendleague:l.mlb.com" type="spct:league">
            <name xml:lang="en-US">Major League Baseball</name>
            <broader qcode="medtop:20000849" />
            <sameAs qcode="subj:15007001" />
        </subject>
        <subject type="spct:conference" qcode="ex-vendconf:l.mlb.com-c.national">
            <name xml:lang="en-US">National</name>
            <broader qcode="ex-vendleague:l.mlb.com" />
        </subject>
        <subject type="cpnat:event" qcode="ex-vendevent:l.mlb.com-2015-e.43710" />
        <subject type="spct:team" qcode="ex-vendteam:l.mlb.com-t.16">
            <name>Miami Marlins</name>
        </subject>
        <subject type="spct:team" qcode="ex-vendteam:l.mlb.com-t.27">
            <name>Colorado Rockies</name>
        </subject>
        <headline>Troy Tulowitzki singled to third and advanced to second on
            Martin Prado's throwing error. Runner on second with one out and Carlos Gonzalez
            due up.
        </headline>
    </contentMeta>
    <contentSet>
        <inlineXML contenttype="application/sportsml+xml">
            <sports-content class="SportsMLv3.0">
                <sports-event>
                   <event-metadata key="ex-vendevent:l.mlb.com-2015-e.43710"
                       event-status="speventstatus:mid-event" temporal-unit-value="ex-vendor:l.mlb.com-2015-e.43710"
                       start-date-time="2015-06-05T20:40:00-04:00">
                       <event-metadata-baseball inning-value="8"
                           inning-half="bottom" outs="1" strikes="2" balls="2"
                           runner-on-first="false" runner-on-second="true"
                           runner-on-second-idref="l.mlb.com-p.18606" runner-on-third="false"
                           runs-this-inning-half="0" />
                   </event-metadata>
                   <team id="l.mlb.com-t.16">
                       <team-metadata key="ex-vendteam:l.mlb.com-t.16"
                           alignment="away">
                           <name role="nrol:full">Miami Marlins</name>
                           <name part="nprt:common">Miami</name>
                           <name part="nprt:nickname">Marlins</name>
                       </team-metadata>
                       <team-stats event-outcome="speventoutcome:undecided"
                           score="6" score-opposing="1">
                           <sub-score period-value="1" score="0" />
                           <team-stats-baseball>
                               <stats-baseball-offensive runs-scored="6"
                                   hits="12" />
                               <stats-baseball-defensive errors="1" />
                           </team-stats-baseball>
                       </team-stats>
                       <player id="l.mlb.com-p.20339">
                           <player-metadata key="ex-vendperson:l.mlb.com-p.20339"
                               position-event="spbblposition:4" lineup-slot="1" lineup-slot-sequence="1">
                               <name role="nrol:full">Dee Gordon</name>
                               <player-metadata-baseball batting-hand="left" />
                           </player-metadata>
                           <player-stats>
                               <player-stats-baseball>
                                   <stats-baseball-offensive runs-scored="0"
                                       at-bats="5" hits="1" rbi="1" singles="0" doubles="1" triples="0"
                                       home-runs="0" bases-on-balls="0" bases-on-balls-intentional="0"
                                       strikeouts-against="1" strikeouts-looking="0" hit-by-pitch="0"
                                       double-plays-against="0" triple-plays-against="0"
                                       grounded-into-double-play="0"
                                       reached-base-defensive-interference="0" reached-base-error="0"
                                       reached-base-fielder-choice="0" outs-ground="2" outs-fly="1"
                                       sac-flies="0" sacrifices="0" stolen-bases="0"
                                       stolen-bases-caught="0" pick-offs-against="0" average=".364"
                                       on-base-percentage=".391" slugging-percentage=".431" />
                                   <stats-baseball-defensive putouts="0"
                                       assists="8" errors="0" errors-passed-ball="0"
                                       errors-catchers-interference="0" stolen-bases-average-defense="0"
                                       stolen-bases-caught-defense="0" double-plays="2" triple-plays="0" />
                               </player-stats-baseball>
                           </player-stats>
                       </player>
                   </team>
                   <team id="l.mlb.com-t.27">
                       <team-metadata key="ex-vendteam:l.mlb.com-t.27"
                           alignment="home">
                           <name role="nrol:full">Colorado Rockies</name>
                           <name part="nprt:common">Colorado</name>
                           <name part="nprt:nickname">Rockies</name>
                           <team-metadata>
                               <player id="l.mlb.com-p.16929">
                                   <player-metadata key="ex-vendperson:l.mlb.com-p.16929"
                                       position-event="spbblposition:8" lineup-slot="1" lineup-slot-sequence="1">
                                       <name role="nrol:full">Charlie Blackmon</name>
                                   </player-metadata>
                                   <player-stats>
                                       <player-stats-baseball>
                                           <stats-baseball-offensive
                                               runs-scored="1" at-bats="4" hits="1" rbi="0" singles="1"
                                               doubles="0" triples="0" />
                                       </player-stats-baseball>
                                   </player-stats>
                               </player>
                           </team-metadata>
                       </team-metadata>
                   </team>
                </sports-event>
            </sports-content>
        </inlineXML>
    </contentSet>
</newsItem>

12. SportsML-G2 Packages

To convey a package of SportsML-G2 items, simply use the NewsML-G2 <packageItem>, as covered in the Packages chapter in the NewsML-G2 Guidelines.

For example, we could send a text article to accompany the sports data document shown in the previous listing.

The text document is a News Industry Text Format document (NITF, the IPTC’s XML standard for marking up text), conveyed in a NewsML-G2 News Item, as shown below.

LISTING 2: Sports story in NewsML-G2/NITF

All Scheme Aliases used in the listing below indicate IPTC NewsCodes vocabularies, except for the following alias values: ex-city, ex-cntry, ex-conf, ex-dclass, ex-event_, ex-fssID, ex-idtype, ex-league, ex-person, ex-reg, ex-spcpnat, ex-spcpnat, ex-tsn-fixture, ex-web and ex-xts-genre.

<?xml version="1.0" encoding="UTF-8"?>
<newsItem 
    xmlns="http://iptc.org/std/nar/2006-10-01/"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://iptc.org/std/nar/2006-10-01/ 
        ./NewsML-G2_2.31-spec-All-Power.xsd"
    guid="tag:xmlteam.com,2016:xt.5932656-preview"
    version="15"
    xmlns:xts="www.xmlteam.com" 
    standard="NewsML-G2" 
    standardversion="2.31" 
    conformance="power" 
    xml:lang="en-US">
    <catalogRef
        href="http://www.iptc.org/std/catalog/catalog.IPTC-G2-Standards_37.xml" />
    <catalogRef
        href="http://www.xmlteam.com/specification/xts-SportsCodesCatalog_1.xml" />
    <itemMeta>
        <itemClass qcode="ninat:text" />
        <provider qcode="ex-web:www.xmlteam.com" />
        <versionCreated>2022-10-19T11:45:00-04:00</versionCreated>
        <pubStatus qcode="stat:usable" />
        <fileName>xt.5932656-preview.xml</fileName>
    </itemMeta>
    <contentMeta>
        <contentCreated>2016-10-19T11:15:00-05:00</contentCreated>
        <located qcode="ex-city:Philadelphia">
            <broader qcode="ex-reg:Pennsylvania" />
            <broader qcode="ex-cntry:USA" />
        </located>
        <creator qcode="ex-web:sportsnetwork.com">
            <name>The Sports Network</name>
        </creator>
        <altId type="ex-idtype:tsn-id" id="sportsnetwork.com-5932656" />
        <altId type="ex-idtype:revision-id"
            id="l.mlb.com-2016-e.19358-pre-event-coverage-sportsnetwork.com" />
        <genre qcode="spfixt:pre-event-coverage">
            <name xml:lang="en-US">Game Preview</name>
            <broader qcode="spct:event-summary" />
        </genre>
        <genre type="ex-spcpnat:dclass" qcode="spct:event-summary" />
        <genre type="ex-sport-genre:tsn-fixture" qcode="ex-tsn-fixture:mlbpreviewxml" />
        <language tag="en-US" />
        <subject qcode="medtop:20000822">
            <name xml:lang="en-US">sport</name>
        </subject>
        <subject qcode="medtop:20000849">
            <name xml:lang="en-US">Baseball</name>
            <broader qcode="medtop:20000822" />
        </subject>
        <subject qcode="ex-league:l.mlb.com">
            <name xml:lang="en-US">Major League Baseball</name>
            <broader qcode="medtop:20000822" />
            <sameAs qcode="subj:15007002" />
        </subject>
        <subject type="spct:conference" qcode="ex-conf:l.mlb.com-c.national">
            <name xml:lang="en-US">National</name>
            <broader qcode="ex-league:l.mlb.com" />
        </subject>
        <subject type="cpnat:event" qcode="ex-event:l.mlb.com-2016-e.19358" />
        <subject type="ex-spcpnat:team" qcode="ex-team:l.mlb.com-t.19">
            <name>Philadelphia Phillies</name>
        </subject>
        <subject type="spct:team" qcode="ex-team:l.mlb.com-t.26">
            <name>Arizona Diamondbacks</name>
        </subject>
        <subject type="cpnat:person" qcode="ex-person:l.mlb.com-p.456">
            <name>Doug Davis</name>
            <sameAs qcode="ex-fssID:45679" />
        </subject>
        <subject type="cpnat:person" qcode="ex-person:l.mlb.com-p.123">
            <name>Freddy Garcia</name>
            <sameAs qcode="ex-fssID:45680" />
        </subject>
        <headline>Preview: Arizona Diamondbacks (29-23) at Philadelphia Phillies
             (26-24), 7:05 p.m.</headline>
        <slugline separator="-">AAV!PREVIEW-ARI-PHI</slugline>
        <description role="drol:summary">A pair of teams coming off big weekend sweeps 
            will     square off tonight at Citizens Bank Park, where the Philadelphia Phillies 
            welcome the    Arizona Diamondbacks for the start of a three-game 
            series.</description>
    </contentMeta>
    <contentSet>
        <inlineXML contenttype="application/nitf+xml">
            <nitf xmlns="http://iptc.org/std/NITF/2006-10-18/"
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xsi:schemaLocation="http://iptc.org/std/NITF/2006-10-18/ 
                ./nitf-3-6.xsd">
                <body>
                   <body.head>
                       <hedline>
                           <hl1>Arizona Diamondbacks (29-23) at Philadelphia Phillies (26-24), 
                               7:05p.m.</hl1>
                       </hedline>
                       <byline>
                   <byttl>Sports Network</byttl>
               </byline>
                       <abstract>
                           <p>A pair of teams coming off big weekend sweeps will square off 
                           tonight at Citizens Bank Park, where the Philadelphia Phillies 
                           welcome the Arizona Diamondbacks for the start of a three-game 
                           series.</p>
                       </abstract>
                   </body.head>
                   <body.content>
                       <p>(Sports Network) - A pair of teams coming off big weekend sweeps 
                       will square off tonight at Citizens Bank Park, where the Philadelphia
               Phillies welcome the Arizona Diamondbacks for the start of a three-game
               series.</p>
                       <p>The Phillies picked up some momentum with a three-game sweep of the
               Atlanta Braves, while the Diamondbacks captured all four of their games
               against the Houston Astros.</p>
                       <p>On Sunday, Livan Hernandez threw his first complete game in almost 
                       two years to lead the Diamondbacks to an 8-4 win over the Astros to 
                       complete the sweep.</p>
                       <p>Arizona sends Doug Davis to the hill tonight, and the lefty is 0-4 
                       over his last five starts. That includes losses in each of his last 
                       three outings.</p>
                       <p>The Phillies, meanwhile, notched their first sweep of the year that
               culminated with Sunday's 13-6 pounding of the Braves. Ryan Howard
               flashed some of the power that won him the NL MVP last season, jacking 
                       a pair of two-run homers in the win.</p>
                       <p>Right-hander Freddy Garcia takes the hill for the Phillies and is 1-
                       3 with a 4.81 earned run average on the year. Since winning his first 
                       game in a Philadelphia uniform back on April 22, Garcia has gone 0-2 
                       over his last six starts.</p>
                   </body.content>
                </body>
            </nitf>
        </inlineXML>
    </contentSet>
</newsItem>

12.1. Referencing the packaged items

Each of the documents listed has a <filename> property in <itemMeta> that gives the recommended name that should be used when storing the document in the receiver’s system. The data file’s property is:

<fileName>xt.5932656-pitcher-preview.xml</fileName>

The property for the text document is:

<fileName>xt.5932656-preview.xml</fileName>

These filenames will be referenced by the NewsML-G2 Package Item.

12.2. Item Metadata and Content Metadata

The <itemMeta> element contains Management Metadata about the Item as a whole, and some Content Metadata (located, creator, and subject) that is common to both items is repeated in the <contentMeta> of the package as an aid to processing by the receiver.

12.3. The Group Set <groupSet> component

These processing Hint Properties are also a feature of the item references in the package payload component <groupSet>. Some of the metadata from the referenced items is inherited by the <itemRef> property for each member of the package. This enables the receiver to carry out some processing of the package without needing to retrieve the referenced items, for example to display on a web summary page.

In order to achieve this, each item reference contains a @contenttype to alert the receiver to the format of the content being referenced, plus the genre of the content, together with headline and summary.

This is a simple package of two related items, so no package hierarchy is needed. The package <groupSet> structure and its relationship to the information assets that it references may be illustrated in diagram form as shown below

SportsML G2PackageGroupSimple
Figure: Diagram of Package Group structure

This produces a <groupSet> component in XML as follows:

<groupSet root="G1">
    <group id="G1" role="ex-group:main">
    <itemRef href="xt.5932656-pitcher-preview"
        contenttype="application/sportsml+xml">
        <genre qcode="ex-spfixt:pitcher-preview">
            <name xml:lang="en-US">Game Pitcher Preview</name>
            <broader qcode="spct:event-summary" />
        </genre>
        <genre qcode="spct:event-summary" />
        <genre type="ex-xts-genre:tsn-fixture"
            @qcode="ex-tsn-fixture:mlbpreviewxml" />
        <headline>Pitcher Preview: Arizona Diamondbacks (29-23)
            at Philadelphia Phillies (26-24), 7:05 p.m.
        </headline>
        <description></description>
    </itemRef>
    <itemRef href="xt.5932656-preview"
        contenttype="application/nitf+xml">
        <genre qcode="spfixt:pre-event-coverage">
            <name xml:lang="en-US">Game Preview</name>
            <broader qcode="spct:event-summary" />
        </genre>
        <genre qcode="spct:event-summary" />
        <genre type="ex-xts-genre:tsn-fixture"
            qcode="ex-tsn-fixture:mlbpreviewxml" />
        <headline>Preview: Arizona Diamondbacks (29-23) at Philadelphia
            Phillies (26-24), 7:05 p.m.
        </headline>
        <description role="drol:summary">A pair of teams coming off big weekend
            sweeps will square off tonight at Citizens Bank Park, where the
            Philadelphia Phillies welcome the Arizona Diamondbacks for the start of a
            three-game series.
        </description>
    </itemRef>
    </group>
</groupSet>

The complete Package Listing is shown below.

LISTING 3: SportsML-G2 Package

All Scheme Aliases used in the listing below indicate IPTC NewsCodes vocabularies, except for the following alias values: ex-city, ex-cntry, ex-dclass, ex-event, ex-group, ex-idtype, ex-league, ex-reg, ex-spcpnat, ex-team, ex-tsn-fixture, ex-web, ex-xts-genre and ex-xts-package-type.

<?xml version="1.0" encoding="UTF-8"?>
<packageItem 
    xmlns="http://iptc.org/std/nar/2006-10-01/"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://iptc.org/std/nar/2006-10-01/ 
        ./NewsML-G2_2.31-spec-All-Power.xsd"
    guid="urn:iptc.org:20161019:sports1" version="15"
    xmlns:xts="www.xmlteam.com" 
    conformance="power" 
    standard="NewsML-G2"
    standardversion="2.31" 
    xml:lang="en-US">
    <catalogRef
        href="http://www.iptc.org/std/catalog/catalog.IPTC-G2-Standards_37.xml" />
    <catalogRef
        href="http://www.xmlteam.com/specification/xts-SportsCodesCatalog_1.xml" />
    <itemMeta>
        <itemClass qcode="ninat:composite" />
        <provider qcode="ex-web:xmlteam.com" />
        <versionCreated>2022-10-19T15:00:09Z</versionCreated>
    </itemMeta>
    <contentMeta>
        <contentCreated>2016-02-02T11:45:00-05:00</contentCreated>
        <located qcode="ex-city:Philadelphia">
            <broader qcode="ex-reg:Pennsylvania" />
            <broader qcode="ex-cntry:USA" />
        </located>
        <creator qcode="ex-web:sportsnetwork.com">
            <name>The Sports Network</name>
        </creator>
        <altId type="ex-idtype:tsn-id" id="sportsnetwork.com-5932656" />
        <altId type="ex-idtype:revision-id"
            id="l.mlb.com-2016-e.19358-pre-event-coverage-sportsnetwork.com" />
        <genre qcode="spct:event-summary" />
        <genre qcode="spfixt:pre-event-coverage" />
        <language tag="en-US" />
        <subject qcode="medtop:20000822">
            <name xml:lang="en-US">sport</name>
        </subject>
        <subject qcode="medtop:20000849">
            <name xml:lang="en-US">Baseball</name>
            <broader qcode="medtop:20000822" />
        </subject>
        <subject qcode="ex-league:l.mlb.com">
            <name xml:lang="en-US">Major League Baseball</name>
            <broader qcode="medtop:20000849" />
            <sameAs qcode="subj:15007001" />
        </subject>
        <subject type="spct:conference" qcode="ex-conf:l.mlb.com-c.national">
            <name xml:lang="en-US">National</name>
            <broader qcode="ex-league:l.mlb.com" />
        </subject>
        <subject type="cpnat:event" qcode="ex-event:l.mlb.com-2016-e.19358" />
        <subject type="spct:team" qcode="ex-team:l.mlb.com-t.19">
            <name>Philadelphia Phillies</name>
        </subject>
        <subject type="spct:team" qcode="ex-team:l.mlb.com-t.26">
            <name>Arizona Diamondbacks</name>
        </subject>
    </contentMeta>
    <groupSet root="G1">
        <group id="G1" role="ex-group:main">
            <itemRef residref="tag:xmlteam.com,2016:xt.5932656-pitcher-preview" 
                contenttype="application/sportsml+xml">
                <genre qcode="spfixt:pre-event-coverage">
                   <name xml:lang="en-US">Game Pitcher Preview</name>
                   <broader qcode="spct:event-summary" />
                </genre>
                <genre qcode="spct:event-summary" />
                <genre type="ex-sport-genre:tsn-fixture" qcode="ex-tsn-fixture:mlbpreviewxml" />
                <headline>Pitcher Preview: Arizona Diamondbacks (29-23) at Philadelphia 
                   Phillies (26-24), 7:05 p.m.
                </headline>
                <description></description>
            </itemRef>
            <itemRef residref="tag:xmlteam.com,2016:xt.5932656-preview" contenttype="application/nitf+xml">
                <genre qcode="spfixt:pre-event-coverage">
                   <name xml:lang="en-US">Game Preview</name>
                   <broader qcode="spct:event-summary" />
                </genre>
                <genre qcode="spct:event-summary" />
                <genre type="ex-sport-genre:tsn-fixture" qcode="ex-tsn-fixture:mlbpreviewxml" />
                <headline>Preview: Arizona Diamondbacks (29-23) at Philadelphia 
                   Phillies (26-24), 7:05 p.m.
                </headline>
                <description role="drol:summary">A pair of teams coming off big weekend 
                   sweeps will square off tonight at Citizens Bank Park, where the 
                   Philadelphia Phillies welcome the Arizona Diamondbacks for the start of a 
                   three-game series.
             </description>
            </itemRef>
        </group>
    </groupSet>
</packageItem>

13. Validation of SportsML inside NewsML-G2

Since SportsML and NewsML-G2 use the same namespace, the validation process needs to take this into consideration. The definition of <inlineXML> in NewsML-G2 also creates a potential pitfall that any validation scenario needs to be aware of.

The inlineXML element is very flexible with this declaration:

<xs:any namespace="##any" processContents="lax" minOccurs="0">

This means that the content can belong to any namespace, including that of NewsML-G2, and that the validator should try to validate the content but not be upset if the content is not covered by any referenced schema.

If the content belongs to another namespace, a schema for that namespace can be provided and the NewsML-G2 parts will be validated against the NewsML-G2 schema; the content will be validated according to the namespace and schema declaration provided for that part, as this test from Thomson-Reuters shows:

<inlineXML contenttype="application/xhtml+xml">
<html xmlns="http://www.w3.org/1999/xhtml">

With schema reference and namespace declaration:

xsi:schemaLocation="http://iptc.org/std/nar/2006-10-01/ ../ref/NewsML-G2_2.30-spec-All-Power.xsd http://www.w3.org/1999/xhtml ../ref/xhtml1-strict.xsd" xmlns:x="http://www.w3.org/1999/xhtml"

But with SportsML and NewsML-G2 in the same namespace this approach will not work. And since the NewsML-G2 schema has no specification for SportsML, the validator will not try to validate the content of inlineXML. So there are two options:

  • Validate the SportsML-content separately, or

  • Use SportsML as the main schema. Since SportsML includes the complete NewsML-G2 schema this solution will validate both the NewsML-G2 parts and the SportsML content.

The combination of “##any” and “lax” leads to validation being triggered only when the processor finds a root element specified in the schema for the inline content. In other words, an incorrect root element for SportML — say sportsContent as opposed to sports-content — will validate since the element is not found in the schema. Once a declared root element is found, validation will occur. Although an unlikely scenario, it is a dangerous one since such a false positive would leave one unaware of any integrity issues within the inline content payload. Example:
<contentSet>
    <inlineXML contenttype="application/sportsml+xml">
        <sports-content>

With sports-content being an element declared in SportsML, the validator will check everything inside this element. But if “sports-content” was changed to sportsContent the validator will not find this element in the schema and therefore ignore this and all children of this element.

The behavior is not only connected to SportsML, using the Thomson-Reuters sample we see that the potential risk exists regardless of inline content:

<html xmlns="http://www.w3.org/1999/xhtml"><head>

If head were to be changed to header the validator would complain because it will find a schema matching html and validate everything from that point. But if instead html were to be changed to, for example, hmtl the validator will not find that in any referenced schema and with the instruction of “##any” and “lax” let this pass - and therefore also ignore all children of “hmtl”.