View Single Post
  #5   Spotlight this post!  
Unread 14-09-2008, 23:19
Nibbles Nibbles is offline
Interstellar Hitchhiker
AKA: Austin Wright
FRC #0498 (Cobra Commanders)
Team Role: Alumni
 
Join Date: Jan 2008
Rookie Year: 2003
Location: Arizona
Posts: 103
Nibbles is just really niceNibbles is just really niceNibbles is just really niceNibbles is just really niceNibbles is just really nice
Re: XML Interchange format

Quote:
Originally Posted by EHaskins View Post
I think you've done some good work so far, but there are a few rough spots. The biggest thing I've seen so far is that the document itself contains no meta data about the date of creation, or the time span where it was valid.

Another thing, which may just be matter of preference, is that the you use one letter abbreviations in several places. Even if for no other reason than readability full words seem like a better choice.


If anyone is interested I've attached a file, which almost conforms to this spec, that was generated using the TBA Api.
Very good work there

I used abbreviations for alliance color because that is how I stored it in my database (a CHAR(1)), and the keep names descriptive, values small philosophy followed me into XML. I think you are right on that however, so I'll change it. I think all lowercase works, is that a good idea? Or Title Case?

I think meta data is outside of the scope of the format? There is RDF, which is aimed at adding metadata to XML documents, I think that might be the solution if that is completely necessary.

Quote:
Originally Posted by comphappy View Post
...My question is why is this not two files one for team data and one for match data, you have a lot of duplicate data in that file. I am not sure why you list all the teams at a comp listed at the top level of it, and then in each of the matches?
It is a good start it just needs some major layout work IHMO.
The idea of this is to have a file format that can store everything in one location. It is flexible enough to keep teams and matches separately, or upload data for only one event for example, but I can't think of a reason to do that, when you could just merge them, when you are trying to store multiple events or seasons of data.

As for redundant data, you could figure out which teams are in each event by scanning each child <alliance> tag, but that is harder to do. It also makes semantic sense, a team element under an event tag means the team was part of that event, the same way it does for the alliance tag. Similar thinking was behind adding the score="" attribute to the alliance tag, it is redundant, but it simplifies it down, and it allows you to not know each component, and have only the score.

Quote:
Originally Posted by Greg Marra View Post
Some comments, although I have not given the document a thorough read:
  • Don't abbreviate things when possible. "Red" and "Blue" are better than "R" and "B". You're thinking very FIRST-centric, think abstractly.
  • I'd like to see alliance/team have an optional "captain" attribute.
  • Calculating scores from penalties is nice, but a luxury. Can we have a "final score" attribute that is required, and "unpenalized score" and "penalties" attributes that are optional? What happens if in the future penalties are assessed by giving the opposing team points?
  • The "competition" attribute should have canonical names. "FRC" "FTC" "FLL" "VEX" "BEST" "OCCRA" spring to mind.
  • What is done for date in other XML formats? RSS does this: "<pubDate>Fri, 05 Sep 2008 00:51:30 -0400</pubDate>", so is that an easy format to generate/parse comared to YYYY-MM-DD?
  • Location is "e.g. "Phoenix, AZ, USA"". We're throwing away resolution with that. <location><street /><city /><state /><country /></location>?

We should give some serious thought to the representation of match numbers. "21" for Quarter Finals 2 Match 1 makes some sense, but what happens if there is ever a series of 8 ties and we go to game 10? The Blue Alliance represents this data poorly now.

That's it for now.
Abbreviations, that is a good point too.

For elimination matches, a captain designation would be very useful. It didn't cross my mind, I don't keep any elimination data at all (I should be, because it is the only time the same teams replay each other under the same conditions, useful for statistics work).

Good point about the penalties. The score attribute was added as a convenience, and I don't know how programs would deal with discrepancies between the score/penalty elements and score attribute. If there was a penalty system that awarded points to the other team/alliance, it would be hard to implement because the data format follows the premise that data belongs to other data, e.g. a score belongs to an alliance, which is a part of a match, etc. In that case, you would be faced with the issue of who owns the penalty. Off the top of my head, you would give a <penalty value="0" name="somepenalty for -10"/> to the offending side, then award <score name="somepenalty" value="10"/> to the other side.

Making the score attribute mandatory seems like a good idea. That would allow the listed components to not be comprehensive, that is, the listed score components are not 100% of the score. It might follow that you could have "points" and "penalties" attributes that are also authoritative over the respective score and penalty components.

There are way to many date formats, YYYY-MM-DD is the international standard, defined in ISO 8601 (not a public document, but information about it is out there). It helped tremendously that that is what SQL uses for dates as well. As for converting between dates, well, it isn't simple anywhere I think. I would like to get timezone data in there somewhere.

The location attribute is simply what FIRST gives teams, it isn't readily available in any other format. It shouldn't be hard to split locations by commas I think, if you really need to parse the data, or use a library or API like Google Local which doesn't have a problem with mixed data. Location is for human reference mostly, so making it atomic like that isn't really necessary, and it might make it harder to display a simple location. Can you think of a situation where atomic location data is necessary?

FIRST gives match ID's to elimination matches too, I was thinking that those would be used, along with the name attribute to name them with dashes. A problem I didn't consider (again because I don't store elimination data) is that you have multiple matches with the same ID. I think previously, to keep practice and qualification data, I just kept two seperate events, but that doesn't really make much sense in a more semantic format like this one. Probably, only allow one match number per match type.
__________________
Help standardize match data! Use the XML interchange format. (Specification page)
AAA_awright on Freenode IRC chat. (Join us at ##FRC on chat.freenode.net, or in your browser)