removeData static method

Future<void> removeData(
  1. Map<String, dynamic> data
)

Removes data from the recommender engine

The data map can contain has the following fields

['pois'] : a list of strings identifying the pois

['categories'] : a list of strings identifying the pois

['links_categories'] : a list of maps with:

      ['category1']: The string id of the first category to link

      ['category2']: The string id of the second category to link

['links_poi_category']: a list of maps with:

      ['poi']: the string id of the poi to link

      ['category']: the stdring id of the category to link

['person']: A map with:

  ['pois']: a list of string ids of pois a person like/visited

  ['categories']: a list of string ids of categories the person is interested in 

The methods throws a LgcreException if setting data fails, for instance:

  1. if passing an invalid key in the data map, 2) removing a link between two unexisting entities or 3) an internal error occurs

Entities (categories, pois etc.) are identified by unique ids. If an unexising entity is removed twice nothing happens. The same happens for relations/links between entities added, it the link does not exist, nothing happens.

If both entities and links between those entities are removed in the same call, it is guaranteed that links are removed first and entities second to prevent throwing an error for an entity not existing when removing the link

This method is transactional and can be executed concurrently with other transactional methods

Implementation

static Future<void> removeData(Map<String, dynamic> data)  async
{
  try
  {
    await _channel.invokeMethod('removeData', data);

  } on PlatformException catch (e)
  {
    throw new LgcreException('${e.message}');
  }
}