How do I remove xAPI Statements from Watershed

When developing a new xAPI integration, we always recommend that you send data to Sandbox so that your Production account is kept free of any ‘bad statements’ (xAPI statements are are improperly formed or contain incorrect information). Bad statements do still sometimes slip through the net, however, and occasionally Watershed clients have a need to remove xAPI statements from their account. It is possible to remove these statements using a combination of Watershed’s CSV download and CSV upload functionality In a three step process:

  1. Identify the Data to Remove
  2. Set Up The Statement Voiding Template
  3. Download and Upload the CSV
Please note:
  • This is an advanced help guide that requires the ability to copy and paste JSON code.
  • You'll need to be a Global Admin user in order to remove xAPI Statements from Watershed.

Step 1: Identify the Data to Remove

The first step is to identify exactly which xAPI statements need to be removed. This is done by configuring a card with filters such that it includes just the statements to be removed. Create a new Leaderboard card with the following Advanced Configuration:

{
  "filter": {
  },
  "dimensions": [
    {
      "type": "STATEMENT_PROPERTY",
      "statementProperty": "id"
    }
  ],
  "measures": [
    {
      "name": "Person Name",
      "aggregation": {
        "type": "LAST"
      },
      "valueProducer": {
        "type": "STATEMENT_PROPERTY",
        "statementProperty": "actor.person.name",
        "caseSensitive": true
      }
    },
    {
      "name": "Verb",
      "aggregation": {
        "type": "LAST"
      },
      "valueProducer": {
        "type": "STATEMENT_PROPERTY",
        "statementProperty": "verb.display.en",
        "caseSensitive": true
      }
    },
    {
      "name": "Object",
      "aggregation": {
        "type": "LAST"
      },
      "valueProducer": {
        "type": "STATEMENT_PROPERTY",
        "statementProperty": "object.definition.name.en",
        "caseSensitive": true
      }
    },
    {
      "name": "Timestamp",
      "aggregation": {
        "type": "LAST"
      },
      "valueProducer": {
        "type": "STATEMENT_PROPERTY",
        "statementProperty": "timestamp",
        "caseSensitive": true
      }
    }
  ]
}

Depending on your data, you may need to change the language codes from “en” to “en-US” in order to see the object name and verb.

Then add filters to the card so that it contains the statements to be removed. Take great care to ensure that the card includes all of the statements to remove and no statements that should not be removed.

image5.png

Step 2: Set Up The Statement Voiding Template

In xAPI, statements are removed from circulation by sending another xAPI statement that marks the original statement as voided. This is done instead of just deleting the original statement because in scenarios where you have multiple connected LRSs, all LRSs need to know that the statement is void, rather than just deleting the statement in one LRS.

You can use Watershed’s Data Conversion Engine to generate the xAPI statements that will void the statements that you want to remove. Go to Data / Other Data Sources / Manage Import Templates. If the ‘Statement Void’ template does not already exist, click Add Import Template to add it.

image1.png

Call the template ‘Statement Void’ and click Next until you get to the final step. Paste in the following statement template and Click Save:

{
  "statements": [
    {{#ifEquals columns.[Dimension 1] "Average"}}{{else}}
      {
        "actor" : {
          "mbox" : "mailto:void@watershedlrs.com"
        },
        "verb" : {
          "id":"http://adlnet.gov/expapi/verbs/voided"
        },
        "object" : {
          "objectType":"StatementRef",
          "id" : "{{columns.[Dimension 1]}}"
        }
      }
    {{/ifEquals}}
  ]
}

image4.png

Step 3: Download and Upload the CSV

You're now ready to remove the statements. Return to the card you created and choose Download Data Tables. Check the CSV file you download very very carefully to ensure that these are in fact the statements that you want to remove. Once you upload this file to remove the statements, there’s no turning back!

image2.png

Armed with your carefully checked CSV file, return to Data / Other Data Sources , select the Statement Void template and drag and drop the file to upload.

image3.png

Once the import is complete, the statements will be voided and there will be no way to unvoid them. Clicking the ‘Void’ button next to the import to void the voiding will not work as xAPI does not allow voiding statements to be voided themselves.

While Voided and voiding statements do not appear in reports at all, if you void a large amount of data (tens of thousands of statements or more) then it’s possible that the voided and voiding statements could have a negative impact on the performance of some features of your Watershed account. Please let us know if you void a large number of statements (either in one go or over a period of time) so that we can clear the voided and voiding statements out of your account.

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

If you can't find what you need or you want to ask a real person a question, please contact customer support.