Skip to content

media annotation query

Chihjen Ko edited this page Nov 27, 2018 · 1 revision

多媒體資料查詢

  • endpoint /media/annotation/query
  • post data MongoDB 的 find patterns,可利用 limit 與 skip 分頁。
{
  "query": { 
    "$or": [
      {     
        "$and": [
          {         
            "tokens.data.key": "species"
          },        
          {         
            "$or": [    
              {             
                "tokens.data.value": "鼬獾"
              },            
              {             
                "tokens.data.value": "鼬貛"
              }             
            ]           
          }
        ]       
      },
      {     
        "$and": [
          {         
            "tokens.data.key": "life-stage"
          },        
          {
            "tokens.data.value": "young"
          }         
        ]       
      }
    ]   
  },
  "
  ion": {
    "url": "$url",
    "projectTitle": "$projectTitle",
    "cameraLocation": "$cameraLocation"
  },
  "limit": 1000,
  "skip": 5000
}
  • response
{
  "ret": [
    {
      "type": "StillImage",
      "url": "string",
      "url_md5": "string",
      "multimedia_error_flag": false,
      "related_upload_sessions": [],
      "tokens": [
        {
          "token_id": "string",
          "token_error_flag": false,
          "species_shortTitlecut": "string",
          "description_level": "individual",
          "bbox": {
            "full_scope": true,
            "original_point": "topleft"
          },
          "meta": {
            "virtual_individual_id": "string",
            "virtual_part_id": "string"
          },
          "data": [
            {
              "key": "",
              "label": "",
              "value": "",
              "unit": "",
              "data_error_flag": false,
              "last_validated_timestamp": 0,
              "context": "camera-trap"
            }
          ]
        }
      ],
      "projectTitle": "string",
      "site": "string",
      "subSite": "",
      "cameraLocation": "string",
      "fullCameraLocationMd5": "string",
      "timezone": "string",
      "date_time_original": "string",
      "date_time_original_timestamp": 0,
      "year_original": "string",
      "month_original": "string",
      "day_original": "string",
      "hour_original": "string",
      "create_date": "string",
      "wgs84dec_x": 0,
      "wgs84dec_y": 0
    }
  ]
}