Evaluation API
Overview
The Evaluation API is designed to support open-access Synapse data analysis and modeling challenges. This framework provides tools for administrators to create new evaluations in Synapse and manage the users and data objects associated with an evaluation. An evaluation owner can control access to evaluation resources and registration, as well as track user participation and evaluate submitted models. This API will support user-facing interfaces to monitor evaluations including activity notifications and on-demand scoring and leaderboarding.
Data Models
Synapse Evaluations are constructed around three primary objects: Evaluation and Submission. These objects are defined by eponymous JSON schema files in the Synapse Repository Services. The UMLet file used to generate the following image is available .
Evaluation
Object representing a Synapse Evaluation
ID - unique ID for the Evaluation
eTag - optimistic concurrency flag; changes with each update
ownerID - principal ID of the owner of the Evaluation
name
description
contentSource - ID of the data source (e.g. entity) for the Evaluation (string)
status - enum describing the state of the Evaluation, one of: PLANNED, OPEN, CLOSED, COMPLETED
Submission
Immutable object to represent an entity submission to a Evaluation. A participant can create many Submissions for a given Evaluation.
ID - unique ID for the Submission
name
ownerID - principal ID of the Submission owner
evaluationID
entityID - ID of the submitted entity
version - specific entity version
createdOn - submission date
submitterAlias - the alias for the user or team creating the submission
SubmissionStatus
Object to track the status and score of a specific Submission. This object is generated at the time of submission, and can be modified by Evaluation administrators.
submissionID
eTag - optimistic concurrency flag; changes with each update
status - enum describing the state of the Submission, one of: OPEN, CLOSED, SCORED, INVALID
score - numerical score for this Submission (double between 0 and 1)
report - String describing this Submission and/or its scoring. May contain additional scoring information, error logs, etc.
annotations - Annotations object containing user-defined key-value annotations. Note: The contents of the annotations are mirrored to a second set of tables optimized for querying, as discussed here.
SubmissionBundle
Bundle object containing a Submission and its accompanying SubmissionStatus.
SubmissionStatusBatch
Used to upload a collection of Submission updates at once.
REST API
Evaluation
URL | HTTP Type | Description |
|---|---|---|
/evaluation | POST | Create a new Evaluation |
/evaluation/{evaluationId} | GET | Get a Evaluation |
/evaluation/{evaluationId} | PUT | Update a Evaluation |
/evaluation/{evaluationId} | DELETE | Delete a Evaluation |
/evaluation | GET | Batch Get Evaluations (Paginated) |
/evaluation/count | GET | Get the number of Evaluations |
/evaluation/name/{name} | GET | Find a Evaluation by name |
/evaluation/available | GET | Get the paginated list of Evaluations which the user has joined as a participant. |
Submission
URL | HTTP Type | Description |
|---|---|---|
/evaluation/submission?etag=<etag> | POST | Create a new Submission (and corresponding SubmissionStatus object). Required request parameter: |
/evaluation/submission/{submissionId} | GET | Get a Submission |
/evaluation/submission/{submissionId}/status | GET | Get the status of a Submission |
/evaluation/submission/{submissionId}/status | PUT | Update the status of a Submission. |
/evaluation/submission/{submissionId} | DELETE | Delete a Submission. |
/evaluation/{evaluationId}/submission/ /evaluation/{evaluationId}/submission/bundle/ | GET | Batch get my Submissions/SubmissionBundles for a given Evaluation. Optional request parameters: |
/evaluation/{evaluationId}/submission/all /evaluation/{evaluationId}/submission/status/all /evaluation/{evaluationId}/submission/bundle/all | GET | Batch get Submissions/SubmissionStatuses/SubmissionBundles for a given Evaluation. Optional request parameters: |
/evaluation/submission/{submissionId}/file/{fileHandleId} | GET | Get a temporary pre-signed URL to a File contained within a specified Submission. Optional request parameter: |
/evaluation/{evaluationId}/submission/count | GET | Get the number of Submissions for a given Evaluation. |
Access Restrictions
Access Restrictions and approvals may be applied to Evaluations. For details on the API see: Data Access Control
cURL Examples
Evaluation
Create an Evaluation
curl -i -k -H sessionToken:xxxxxxxxxxxxxxxx -H Accept:application/json -H Content-Type:application/json -d '{ "status":"PLANNED", "description":"description", "name":"my first evaluation", "contentSource":"contentSource" }' https://repo-staging.prod.sagebase.org/repo/v1/evaluationGet an Evaluation
curl -i -k -H sessionToken:xxxxxxxxxxxxxxxx -H Accept:application/json 'https://repo-staging.prod.sagebase.org/repo/v1/evaluation/1588317'Update an Evaluation
curl -i -k -H sessionToken:xxxxxxxxxxxxxxxx -H Accept:application/json -H Content-Type:application/json -X PUT -d '{ "id":"1588317", "createdOn":"2013-01-16T16:30:56.727Z", "etag":"eed22bca-d88e-4b4a-8b1a-35dca7b7b8db", "status":"OPEN", "description":"description", "ownerId":"1588313", "name":"my first evaluation", "contentSource":"contentSource" }' https://repo-staging.prod.sagebase.org/repo/v1/evaluation/1588317Delete an Evaluation
curl -i -k -H sessionToken:okxkSRyl3v0iIf0eutQfXA00 -H Accept:application/json -X DELETE 'https://repo-staging.prod.sagebase.org/repo/v1/evaluation/1588317'
Participant
Create a Participant
curl -i -k -H sessionToken:xxxxxxxxxxxxxxxx -H Accept:application/json -H Content-Type:application/json -d '{ "ownerId":"123456" }' https://repo-staging.prod.sagebase.org/repo/v1/evaluation/987654/participant
Delete a Participant
curl -i -k -H sessionToken:xxxxxxxxxxxxxxxx -H Accept:application/json -X DELETE 'https://repo-staging.prod.sagebase.org/repo/v1/evaluation/1588317/participant/1588313'
Submission
Create a Submission
curl -i -k -H sessionToken:xxxxxxxxxxxxxxxx -H Accept:application/json -H Content-Type:application/json -d '{ "evaluationId":"1588317", "entityId":"1588315", "versionNumber":"1", "name":"some-name" }' https://repo-staging.prod.sagebase.org/repo/v1/evaluation/submissionUpdate a SubmissionStatus
curl -i -k -H sessionToken:xxxxxxxxxxxxxxxx -H Accept:application/json -H Content-Type:application/json -X PUT -d '{ "id":"1589914", "modifiedOn":"2013-01-18T21:43:18.897Z", "etag":"13c88b1a-662c-4dd6-bb56-3976566516f7", "status":"SCORED", "score":0.42 }' https://repo-staging.prod.sagebase.org/repo/v1/evaluation/submission/1589914/statusDelete a Submission
curl -i -k -H sessionToken:dPF2TqGUq121PR36AwJhXw00 -H Accept:application/json -X DELETE 'https://repo-staging.prod.sagebase.org/repo/v1/evaluation/submission/1589912'
Example Workflow
The following is a proposed workflow for interacting with the Evaluation Services. Please note that some components are still under development.
User Perspective
Find a Synapse Evaluation
Sign up as a Participant
Download relevant Synapse Entities referenced in Evaluation
Submit a Synapse entity to the Evaluation
Track status of personal Submissions and view global Evaluation status/leaderboard
Earn achievements for participation / success
Owner/Admin Perspective
Create a Synapse Evaluation
Fill in details, attach relevant Synapse entities
Specify access requirements
Specify open/close dates
Listen for Submissions (using messaging service)
Download unscored Submissions
Perform scoring
Push scores back to each SubmissionStatus
Track user participation and publish Evaluation status/leaderboard
Award achievements for user participation / success
Planned Improvements
The following features are planned but not yet implemented.
Banned user lists
Banned users should be prohibited from participating in one or more Evaluations, and any Submissions by a banned user should be isolated from the general populations of Submissions.Customizable Amazon Simple Notification Services messaging tools
Evaluation administrators should have tools to configure a selective Amazon instance to listen for messages pertaining to Evaluations which they own. These messages should be sent to a queue dedicated to Evaluations.Immutable copies of submitted Entities
Once an Entity is submitted to a Evaluation, a static copy of that Entity should become the property of the Evaluation administration.Administrator lists for Evaluations
Evaluations should support administration by multiple users (rather than just the Evaluation owner). These admin lists should function as a lightweight ACL of sorts.
With the status object having status "CLOSED" it is possible to use the evaluations as a parallel processing queue:
You can write parallel scorers that run on multiple machines by having them use the "CLOSED" status as a semaphore for the fact that they are working on a computation.
The layout for each scorer would be:
Get the first "OPEN" submission
Change the status to "CLOSED" if this fails because the etag is out of date go to 1
Perform a complicated computation
Update the submission status to SCORED and store the output if if everything worked or
Update submission status to INVALID if you failed
if either of these failed because of an out of date etag goto 1
Once all of the OPEN submissions are gone look for CLOSED submissions that have a modifedBy older than a prescribed timeout and repeat steps 3 and 4 for these or just mark it as INVALID because of a timeout.