PanLex Bot

Up

The PanLex Bot is a program that runs on the main PanLex server. Its purpose is to manage and automate several aspects of acquisition management and assimilation through Wrike. The bot runs under the Wrike user “PanLex Bot ⚙”. The main features of the bot are summarized here.

PanLem Notifications

PanLem sends notifications for various events causing changes in the database to the “PanLem Notifications” task in the “Administration” folder.

Roles

PanLex contributors with Wrike accounts have one of two Wrike roles: User or Collaborator. Users can view, edit, create, delete, and assign tasks. Collaborators are limited to viewing tasks, commenting on them, and changing their status. More information on the differences is available here.

Since Wrike charges for User licenses but not for Collaborators, it is useful to limit the number of Users. For some parts of the PanLex workflow, the Collaborator role is sufficient; for others, the User role is necessary. The bot makes it possible to change your role at any time. To do so, open the “User promotion/demotion” task in the “Administration” folder and follow the instructions.

Unless otherwise instructed by the PanLex staff, you should always demote yourself to Collaborator after finishing your work for the day. This will free up an available User for other workers.

Acquisition

The PanLex Bot performs several actions on source tasks (subtasks in the “Acquisition Languages” folder, main tasks in the “Acquisition Sources” folder):

  • When a source subtask is created in the “Acquisition Languages” folder, it is automatically added to the “Acquisition Sources” folder.
  • A source template is added to the description of newly created source tasks, containing entries for various fields used in registering the source and managing its acquisition.
  • The source task’s custom fields are kept up to date with the task description and task importance. This facilitates sorting and filtering.
  • The source task’s supertasks (the language tasks it belongs to) are kept up to date with the list of language varieties in the task description. (If no language task can be found from the list of language varieties, no changes are made. Otherwise, the source task would end up belonging to no languages.)
  • When a source task is marked as completed for the first time, the bot tries to register it in the PanLex database, using the information in the task description. The outcome is reported in a comment. If registration was successful, the new source ID and a link to the source page on PanLem are reported. If there was an error, details of the error are reported and the task status is changed to “Error”.
  • When source information in the task description is modified after registration, the bot can update the record in the database. In order for the bot to know that an update is necessary, the task status must be changed from “Completed” to another status such as “In Progress”. When the changes are complete, the status should be set back to “Completed”. The outcome of an update is reported in the same way as for new source registration.
  • In certain cases, the source ID the bot associates with a source task can be incorrect. This can happen when the source was already registered in the PanLex database outside of Wrike, or when it was registered through Wrike but later deleted in the database. To fix this, you can add a field to the MAIN section of the task description called “id”. The value of the “id” field should be either a numeric source ID (to specify which source in the database to update) or “recreate” (to specify that a deleted source should be recreated).

When an acquired resource directory is uploaded to the resource archive, the following actions are performed:

  • A new task is created under “Acquisition Uploads”, named for the uploaded directory name (minus any suffixed disambiguation number, such as “-2”). The task is randomly assigned for review to a member of the “Acquisition Reviewers” group on Wrike. The uploader and a configurable list of staff members are added as task followers. A comment is added with a link to the uploaded directory, plus links to any associated source tasks and the corresponding PanLem source pages (for sources that have been registered). The upload is also reported as a comment on the associated source tasks.
  • Subsequent uploads of the same directory are reported as comments on the upload task and any associated source tasks.
  • When the upload task is marked as completed, the most recently uploaded directory is moved from incoming to main. The replaced directory in main (if any) is saved in old. Previously uploaded directories with the same base name in incoming are also moved to old. A comment is added reporting the directory move, with a link to the new directory. The move is also reported on any associated source tasks.
  • An upload of the same directory following completion of the upload task causes the task status to be set back to active.

The PanLex Bot performs only one action on language tasks in the “Acquisition Languages” folder: custom fields are kept up to date with the task title and task importance. This facilitates sorting and filtering. Note that if the task title ends with an ISO 639-3 code in square brackets (“[abc]”), the “ISO 639-3 Code” field will be set. If the task title instead ends with a PanLex UID in square brackets (“[abc-000]”), the “PanLex UID” field will be set. (The “Glottocode” field is not automatically set by the bot currently.)

Assimilation

The PanLex Bot performs several actions when a final source file is submitted to PanLem, and when an assimilated source’s directory is uploaded to the resource archive:

  • A new task is created under “Assimilation Uploads”, named for the source’s directory name (minus any suffixed disambiguation number, such as “-2”). The task is randomly assigned for review to a member of the “Assimilation Reviewers” group on Wrike. The submitter or uploader is added as a task follower. A comment is added with a link to the submitted source or uploaded directory.
  • Subsequent submissions of the same source and uploads of the same directory are reported as additional comments on the existing task.
  • When the task is marked as completed, the most recently uploaded directory is moved from incoming to main. The replaced directory in main (if any) is saved in old. Previously uploaded directories with the same base name in incoming are also moved to old. A comment is added reporting the directory move, with a link to the new directory.
  • An upload of the same directory following completion of the task causes the task status to be set back to active.

The PanLex Bot also handles requests by PanLem users to edit the meanings of a source, if the request cannot be granted automatically:

  • When a request is made, a new task is created in the “Assimilation Edit Requests” folder, which is visible only to PanLex staff.
  • When a staff member marks the task as completed, the bot grants editorship of the source to the PanLem user, and notifies the user on Wrike (if there is a matching account).

Custom queries

The bot reports the results of certain queries (statistics on Wrike tasks and the like) that would be tedious to perform manually. To see what queries are available, go to the “Custom queries” task in the “Administration” folder and read the description.