Retrieving chart metadata

i2 Analyze enables database administrators and third-party extensions to retrieve information about charts that users upload to the Information Store or the Chart Store. Specifically, you can find out which users have uploaded a particular chart, and when that chart was last accessed.

Note: In this context, "accessed" refers to when the chart was uploaded, downloaded, or had its details (that is, its history) requested by a user.

With this knowledge, you might implement a policy such that charts that haven't been accessed for a certain period of time are automatically deleted - but only after you send an alert to all the users who uploaded the chart to warn them.

Determining when a chart was last accessed

To determine when a chart was last accessed, you can query the chart deletion view, whose name has the following format: IS_Public.<ChartTableName>_DV. Provided that the item type in the i2 Analyze schema that represents charts has not been modified, its name is IS_Public.E_Analyst_S_Notebook_Ch_DV.

This view has the same structure as other deletion views, but with two extra columns:

Column nameDescription
chart_typeThe type of the chart - that is, web or desktop
last_seen_timeThe (UTC) date and time when the chart was last accessed

For this purpose, the last_seen_time column is pertinent. To determine which charts have not been accessed for approximately 12 months, you might execute the following (Db2) SQL statement:

SELECT item_id
FROM IS_Public.E_Analyst_S_Notebook_Ch_DV
WHERE last_seen_time < NOW() - 12 MONTHS;

You can then use the list of identifiers that this statement returns to find out which users need to be notified.

Determining which users uploaded a chart

The Information Store database provides a view that contains information about which users have uploaded a version of a particular chart. The default name of this view is IS_Public.E_Analyst_S_Notebook_Ch_Upload_Users. It has the following columns:

Column nameDescription
item_idThe item identifier of the chart record
user_principal_nameThe name of a user who uploaded any version of the chart

Therefore, to determine which users have uploaded (any version of) a chart that has an item_id of 1234, you might execute the following SQL statement:

SELECT user_principal_name
FROM IS_Public.E_Analyst_S_Notebook_Ch_Upload_Users
WHERE item_id = 1234;

Note: Even if the same user has uploaded multiple versions of the same chart, their principal name is only returned once for each chart.

With this list of user names in hand, you might decide to use one of the i2 Analyze APIs for sending alerts to users.