Queries
When you’re in the Explore tab, you'll see a query search bar above your items. This bar takes JSON queries that'll allow you to search for items in your project that match any given criteria. To see information about queries regarding Multimodal projects, read here.
Here are some example queries you can try out:
Function | Query |
---|---|
To search for items that have instances that are polygons and are assigned to the classes car or pedestrian . | instance(type = polygon AND className IN [Car, Pedestrian]) |
To search for items that have unresolved comments. | comment(resolved = false) |
To search for items that contain Bounding Boxes. | instance(type = bbox) |
To search for items that contain instances with the class Car . | instance(className = Car) |
To search for items that have the Completed status and are located in Folder1 . | metadata(status = Completed) AND folder = Folder1 |
To search for items that contain more than 3 instances with the class Car and the attribute Black . | instanceCount(className = Car AND attributes.name = Black) > 3 |
To search for pinned items. | metadata(pinned = true) |
Operators
You'll need to use operators to define your queries and values.
Operator | Description |
---|---|
= | Equal. |
!= | Not equal. |
> | Greater than. |
< | Less than. |
>= | Greater than or equal to. |
<= | Less than or equal to. |
() | Query parentheses. |
[] | Array. |
AND | Returns True if both statements are true. |
OR | Returns True if either statement is true. |
IN | Set of values to consider. |
NOT IN | Set of values to not consider. |
CONTAINS | Used to search for a substring and returns the results containing that substring. All text queries made with this operator are case-insensitive. |
When the attribute has a numeric type, the following operators will be supported for
attributes.name
: > < =< !=
Instance
These parameters can be found under the instance
field.
Parameter | Value | Text | Image | Video |
---|---|---|---|---|
type | bbox , polygon , polyline , point , ellipse , cuboid , rbbox , tag and relationship . | ✅ | ✅ | ✅ |
className | The value is a class's name. | ✅ | ✅ | ✅ |
attribute.name | The value is an attribute's name. | ✅ | ✅ | ✅ |
attribute.groupName | The value is an attribute group's name. | ✅ | ✅ | ✅ |
error | true , false , or null . | ❌ | ✅ | ❌ |
createdBy.email | The value is an email address. | ✅ | ✅ | ✅ |
createdBy.role | Annotator , QA or Admin . | ✅ | ✅ | ✅ |
creationType | Manual or Preannotation . | ❌ | ✅ | ❌ |
updatedBy.email | The value is an email address. | ✅ | ✅ | ✅ |
updatedBy.role | Annotator , QA or Admin . | ✅ | ✅ | ✅ |
createdAt | The value is a date with this format: YYYY-MM-DD. | ✅ | ✅ | ✅ |
updatedAt | The value is a date with this format: YYYY-MM-DD. | ✅ | ✅ | ✅ |
measure.bbox | area , width and height . | ❌ | ✅ | ❌ |
About class names
If the class name contains an operator (and, or, in, not in, contains), the query will handle them as operators, not as words in class names. For example, if the class name is
Cars and pedestrians
, the query will handle the wordcars
and the wordpedestrians
separately. Instead, you can use symbols, such as underscores, to separate the words. SoCars and pedestrians
would be changed tocars_and_pedestrians
.
Metadata
These parameters can be found under the metadata
field.
Parameter | Value | Text | Image | Video |
---|---|---|---|---|
status | NotStarted , InProgress , QualityCheck , Returned , Completed , and Skipped . | ✅ | ✅ | ✅ |
approvalStatus | true , false and null . | ✅ | ✅ | ✅ |
lastAction.email | The value is an email address. | ✅ | ✅ | ✅ |
lastAction.timestamp | The value is a date with this format: YYYY-MM-DD. | ❌ | ✅ | ✅ |
width | Numeric value. | ❌ | ✅ | ✅ |
height | Numeric value. | ❌ | ✅ | ✅ |
name | The value is the item's name. | ✅ | ✅ | ✅ |
pinned | true and false . | ❌ | ✅ | ❌ |
priority | Numeric value. | ✅ | ✅ | ✅ |
Other fields
Field | Parameter | Value | Text | Image | Video |
---|---|---|---|---|---|
assignment | [role_name]Email | The value is an email address. Use null for unassigned items. | ✅ | ✅ | ✅ |
comment | resolved | true and false . | ✅ | ✅ | ✅ |
commentCount | - | Numeric value. | ✅ | ✅ | ✅ |
tag | - | tag [operator] [tag name] | ❌ | ✅ | ✅ |
folderName | - | The value is the folder's name. | ✅ | ✅ | ✅ |
folderStatus | - | The value is the folder's status. | ✅ | ✅ | ✅ |
subsetName | - | The value is the subset’s name. | ✅ | ✅ | ✅ |
freeText | - | freeText [operator] text | ✅ | ❌ | ❌ |
random | - | Numeric value. | ✅ | ✅ | ✅ |
customMetadata | - | Depending on the field type. Please check this page for more information. | ✅ | ✅ | ✅ |
Sort items by query
With the use of the query bar, you can manually specify the data you want to order your item by. You can do so by using orderBy
. After typing it in the bar, you must then select one of the following parameters to specify the ordering.
Query | Description | Image | Video | Text |
---|---|---|---|---|
metadata.name | To order your items by name. | ✅ | ✅ | ✅ |
metadata.status | To order your items by status. | ✅ | ✅ | ✅ |
metadata.lastAction.date | To order your items by the date of the last action taken on an item. | ✅ | ✅ | ✅ |
metadata.priority | To order your items by priority score. | ✅ | ✅ | ✅ |
commentCount | To order by number of comments on an item. | ✅ | ✅ | ✅ |
InstanceCount | To order the number of instances within an item. | ✅ | ✅ | ✅ |
metadata.duration | To order by the duration of videos. | ❌ | ✅ | ❌ |
You can read about the functionality of the orderBy
query for the Multimodal project type here.
Query example
Say you want to sort the items that haven't been worked on by name, in ascending order. You can use the following query: metadata(status = NotStarted) orderBy metadata.name ASC
Another example is to sort the items that have been marked for Quality Check based on the date of the last action taken, in descending order: metadata(status = QualityCheck) orderBy metadata.lastAction.date DESC
You can't use orderBy as a sole query
Please note that you can't use the
orderBy
query on its own (e.g.orderBy metadata.status ASC
). Think of it as a secondary attachment to the overall query; it must follow a general query, such asmetadata
orcommentCount
, so that you can add an additional parameter to sort your items with.
Generate query
First, make sure that your dataset is synced. You can do so by pressing the Sync data button.
To generate a query:
- In the Explore tab, click the query input bar.
- Choose the suggested fields and operators or type the query yourself.
- To run the query, press
Enter
on the keyboard.
Save query
To save a query:
- Type a query in the query bar.
- Click on the star on the right side of the query bar.
- In the popup, type a query name.
- Check the Save as shared query box to make the query public to users with roles of Project Admin or higher.
- Click Save.
The maximum number of characters for a query is 60.
You can save up to 50 queries.
Only the creator of a shared query can make it private again.
Rename query
To rename a query:
- Click on the star in the query bar.
- Click the three dots
⋮
next to the query you want to rename. - Select Rename.
- Type a new query name.
- Click Rename.
Delete query
To delete a query:
- Click on the star in the query bar.
- Click the three dots
⋮
next to the query you want to delete. - Select Delete.
Team Owners and Team Admins can delete shared queries regardless of who created them.
Updated 24 days ago