BddDatasets class

The BddDatasets class is a container of BddDataset, and provides an iterator to access all data sets of BDD.

dataset()

The dataset() method retrieves the specified data set. The syntax is:
dataset(collectionKey, databaseKey)
where:
  • collectionKey is the name of the data set (Dgraph collection).
  • databaseKey is the name of the Dgraph database to which the data set belongs.

Data sets created in Studio use the same name for both the database and collection keys. You can therefore supply only the collection key as an argument.

For example:
>>> dss = bc.datasets()
>>> claims_ds = dss.dataset('default_edp_e35f9cbe-96c7-4183-8485-71459b8bd620')
>>> claims_ds

WarrantyClaims  default_edp_e35f9cbe-96c7-4183-8485-71459b8bd620  default_edp_e35f9cbe-96c7-4183-8485-71459b8bd620  Hive  default.warrantyclaims

The first command retrieves the "default_edp_e35f9cbe-96c7-4183-8485-71459b8bd620" data set, while the second one prints the contents of claims_ds.

next()

The next() method retrieves the next data set. For example, assume there are two data sets:
>>> all_ds = bc.datasets()
>>> all_ds.next()

WarrantyClaims  default_edp_e35f9cbe-96c7-4183-8485-71459b8bd620  default_edp_e35f9cbe-96c7-4183-8485-71459b8bd620  Hive  default.warrantyclaims
>>> all_ds.next()

Taxi_Data       edp_cli_edp_f28fb378-333a-4e01-8b6e-01dc06ba1e14  edp_cli_edp_f28fb378-333a-4e01-8b6e-01dc06ba1e14  Hive  default.taxi_data
>>>