Skip to content

Example mutations

Example 1 - Login

This will return a token to be used for mutations and queries that require an authenticated user. Keep a copy of the generated token which is good by default for 7 days. After 7 days, you will need to login again to generate another token.

[click the image below to see a larger example] Image link

mutation {
  login(login: "Admin", email: "admin@deepsea-ai.org", password: "your admin password") {
    token
  }
}

Copy the token to the section HTTP HEADERS in the Bearer field, e.g.  Image link

{
  "Authorization": "Bearer eyJhbGciOiJIUzI1NiIsIn..."
}

Example 2 - Create a new user

This will create a new user and return the user information and a token to be used for mutations and queries that require an authenticated user. Keep a copy of the generated token which is good by default for 7 days. After 7 days, you will need to login again to generate another token.

[click the image below to see a larger example] Image link

Copy the token to the section HTTP HEADERS in the Bearer field, e.g.  Image link

{
  "Authorization": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJja2lzMzB2NGswMDAwZWZ0cmlycHdycmtrIiwiaWF0IjoxNjA4MTYzNDk2LCJleHAiOjE2MDg3NjgyOTZ9.kr55Rwqm6t9e3TqHTeqAXxXGfSAHvZIvNWfw8MfcGaw"
}

Example 3 - Add a VisualEvent

This requires an authenticated user token.

[click the image below to see a larger example]  Image link

Example 4 - Assign a Track

This requires an authenticated user token.

Tracks are collections of VisualEvents with the same unique identifier.
Classification of these VisualEvents can change from frame to frame with, e.g. on-line voting. This will assign a single classification across each frame in each track.

[click the image below to see a larger example] Image link

The mutation string:

mutation {
  assignTracks(videoReferenceUuid: "df62dbc4-b7dc-4e63-b870-11752453e065") {
    success
    message
  }
}

Example 5 - Verify a track

This requires an authenticated user token.

Verify a track. This will verify that the track is valid and assign the correct VARS concept to it.
This will be useful in the active learning phase of the machine learning workflow where select annotations from each track can put back into the training libraries. This can also be useful for improving tracking algorithms.

[click the image below to see a larger example] Image link

The mutation string:

mutation {
  verifyTrack(uuid: "df62dbc4-b7dc-4e63-b870-11752453e065", varsConcept: "Chionoecetes tanneri")
  {
    success
    message
  }
}

Example 6 - Add a machine learning class and its associated VARS concept

This requires an authenticated user token.

[click the image below to see a larger example] Image link The mutation string:

mutation {
  addClass( 
    name: "Nanomia_bijuga",  
    varsConcept: "Nanomia bijuga"
  )
  {
    success
    message
  }
}

Example 7 - Delete all tracks for a given video

This requires an authenticated user token.

[click the image below to see a larger example] Image link The mutation string:

mutation {
  deleteTracksByVideo(videoReferenceUuid: "21d00e55-86e7-4d59-bf42-d57eb0e4b902")
  {
    success
    message
  }
}