![]() |
Bridges-C++
3.1.1
Bridges(C++API)
|
#include <DataSource.h>
This class provides an API to various data sources used in BRIDGES.
BRIDGES currently supports a few external datasets for use with BRIDGES assignments: USGIS Earthquake Tweeet streaming data feed, IMDB (file), Book metadata collection, IGN Game Data, Shakespear book/poem meta data, etc.
Functions are provided that access a user specified number of data records; objects of the appropriate type are returned as a list.
Public Member Functions | |
| DataSource (bridges::Bridges *br=nullptr) | |
| DataSource (bridges::Bridges &br) | |
| vector< Game > | getGameData () |
| vector< ActorMovieIMDB > | getActorMovieIMDBData (int number=0) |
| vector< ActorMovieIMDB > | getActorMovieIMDBData2 () |
| vector< EarthquakeUSGS > | getEarthquakeUSGSData (int number=0) |
| vector< Shakespeare > | getShakespeareData (string type="", bool textonly=false) |
| Get data of Shakespeare works (plays, poems) More... | |
| Song | getSong (string songTitle, string artistName) |
| vector< Song > | getSongData () |
| vector< GutenbergBook > | getGutenbergBookData (int num=0) |
| vector< CancerIncidence > | getCancerIncidenceData (int num=0) |
| OSMData | getOSMDataFromJSON (const string &osm_json) |
| OSMData | getOSMData (double lat_min, double long_min, double lat_max, double long_max, string level="default") |
| OSMData | getOSMData (string location, string level="default") |
| OSMData | getOSMDataOld (string location) |
| old interface for the OSM data set. More... | |
| bridges::GraphAdjList< int, std::string > | getGraphFromAssignment (const std::string &user, int assignment, int subassignment=0) |
| bridges::ColorGrid | getColorGridFromAssignment (const std::string &user, int assignment, int subassignment=0) |
| std::vector< MovieActorWikidata > | getWikidataActorMovie (int yearbegin, int yearend) |
| This function returns the Movie and Actors playing in them between two years. More... | |
| ElevationData * | getElevationData (double latitMin, double longitMin, double latitMax, double longitMax, double res=0.0166) |
| ElevationData * | getElevationDataFromJSON (string elev_json) |
|
inline |
|
inline |
|
inline |
Get ActorMovie IMDB Data retrieved, formatted into a list of ActorMovieIMDB objects
| number | the number of actor/movie pairs, but currently unused, returns all records. |
| Exception | if the request fails |
|
inline |
Get ActorMovie IMDB Data retrieved, formatted into a list of ActorMovieIMDB objects
| Exception | if the request fails |
|
inline |
Retrieves the CDC dataset into a vector of records See CancerIncidence class for more information
|
inline |
Reconstruct a ColorGrid from an existing ColorGrid on the Bridges server
| user | the name of the user who uploaded the assignment |
| assignment | the ID of the assignment to get |
| subassignment | the ID of the subassignment to get |
|
inline |
Get USGS earthquake data USGS Tweet data (https://earthquake.usgs.gov/earthquakes/map/) retrieved, formatted into a list of EarthquakeUSGS objects
| number | the number of earthquake records retrieved, limited to 5000 |
| Exception | if the request fails |
|
inline |
Returns ElevationData for the provided coordinate box at the given resolution. Note that the ElevationData that is returned may have slightly different location and resolution.
| latitMin | minimum latitude requested |
| longitMin | maximum latitude requested |
| latitMax | minimum longitude requested |
| longitMax | maximum longitude requested |
| res | spatial resolution, aka the distance between two samples (in degrees) |
|
inline |
|
inline |
Get meta data of the IGN games collection.
This function retrieves and formats the data into a list of Game objects
| Exception | if the request fails |
|
inline |
Reconstruct a GraphAdjList from an existing GraphAdjList on the Bridges server
The reconstructed assignment sees vertices identified as integers in the order they are stored in the server. The data associated with a vertex is a string that come from the label of that vertices. The data associated with an edge is the string that come from the label of that edge. The edge weights are also reobtained from the bridges server.
| user | the name of the user who uploaded the assignment |
| assignment | the ID of the assignment to get |
| subassignment | the ID of the subassignment to get |
|
inline |
Get meta data of the Gutenberg book collection (1000 books) This function retrieves, and formats the data into a list of GutenbergBook objects
| Exception | if the request fails |
|
inline |
Get OpenStreetMap data given a bounding rectangle of lat/long values.
| Exception | if the request fails |
|
inline |
Get OpenStreetMap data given a city name and resolution level
| Exception | if the request fails |
|
inline |
Retrieves the Open Street Map data from a prebuilt JSON of OSM dataset.
| osm_json | JSON string |
|
inline |
old interface for the OSM data set.
This is hitting a simpler API that has only a few map in there: "uncc_campus", "charlotte", "washington_dc", "saint_paul", "new_york", "los_angeles", "san_francisco", "miami", "minneapolis", "dallas"
| location | which location to get the map from |
|
inline |
Get data of Shakespeare works (plays, poems)
This function retrieves and formats the data into a a list of Shakespeare objects.
| Exception | if the request fails |
| type | can be "plays", "poems", or "". If this is specified, then only these types of works are retrieved. |
| textonly | if this is set, then only the text is retrieved. (that is to say punctuation is stripped out) |
|
inline |
Get data of a particular songs (including lyrics) using the Genius API (https://docs.genius.com/), given the song title and artist name. Valid endpoints: http://bridgesdata.herokuapp.com/api/songs/find/ Valid queryParams: song title, artist name
This function retrieves and formats the data into a Song object. The song if not cached in the local DB is queried and added to the DB
| Exception | if the request fails |
|
inline |
Get data of the songs (including lyrics) using the Genius API https://docs.genius.com/ Valid endpoints: https://bridgesdata.herokuapp.com/api/songs/
This function retrieves and formats the data into a list of Song objects. This version of the API retrieves all the cached songs in the local DB.
| Exception | if the request fails |
|
inline |
This function returns the Movie and Actors playing in them between two years.
Return movie pair in the [yearbegin; yearend] interval.
| yearbegin | first year to include |
| yearend | last year to include |
1.8.13