Java: Listing Datasets

Listing all Datasets

Liberator liberator = new Liberator();

Object datasets_id = liberator.datasets(new HashMap<>() );
       
for (Liberator.QueryResult res : liberator.Generate()) {
    Object res_id = res.GetId();
    Object data = res.GetData();
    if(data instanceof org.apache.arrow.vector.VectorSchemaRoot){
        org.apache.arrow.vector.VectorSchemaRoot recordBatch = (org.apache.arrow.vector.VectorSchemaRoot) data;
        printRecordBatch(recordBatch);
    } else if (data instanceof javax.json.JsonValue){
        javax.json.JsonValue jsonValue = (javax.json.JsonValue) data;
        System.out.println(jsonValue);
    } 
}

The liberator.datasets() call will return a dictionary object with all the datasets available. The above code prints out a return similar to the following.

{ 'Intraday': ['SSR_Forward_DSI',  'Halt_Production_DSI', 'SSR_Production_DSI', 'News', 'Twitter', 'Stocktwits', 'Halt_Forward_DSI'], 'Monthly': ['Joblink Ticker Mapping', 'VerticalKnowledge Indeed'], 'Tesseract',
...
'Market Data': [ 'daily_bars', 'minute_bars',  'nbbo', 'trades', 'daily_bars_adjusted’]}

Listing Permissioned Datasets

Liberator liberator = new Liberator();

Object datasets_id = liberator.datasets(new HashMap<>() );
       
for (Liberator.QueryResult res : liberator.Generate()) {
    Object res_id = res.GetId();
    Object data = res.GetData();
    if(data instanceof org.apache.arrow.vector.VectorSchemaRoot){
        org.apache.arrow.vector.VectorSchemaRoot recordBatch = (org.apache.arrow.vector.VectorSchemaRoot) data;
        printRecordBatch(recordBatch);
    } else if (data instanceof javax.json.JsonValue){
        javax.json.JsonValue jsonValue = (javax.json.JsonValue) data;
        System.out.println(jsonValue);
    } 
}

By simply passing ‘entitled = True’ to the datasets call you will get a list of only the datasets to which you are entitled.