Architecture


This section is intended to provide details about what components Bard 2.0 provides to build new applications and the common extension points that developers will be interested in for extending the functionality of the base application. The details of the 2.0 architecture are still being fleshed out so this is a work in progress with some of the more concrete details below.

Data Catalog

In version 2.0, the DataCatalog will be more robust with expanded capabilities provided by the Tupelo Semantic Content Repository. All the version 1.0 UI options will still be valid with expanded capabilities to annotate, tag, search and provide other provenance capabilities, offering a more rich data catalog. More details about how the catalog works will be added here once the API is frozen.

Dataset Adapters

Dataset adapters allow various windows into the different dataset types, adapting the access to it based on the adapter type. All adapters must support BardSelection so that selections from the different views can be linked through a common access point. Thus, a table row selection is transformed into a BardSelection and any view listening for BardSelection can take the selection and transform it into the expected selection type and select the point in its view.

Table Adapters

The TableView displays table data based on the defined TableAdapter for a dataset. For each data type that should support displaying data in a table format, a TableAdapter must be defined using the ncsa.bard.table.ui.bardTableSelectionAdapters extension point and implement the TableAdapter interface.

TableAdapter.java
 // all table adapters must implement this interface
// initialize the adapter
void initialize() throws OperatorException;
void convert();
// transform from a table row selection to a general BardSelection
List<BardSelection> transformFromTableSelection(List<IDataObject> list);
// transform from a general BardSelection to a List of table row selections
List<IDataObject> transformFromBardSelection(List<BardSelection> list);
// set the unifier to get the desired triples from the context
void setUnifier( Unifier unifier );
// set a context containing triples
void setContext( Context context );
// set a List of Tuples
void setTable( List<Tuple<Resource>> table );
// is the dataset type acceptable for this adapter?
boolean accepts( List<?> data );
// get table rows
List<IDataObject> getDataset();
// get table column names
List<String> getColumnNames();
// load the table rows, probably in a Thread to support large datasets
void loadTableRows();
// set the event list so when updates happen the view is updated
void setTableInput(EventList<IDataObject> data);

There are currently two concrete implementations that use TableAdapter. The TupeloFeatureSetTableAdapter reads GIS Shapefile DBF data into a table and the TupeloTableAdapter uses a combination of a Context and Unifier to create a triple table or it expects a List of table rows. The separate adapters allow finer control over how the data is loaded. This is crucial for large datasets so that the table can be loaded in a background thread and the view updated incrementally.

Chart Adapters

Bard also uses adapters for supporting the different chart types. Each chart type must extend the BaseDatasetAdapter. Similar to the table edapter, the chart adapter handles the loading of the data so it is up to the developer to add support for loading large datasets.

BaseDatasetAdapter<T extends Dataset> implements DatasetAdapter<T>
  // base class that all adapters must extend
// set the unifier to get the desired triples from the context
void setUnifier( Unifier unifier );
// set a context containing triples
void setContext( Context context );
// initialize the adapter
void initialize() throws Exception;
// is the dataset type acceptable for this adapter?
boolean accepts( Dataset d );
// get the dataset being graphed
T getDataset();
// transform from chart selections to a List of BardSelection
List<BardSelection> transformFromChartSelection( Dataset chartSelection );
// transform from a List of BardSelections to chart selections
T transformFromBardSelection( List<BardSelection> list );
// set a DataSource and List of fields in the DataSource, if the adapter can support it.
public void setDataSource( DatasetSource datasetSource, List<String> fields );

Map Adapters

The TupeloSimpleFeatureMapAdapter provides access to GIS datasets using the GeoTools library and has similar methods to those supported by the other adapters. This should probably be an extension point so that support for other libraries could be added.

TupeloSimpleFeatureMapAdapter.java
// initialize the adapter
void initialize() throws OperatorException
// transform from Map Selections to a List of BardSelection
List<BardSelection> transformFromMapSelection( Map<String, List<ShapeHolder>) map );
// transform from BardSelections to Map Selections
List<ShapeHolder> transformFromBardSelection( List<BardSelection> list );
// set a context containing triples
void setContext( Context context );
// set a unifier to get the desired triples from the context
void setUnifier( Unifier unifier );
// set a List of Tuples
void setTable( List<Tuple<Resource>> table );
// is the dataset type acceptable for this adapter?
boolean accepts( Object data );
  • No labels