Watershed is powered by moments of activity called interaction statements (or xAPI statements). Sources ranging from mobile apps to learning management systems are connected to Watershed, and as users perform actions in these sources, interaction statements are sent into Watershed. Data Search shows every interaction statement that has been sent to your Watershed account and allows you to perform complex searches to find specific ones you're looking for. It is a great tool to troubleshoot data issues.
This guide covers Advanced Data Search. Please read Data Search to understand how to get to Data Search and configure the simple settings first.
- User Types
- Only Global Admins use Data Search.
- Pricing
- Available on Essentials and Enterprise plans.
- Expertise
- Experts can use data search.
Advanced Search
Advanced Search gives you some lesser used search options that can help you narrow down to very specific statements you need. 6 additional options come with Advanced Search: Statement ID, Registration ID, Related, Format, Report Filter, and Query. Use the Refresh button to search for values you add to one or more of the options (including options from Simple Search).
Statement ID
Use the Statement ID search to find an individual statement. This is useful for troubleshooting with a team.
Registration ID
This searches the context.registration for statements. A registration is a single person taking a single course in an LMS (like a session).
Related
These flags are associated with behavior as laid out in the xAPI specification and will find people related to users you search for if the Related Agents box is checked and related activities if the Related Activities box is checked.
Format
Format determines the format of the xAPI statements displayed in the search results.
- default - displays the data as it is used for reporting. This is useful when looking at the underlying data when working on report configuration. When default format is used, an additional checkbox labelled Include hierarchy info in results will appear above the interaction stream. Checking this box will also include person and group data associated with each interaction statement.
- exact - displays the data exactly as it was received by Watershed's LRS. This is useful when debugging a data source.
- ids - displays ids format as defined by xAPI. This might be useful for debugging a data source that outputs xAPI statements with large definitions.
- canonical - displays the canonical format as defined by xAPI. Currently this is the same as the default format, except it is not possible to include hierarchy info.
Report Filter
Paste in the Advanced Configuration from a report filter to search for all statements that would be used to get the data for the report.
Query
See below for more information about queries.
Custom Queries
In the Queries section of Advanced Search, you can search for statements using a concise query language.
Filter Expressions
You can filter statements using a number of different value tests:
- Equals: actor.mbox = 'mailto:john@example.com'
- Not equals: context.registration != 'b7fea80e-1685-4513-be92-59ddd13091f7'
- In: context.platform in ('Mac', 'Windows')
- Not In: authority.name not in ('Activity Provider 1', 'System 2')
- Range: result.score.scaled <= 0.8
Regular Expression Values
In the above filter expressions, you can use either literal quoted values or regular expression (regex) values. To use regular expression values, surround the value with /
characters and don't use quotes.
Please note: Regular expressions can only be used with string values, not numbers or booleans.
The following operators work as follows in regular expression values:
. | Match any single character |
+ | Match one or more of the preceding pattern |
* | Match zero or more of the preceding pattern |
? | Match zero or one of the preceding pattern |
{x, y} | Match between x and y of the preceding pattern |
(pattern) | Group a pattern, to use preceding operators on |
| | Combine patterns in an OR operator, ex. (abc|123) |
[xy] | Match character x or y |
[x-y] | Match any character between x and y |
[^x-y] | Match any character except those between x and y |
[^xy] | Match any character except x or y |
Examples
Match statements with test activity IDs in the example.com domain:
object.id = /http://example.com/activities/test.*/
Match statements with specific test activities in example.com domain:
object.id = /http://example.com/activities/test[123]/
Match statements involving the word test in the ID:
object.id = /.*test.*/
Match statements involving all actors using 'example.com' or 'example.org' emails:
actor.mbox in (/.+@example.com/, /.+@example.org/)
Or you can achieve the same result with regex alternatives:
actor.mbox = /.+@example.(com|org)/
Hint: You can also use regex in simple search fields, but you are required to escape / characters. This example will search for verbs starting with "http://adlnet.gov/" and ending in "/completed".
Composing Expressions
Some examples of how to compose expressions:
AND | actor.mbox = 'mailto:john@example.com' AND object.id = ' http://example.com/ |
OR | result.completion = true OR result.score.raw > 10 |
NOT
|
!(timestamp < '2017-01-01') |
Nesting | (actor.mbox = 'mailto:john@example.com' AND result.score.raw > 10) OR timestamp > '2017-01-01' |
Sorting
Results can be pages from the query expression:
Single sort
|
actor.mbox = 'mailto:john@example.com' order by stored descending |
Multi sort | result.score.scaled > 0.8 order by result.score.scaled desc, timestamp asc |
Paging
Results can be paged from the query expression:
Limit
|
result.score.scaled = 1.0 limit 10 |
Limit and offset | result.score.scaled = 1.0 limit 50,10 |
Full query language specification
query := [] [] [] filter := AND | OR | () | !(filter) | sorting := order by [, ]* sort-expression := [-] [asc | desc] paging := limit [,] filter-expression := | compare-expression := *[=|!=|<|>|<=|>=] * in-expression := [not] in ([,<value]) field := value := /regex/ | word := * | '*' | "*"