Wednesday, September 22, 2010

DataSets and DataTables

A DataSet { doc / class }, in flare, is a collection artifact designed to offer a different collection option for graphs; as a result it only contains two dataTables { doc / class }: edges and nodes.

Neither DataSets or DataTables extend or inherit from any class; thus, other than the default methods for objects, the only information you'll find within datasets are the two datatables.
----------------------------------------------------------------------------------
I recently ran into these two while working with the graphML converter within flare; the graphML converter is designed for conversion between GraphML and flare DataSets.  I found that there are instances where the schema associated with a DataTable doesn't quite include some of the keys; thus, it makes sense to ensure they ARE included.

The write method instantiates the graphML object (of type XML), adds the schema for any nodes or edges in the DataSet, and follows it up with data from the same DataSet; there is no allowance for having a key included in the DataSet that isn't in the schema.

I presume this to be because the developer(s) assumed the graphML would be properly formed.

This is likely optimal - a process should adhere to its contract, be able to expect what it gets to maintain certain attributes, be able to process that foo appropriately, and be expected to spit out as the contract asserts.

You can't open a padlock with a swordfish.