Bridges-Java-2.3.3
2.3.3
Bridges(JavaAPI)
|
The Bridges class is the main class that provides interfaces to datasets, maintains user and assignment information, and connects to the Bridges server. More...
Public Member Functions | |
Bridges () | |
Bridges (int assignment, String username, String appl_id) | |
void | init (int assignment, String username, String appl_id) |
void | setTitle (String title) |
void | setDescription (String description) |
void | setServer (String server) |
void | setMapOverlay (Boolean flag) |
void | setCoordSystemType (String coord) |
boolean | visualizeJSON () |
void | setVisualizeJSON (boolean flag) |
void | setDataStructure (DataStruct ds) throws NullPointerException |
void | visualize () throws IOException, RateLimitException |
Static Public Member Functions | |
static List< EarthquakeUSGS > | getEarthquakeUSGSData (int maxElements) throws Exception |
static List< ActorMovieIMDB > | getActorMovieIMDBData () throws Exception |
static List< ActorMovieIMDB > | getActorMovieIMDBData (int maxElements) throws Exception |
static List< ActorMovieIMDB > | getActorMovieIMDBData2 () throws Exception |
static List< GutenbergBook > | getGutenbergBookMetaData () throws Exception |
static List< Game > | getGameData () throws Exception |
static List< Song > | getSongData () throws Exception |
static Song | getSong (String songTitle) throws Exception |
static Song | getSong (String songTitle, String artistName) throws Exception |
static List< Shakespeare > | getShakespeareData () throws Exception |
static List< Shakespeare > | getShakespeareData (String works) throws Exception |
static List< Shakespeare > | getShakespeareData (String works, Boolean textOnly) throws Exception |
static ArrayList< CancerIncidence > | getCancerIncidenceData () throws Exception |
static String | getAssignment () |
static void | setAssignment (int assignment) |
static String | getUserName () |
static void | setUserName (String userName) |
static String | getKey () |
static void | setKey (String key) |
The Bridges class is the main class that provides interfaces to datasets, maintains user and assignment information, and connects to the Bridges server.
The Bridges class is responsible for initializing the Bridges system, specifying parameters (user id, assignment id, title, description, data structure type, etc) for the student assignment, generating the data structure representation and transmission to the Bridges server. In addition, it provides interfaces to a number of real-world datasets, that makes it easy to access the data for use algorithms/data structure assignments.
Datasets. The datasets that are currently supported through the BRIDGES API include USGS Earthquake Data, IMDB Actor/Movie Data (2 versions), Gutenberg Book Collection Meta Data, a Video Game Dataset and Shakespeare Dataset. More information is found in the respective methods (below) and at
http://bridgesuncc.github.io/datasets.html
A typical Bridges program includes creating the Bridges object, followed by creation of the data structure by the user, assigning visual attributes to elements of the data structure, followed by specification of teh data structure type and the call to visualize the data structure (Bridges::setDataStructure() and visualize() methods).
bridges.connect.Bridges.Bridges | ( | ) |
Constructors
bridges.connect.Bridges.Bridges | ( | int | assignment, |
String | username, | ||
String | appl_id | ||
) |
|
static |
This helper function provides access to a small curated IMDB dataset. The data is retrieved, formatted into a list of ActorMovieIMDB objects (about 1800 pairs).
This curated data set has only actor and movie name pairs. refer to
http://bridgesuncc.github.io/datasets.html
for more information and to look at the dataset.
maxElements | the number of actor/movie pairs(but currently unused), returns all records. |
Exception | if the request fails |
|
static |
|
static |
This helper function provides access to a second curated IMDB dataset; the data is retrieved, formatted into a list of ActorMovieIMDB objects
This version of the IMDB Actor/Movie data contains for each record, actor name, movie name, movie genres, movie rating; refer to
http://bridgesuncc.github.io/datasets.html
for more information and to look at the dataset.
name | should be "IMDB" |
maxElements | the number of actor/movie pairs, but currently unused, returns all records. |
Exception | if the request fails |
|
static |
Get the assignment id
|
static |
This helper function provides access to a cancer dataset from CDC https://www.cdc.gov/cancer/npcr/uscs/download_data.htm and curated by Austin (Cory) Bart as part of the Corgis data collection https://think.cs.vt.edu/corgis/
Each record in this collection has a number of fields detailed in the CancerIncidence class.
For more information and to look at the data, refer to
http://bridgesuncc.github.io/datasets.html
Exception | if the request fails |
|
static |
This helper function provides a simple API to retrieve current USGS earthquake Tweet data from the USGS website (https://earthquake.usgs.gov/earthquakes/map/); The data is retrieved and formatted into a list of EarthquakeUSGS objects.
More information on the dataset can be found at
http://bridgesuncc.github.io/datasets.html
name | USGS account name - must be "earthquake" to create account |
maxElements | the number of earthquake records retrieved, limited to 5000 |
Exception | if the request fails |
|
static |
This helper function provides access to the meta-data of the video game collection.
Each record in this collection has information on game title, platform, rating, and genre. For more information and to look at the data, refer to
http://bridgesuncc.github.io/datasets.html
Exception | if the request fails |
|
static |
This helper function provides access to the meta-data of the Gutenberg book collection (about 1000 books); the data is retrieved, formatted into a list of GutenbergBook objects.
Each book in this collection has for each record, information on author (name, birth, death), title, languages, genres, subjects, metrics(number of chars, words, sentences, difficult words), url downloads. More information and commands to access the data can be found at
http://bridgesuncc.github.io/datasets.html
for more information and to look at the dataset.
Exception | if the request fails |
|
static |
Get application key
|
static |
This helper function provides access to a collection of Shakespeare plays, poems and plays.
Each record in this collection has information on title, type (poem, Sonnet, play) and text.
For more information and to look at the data, refer to
http://bridgesuncc.github.io/datasets.html
Exception | if the request fails |
{String} | [works] Valid input: "Plays" or "Poems". The works flag is optional. |
{Boolean} | [textOnly] True returns only words, no punctuation. The textOnly flag is optional. |
|
static |
|
static |
|
static |
These helper functions provides access to a particular song.
The record has information such as song title, artist, album, year, lyrics, and genre. For more information and to look at the data, refer to
https://bridgesdata.herokuapp.com/api/datasets/songs
Exception | if the request fails |
|
static |
|
static |
This helper function provides access to the meta-data of the lyrics collection.
Each record in this collection has information on song title, artist, album, year, lyrics, and genre. For more information and to look at the data, refer to
https://bridgesdata.herokuapp.com/api/datasets/songs
Exception | if the request fails |
|
static |
This exists to prevent duplicate error traces.
void bridges.connect.Bridges.init | ( | int | assignment, |
String | username, | ||
String | appl_id | ||
) |
|
static |
set the assignment id
assignment | number (int) |
void bridges.connect.Bridges.setCoordSystemType | ( | String | coord | ) |
coord | this is the desired coordinate space argument Options are: ['cartesian', 'albersusa', 'equirectangular'], and 'cartesian' is the default; |
void bridges.connect.Bridges.setDataStructure | ( | DataStruct | ds | ) | throws NullPointerException |
This method sets the handle to the current data structure; this can be an array, the head of a linked list, root of a tree structure, a graph Arrays of upto 3 dimensions are suppported. It can be any of the data structures supported by BRIDGES. Polymorphism and type casting is used to determine the actual data structure and extract its representtion.
ds | The data structure to set (any of the subclasses of DataStruct) |
void bridges.connect.Bridges.setDescription | ( | String | description | ) |
descr | description to annotate the visualization; |
|
static |
Set application key
key | application key value (string) |
void bridges.connect.Bridges.setMapOverlay | ( | Boolean | flag | ) |
Turns on map overlay for subsequent visualizations - used with location specific datasets
flag | this is the boolean flag for displaying a map overlay |
void bridges.connect.Bridges.setServer | ( | String | server | ) |
server | server to which to connect. Options are: ['live', 'local', 'clone'], and 'live' is the default; |
void bridges.connect.Bridges.setTitle | ( | String | title | ) |
Bridges JSON Parameters
title | title used in the visualization; |
|
static |
set User id
userName | (string) |
void bridges.connect.Bridges.setVisualizeJSON | ( | boolean | flag | ) |
set | the flag to print the JSON represenation of the data structure to standard output |
void bridges.connect.Bridges.visualize | ( | ) | throws IOException, RateLimitException |
This method generates the representation of the current data structure (JSON) and sends that to the Bridges server for generating a visualization.
RateLimitException | |
IOException |
boolean bridges.connect.Bridges.visualizeJSON | ( | ) |
check | if the flag to output the JSON is set |