Bridges-Java-2.3.3  2.3.3
Bridges(JavaAPI)
Public Member Functions | Static Public Member Functions | List of all members
bridges.connect.Bridges Class Reference

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< EarthquakeUSGSgetEarthquakeUSGSData (int maxElements) throws Exception
 
static List< ActorMovieIMDBgetActorMovieIMDBData () throws Exception
 
static List< ActorMovieIMDBgetActorMovieIMDBData (int maxElements) throws Exception
 
static List< ActorMovieIMDBgetActorMovieIMDBData2 () throws Exception
 
static List< GutenbergBookgetGutenbergBookMetaData () throws Exception
 
static List< GamegetGameData () throws Exception
 
static List< SonggetSongData () throws Exception
 
static Song getSong (String songTitle) throws Exception
 
static Song getSong (String songTitle, String artistName) throws Exception
 
static List< ShakespearegetShakespeareData () throws Exception
 
static List< ShakespearegetShakespeareData (String works) throws Exception
 
static List< ShakespearegetShakespeareData (String works, Boolean textOnly) throws Exception
 
static ArrayList< CancerIncidencegetCancerIncidenceData () 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)
 

Detailed Description

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).

Author
Sean Gallagher, Kalpathi Subramanaian, Mihai Mehedint, David Burlinson.
Date
1/16/17, 5/19/17
See also
Tutorial examples at
http://bridgesuncc.github.io/Hello_World_Tutorials/Overview.html

Constructor & Destructor Documentation

bridges.connect.Bridges.Bridges ( )

Constructors

bridges.connect.Bridges.Bridges ( int  assignment,
String  username,
String  appl_id 
)

Initialize Bridges (Constructor)

Parameters
assignmentthis is the assignmen id (integer)
appl_idthis is the appl authentication key(from the Bridges account)
usernamethis is the username (from the Bridges account)

Member Function Documentation

static List<ActorMovieIMDB> bridges.connect.Bridges.getActorMovieIMDBData ( ) throws Exception
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.

Parameters
maxElementsthe number of actor/movie pairs(but currently unused), returns all records.
Exceptions
Exceptionif the request fails
Returns
a list of ActorMovieIMDB objects, but only actor, movie, movie genre and movie rating are returned.
static List<ActorMovieIMDB> bridges.connect.Bridges.getActorMovieIMDBData ( int  maxElements) throws Exception
static
static List<ActorMovieIMDB> bridges.connect.Bridges.getActorMovieIMDBData2 ( ) throws Exception
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.

Parameters
nameshould be "IMDB"
maxElementsthe number of actor/movie pairs, but currently unused, returns all records.
Exceptions
Exceptionif the request fails
Returns
a list of ActorMovieIMDB objects
static String bridges.connect.Bridges.getAssignment ( )
static

Get the assignment id

Returns
assignment as a string
static ArrayList<CancerIncidence> bridges.connect.Bridges.getCancerIncidenceData ( ) throws Exception
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

Exceptions
Exceptionif the request fails
Returns
a list of Cancer incidence objects.
static List<EarthquakeUSGS> bridges.connect.Bridges.getEarthquakeUSGSData ( int  maxElements) throws Exception
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

Parameters
nameUSGS account name - must be "earthquake" to create account
maxElementsthe number of earthquake records retrieved, limited to 5000
Exceptions
Exceptionif the request fails
Returns
a list of earthquake records
static List<Game> bridges.connect.Bridges.getGameData ( ) throws Exception
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

Exceptions
Exceptionif the request fails
Returns
a list of Game objects.
static List<GutenbergBook> bridges.connect.Bridges.getGutenbergBookMetaData ( ) throws Exception
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.

Exceptions
Exceptionif the request fails
Returns
a list of GutenbergBook objects
static String bridges.connect.Bridges.getKey ( )
static

Get application key

Returns
application key value (string)
static List<Shakespeare> bridges.connect.Bridges.getShakespeareData ( ) throws Exception
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

Exceptions
Exceptionif the request fails
Parameters
{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.
Returns
a list of Shakespeare objects.
static List<Shakespeare> bridges.connect.Bridges.getShakespeareData ( String  works) throws Exception
static
static List<Shakespeare> bridges.connect.Bridges.getShakespeareData ( String  works,
Boolean  textOnly 
) throws Exception
static
static Song bridges.connect.Bridges.getSong ( String  songTitle) throws Exception
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

Exceptions
Exceptionif the request fails
Returns
a Song object.
static Song bridges.connect.Bridges.getSong ( String  songTitle,
String  artistName 
) throws Exception
static
static List<Song> bridges.connect.Bridges.getSongData ( ) throws Exception
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

Exceptions
Exceptionif the request fails
Returns
a list of Song objects.
static String bridges.connect.Bridges.getUserName ( )
static

This exists to prevent duplicate error traces.

Returns
user id (string)
void bridges.connect.Bridges.init ( int  assignment,
String  username,
String  appl_id 
)

Initialize Bridges

Parameters
<E>
assignmentthis is the assignmen id (integer)
appl_idthis is the appl authentication key(from the Bridges account)
usernamethis is the username (from the Bridges account)
static void bridges.connect.Bridges.setAssignment ( int  assignment)
static

set the assignment id

Parameters
assignmentnumber (int)
void bridges.connect.Bridges.setCoordSystemType ( String  coord)
Parameters
coordthis 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.

Parameters
dsThe data structure to set (any of the subclasses of DataStruct)
void bridges.connect.Bridges.setDescription ( String  description)
Parameters
descrdescription to annotate the visualization;
static void bridges.connect.Bridges.setKey ( String  key)
static

Set application key

Parameters
keyapplication key value (string)
void bridges.connect.Bridges.setMapOverlay ( Boolean  flag)

Turns on map overlay for subsequent visualizations - used with location specific datasets

Parameters
flagthis is the boolean flag for displaying a map overlay
void bridges.connect.Bridges.setServer ( String  server)
Parameters
serverserver to which to connect. Options are: ['live', 'local', 'clone'], and 'live' is the default;
void bridges.connect.Bridges.setTitle ( String  title)

Bridges JSON Parameters

Parameters
titletitle used in the visualization;
static void bridges.connect.Bridges.setUserName ( String  userName)
static

set User id

Parameters
userName(string)
void bridges.connect.Bridges.setVisualizeJSON ( boolean  flag)
Parameters
setthe 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.

Exceptions
RateLimitException
IOException
boolean bridges.connect.Bridges.visualizeJSON ( )
Parameters
checkif the flag to output the JSON is set

The documentation for this class was generated from the following file: