API Phrase TMS

Aggregazioni analisi (TMS)

Contenuti tradotti automaticamente dall'inglese con Phrase Language AI.

Il datastore che esegue le query di aggregazione è basato su Elasticsearch (attualmente versione 1.7.x). Elasticsearch fornisce ricerche in tempo reale e funzionalità di aggregazione con l'API di analisi che forma un livello sottile e con sicurezza migliorata al di sopra di esso. Negli esempi viene utilizzata la lingua di query e aggregazione di Elasticsearch.

  • La lingua utilizzata nel campo filtrare della query JSON è descritta nella documentazione Elasticsearch Query DSL.

  • La lingua utilizzata nel campo aggregazioni della query JSON è descritta completamente nella documentazione Elasticsearch Aggregations.

Indici

Diversi tipi di dati risiedono in indici diversi. Ad esempio, i dati lavoro risiedono nell'indice jobPart, e i dati costi risiedono nell'indice costi. I dati richiesti possono essere specificati indicando l'indice nell'URL dell'endpoint dell'API di query.

Documenti entità principale-(entità) subordinata

Parti delle informazioni su un lavoro risiedono in due documenti diversi nel database Elasticsearch. Questi documenti sono in una relazione entità principale-(entità) subordinata. Ad esempio, le informazioni sul progetto di un lavoro risiedono nel documento entità principale, mentre le informazioni sul lavoro stesso risiedono nel documento (entità) subordinata. A seconda delle informazioni richieste, le query sono prima dell'aggregazione entità principale-(entità) subordinata dei dati o dopo di essa, ma l'aggregazione dei dati stessa dovrebbe essere presente in tutte le query.

Modelli dati indice

Dati comuni

Analisi

{
  "id": stringa,
  "createdBy": <User>,
  "dateCreated": Date,
  "dateDeleted": Date,
  "dateTrashed": Date,
  "deleted": boolean,
  "innerId": number,
  "name": stringa,
  "tags": string[],
  "trashed": boolean,
  "trashedBy": <User>,
  "type": stringa
}

Assegnazione

{
  "name": stringa,
  "linguist": <utente>,
  "vendor": <vendor>
}

Portale richieste

{
  "id": stringa,
  "createdBy": <User>,
  "dateCreated": Date,
  "dateDeleted": Date,
  "dateTrashed": Date,
  "deleted": boolean,
  "name": stringa,
  "tags": string[],
  "trashed": boolean,
  "urlId": string
}

Committente

{
  "id": stringa,
  "name": stringa
}

Cliente

{
  "id": stringa,
  "dateCreated": Date,
  "dateDeleted": Date,
  "dateTrashed": Date,
  "deleted": boolean,
  "externalId": string,
  "name": stringa,
  "tags": string[],
  "trashed": boolean,
}

CostCenter

{
  "id": stringa,
  "dateCreated": Date,
  "dateDeleted": Date,
  "dateTrashed": Date,
  "deleted": boolean,
  "name": stringa,
  "tags": string[],
  "trashed": boolean,
}

Dominio

{
  "id": stringa,
  "dateCreated": Date,
  "dateDeleted": Date,
  "dateTrashed": Date,
  "deleted": boolean,
  "name": stringa,
  "tags": string[],
  "trashed": boolean
}

Job

{
  "id": stringa,
  "createdBy": <User>,
  "dateCreated": Date,
  "dateDeleted": Date,
  "dateTrashed": Date,
  "deleted": boolean,
  "extension": string,
  "fileName": string,
  "groupCount": number,
  "innerId": "1",
  "languagePair": stringa,
  "lastModified": Date,
  "localePair": stringa,
  "sourceLanguage": stringa,
  "sourceLocale": stringa,
  "tags": string[],
  "targetLanguage": string,
  "targetLocale": string",
  "taskId": string,
  "trashed": boolean,
  "trashedBy": <User>,
  "uid": stringa
}

JobPart

{
  "id": "19",
  "assignedTo": <Assignment>,
  "beginIndex": number,
  "buyer": <Buyer>,
  "createdBy": <User>,
  "dateCreated": Date,
  "dateDue": Date,
  "endIndex": number,
  "groupCount": number,
  "innerId": string,
  "lastModified": Date,
  "level": number,
  "stato": stringa,
  "tags": [],
  "uid": stringa,
  "workflowStep": <WorkflowStep>
}

MtEngine

{
  "id": stringa,
  "deleted": boolean,
  "default_: boolean,
  "includeTags": boolean,
  "name": stringa,
  "tags": string[],
  "type": stringa,
}

NetRateScheme

{
  "id": stringa,
  "createdBy": <User>,
  "dateCreated": Date,
  "dateDeleted": Date,
  "default_": boolean,
  "deleted": boolean,
  "externalId": string,
  "name": stringa,
  "tags": string[],
}

PriceList

{
  "id": stringa,
  "createdBy": <User>,
  "currency": stringa,
  "dateCreated": Date,
  "dateDeleted": Date,
  "dateTrashed": Date,
  "default_": boolean,
  "deleted": boolean,
  "name": stringa,
  "tags": string[],
  "trashed": boolean,
  "unit": stringa
}

Progetto

{
  "id": stringa,
  "buyer": <Buyer>,
  "client": <Client>,
  "costCenter": <CostCenter>,
  "createdBy": <User>,
  "dateCreated": Date,
  "dateDeleted": Date,
  "dateDue": Date,
  "dateTrashed": Date,
  "deleted": boolean,
  "domain": <Domain>,
  "innerId": number,
  "languagePairs": string[],
  "localePairs": string[],
  "mtEngine": <MtEngine>,
  "name": stringa,
  "note": stringa,
  "proprietario": <utente>,
  "sourceLanguage": stringa,
  "sourceLocale": stringa,
  "stato": stringa,
  "subDomain": <SubDomain>,
  "tags": string[],
  "targetLanguages": string[],
  "targetLocales": string[],
  "trashed": boolean,
  "trashedBy": <User>,
  "uid": stringa,
  "vendor": <vendor>
}

preventivo

{
  "id": stringa,
  "createdBy: <utente>,
  "currency": stringa,
  "dateCreated": Date,
  "dateDeleted": Date,
  "dateTrashed": Date,
  "deleted": boolean,
  "innerId": string,
  "name": stringa,
  "stato": stringa,
  "tags": string[],
  "trashed": boolean,
  "trashedBy": <User>,
  "unit": stringa
}

Servizio

{
  "id": stringa,
  "dateCreated": Date,
  "dateDeleted": Date,
  "dateTrashed": Date,
  "deleted": boolean,
  "name": stringa,
  "publicName": stringa,
  "tags": string[],
  "trashed": boolean,
  "type": stringa
}

Sottodominio

{
  "id": stringa,
  "dateCreated": Date,
  "dateDeleted": Date,
  "dateTrashed": Date,
  "deleted": boolean,
  "name": stringa,
  "tags": string[],
  "trashed": boolean
}

Utente

{
  \"ID\": number,
  \"attivo\": boolean,
  "dateCreated": Date,
  "dateDeleted": Date,
  "dateTrashed": Date,
  "deleted": boolean,
  \"e-mail\": stringa,
  "firstName": string,
  "fullName": string,
  "innerId": number,
  "jobTitle": string,
  "lastName": string,
  \"impostazioni locali\": stringa,
  "note": stringa,
  \"role\": stringa,
  "tags": string[],
  "timeZone": string,
  "trashed": boolean,
  "userName": string
}

Vendor

{
  "id": stringa,
  \"candidate\": boolean,
  "dateCreated": Date,
  "dateDeleted": Date,
  "dateTrashed": Date,
  "deleted": boolean,
  "tags": string[],
  \"token\": stringa,
  "trashed": boolean
}

WorkflowStep

{
  "id": stringa,
  \"abbreviation\": stringa,
  "dateDeleted": Date,
  "dateTrashed": Date,
  "name": stringa,
  \"ordine\": number,
  "tags": string[],
  "trashed": boolean
}

Indice analisi

Aggregazione dati

"data": {
  "children": {
    "type": "analysisType"
  }
}

Documento entità principale

{
  "automationWidget": <AutomationWidget>,
  "project": <Project>,
  "service": <Service>
}

Documento (entità) subordinata

{
  "analysis": <Analysis>,
  "jobPart": <JobPart>,
  "job": <Job>,
  "netRateScheme": <NetRateScheme>,

  "priority": number,
  "data": {
    "mt": {
      "match0": {
        "characters": number,
        "pages": number,
        "percent": number,
        "segments": number,
        "words": number
      },
      "match100": {
        "characters": number,
        "pages": number,
        "percent": number,
        "segments": number,
        "words": number
      },
      "match50": {
        "characters": number,
        "pages": number,
        "percent": number,
        "segments": number,
        "words": number
      },
      "match75": {
        "characters": number,
        "pages": number,
        "percent": number,
        "segments": number,
        "words": number
      },
      "match85": {
        "characters": number,
        "pages": number,
        "percent": number,
        "segments": number,
        "words": number
      },
      "match95": {
        "characters": number,
        "pages": number,
        "percent": number,
        "segments": number,
        "words": number
      }
    },
    "repetitions": {
      "characters": number,
      "pages": number,
      "percent": number,
      "segments": number,
      "words": number
    },
    "TM": {
      "match0": {
        "characters": number,
        "pages": number,
        "percent": number,
        "segments": number,
        "words": number
      },
      "match100": {
        "characters": number,
        "pages": number,
        "percent": number,
        "segments": number,
        "words": number
      },
      "match101": {
        "characters": number,
        "pages": number,
        "percent": number,
        "segments": number,
        "words": number
      },
      "match50": {
        "characters": number,
        "pages": number,
        "percent": number,
        "segments": number,
        "words": number
      },
      "match75": {
        "characters": number,
        "pages": number,
        "percent": number,
        "segments": number,
        "words": number
      },
      "match85": {
        "characters": number,
        "pages": number,
        "percent": number,
        "segments": number,
        "words": number
      },
      "match95": {
        "characters": number,
        "pages": number,
        "percent": number,
        "segments": number,
        "words": number
      }
    },
    "total": {
      "characters": number,
      "pages": number,
      "percent": number,
      "segments": number,
      "words": number
    }
  }
}

Indice API

Aggregazione dati

"data": {
  "children": {
    "type": "apiType"
  }
}

Documento entità principale

{
  "utente": <utente>
}

Documento (entità) subordinata

{
  "request": {
    "date": Date,
    "host": stringa,
    "ipv4": stringa,
    "ipv6": string,
    "location": stringa,
    "method": stringa
  },
  "response": {
    "date": Date,
    "duration": number,
    "stato": number
  },
  "API": {
    "action": stringa,
    "asynch": boolean,
    "type": stringa,
    "uri": stringa,
    "ver": stringa
  }
}

Indice dei costi

Aggregazione dati

"data": {
  "children": {
    "type": "costsType"
  }
}

Documento entità principale

{
  "automationWidget": <AutomationWidget>,
  "project": <Project>,
  "service": <Service>
}

Documento (entità) subordinata

{
  "analysis": <Analysis>,
  "job": <Job>,
  "jobPart": <JobPart>,
  "netRateScheme": <NetRateScheme>,
  "priceList": <PriceList>,
  "quote": <Quote>,
  "workflowStep": <WorkflowStep>,
  
  "priority": number,
  "data": {
    "mt": {
      "match0": number,
      "match100": number,
      "match50": number,
      "match75": number,
      "match85": number,
      "match95": number
    },
    "repetitions": number,
    "TM": {
      "match0": number,
      "match100": number,
      "match101": number,
      "match50": number,
      "match75": number,
      "match85": number,
      "match95": number
    },
    "total": number
  }
}

Indice jobPart

Aggregazione dati

"data": {
  "children": {
    "type": "jobPartType"
  }
}

Documento entità principale

{
  "automationWidget": <AutomationWidget>,
  "project": <Project>,
  "service": <Service>
}

Documento (entità) subordinata

{
  "job": <Job>,
  "jobPart": <JobPart>

  "data": {
    "counts": {
      "chars": {
      "total": numero,
      "confirmed": numero,
      "notConfirmed": numero,
      "locked": numero,
      "notLocked": numero,
      "confirmedAndLocked": numero,
      "notConfirmedAndLocked": number,
      "completed": numero,
      "notCompleted": numero
    },
    "groups": {
      "total": numero
    },
    "segments": {
      "total": numero,
      "confirmed": numero,
      "notConfirmed": numero,
      "locked": numero,
      "notLocked": numero,
      "confirmedAndLocked": numero,
      "notConfirmedAndLocked": number,
      "completed": numero,
      "notCompleted": numero,
      "MT": {
        "postEdited": numero,
        "relevant": numero,
        "notRelevant": numero
      },
      "QA": {
        "checked": numero,
        "notChecked": numero
      }
    },
    "words": {
      "total": numero,
      "confirmed": numero,
      "notConfirmed": numero,
      "locked": numero,
      "notLocked": numero,
      "confirmedAndLocked": numero,
      "notConfirmedAndLocked": number,
      "completed": numero,
      "notCompleted": numero
    },
    "QA": {
      "warnings": numero,
      "ignoredWarnings": number,
      "notIgnoredWarnings": numero
    }
  }
}

Esempi

  • Le richieste HTTP vengono eseguite in Postman.

  • Accedi tramite un profilo PM o amministratore e ottieni un token di accesso utilizzando un'API di accesso.

  • Richieste POST a api/v3/analisi/jobPart?token=&lt;your_login_token&gt;

Numero totale di lavori

Query

{
  "aggregations": {
    "data": {
      "children": {
        "type": "jobPartType"
      }
    }
  }
}

Risposta

{
  "hits": {
    "total": 359
  },
  "aggregations": {
    "data": {
      "doc_count": 14417
    }
  }
}

Sotto il campo aggregations, l'aggregazione data ha risposto con 14.417 documenti corrispondenti mostrati nel campo doc_count.

Numero totale di parole di origine

Query

{
  "aggregations": {
    "data": {
      "children": {
        "type": "jobPartType"
      },
      "aggs": {
        "wordCount": {
          "sum": {
            "field": "data.volume.words"
          }
        }
      }
    }
  }
}

Risposta

{
  "hits": {
    "total": 359
  },
  "aggregations": {
    "data": {
      "doc_count": 14417,
      "wordCount": {
        "value": 6893067
      }
    }
  }
}

Numero totale di parole di origine diviso per lingua di destinazione

Query

{
  "aggregations": {
    "data": {
      "children": {
        "type": "jobPartType"
      },
      "aggs": {
        "byTargetLanguage": {
          "terms": {
            "field": "job.targetLanguage",
            "size": 3
          },
          "aggs": {
            "wordCount": {
              "sum": {
                "field": "data.volume.words"
              }
            }
          }
        }
      }
    }
  }
}

Risposta

{
  "hits": {
    "total": 359
  },
  "aggregations": {
    "data": {
      "byTargetLanguage": {
        "doc_count_error_upper_bound": 0,
        "sum_other_doc_count": 10071,
        "bucket": [
          {
            "doc_count": 1835,
            "wordCount": {
              "value": 702721
            },
            "key": "cs"
          },
          {
            "doc_count": 1491,
            "wordCount": {
              "value": 2602529
            },
            "key": "de"
          },
          {
            "doc_count": 1020,
            "wordCount": {
              "value": 92676
            },
            "key": "fi"
          }
        ]
      },
      "doc_count": 14417
    }
  }
}

L'entità bucket viene mostrata nella risposta. Quando al modulo di analisi viene chiesto di dividere i dati per una categoria, il risultato viene rappresentato come un elenco di bucket. Ogni bucket contiene una chiave che definisce quali dati rappresenta questo bucket (in questo caso una lingua di destinazione) e un valore (altre aggregazioni) specifico solo per questa parte del set di dati.

Numero totale di lavori diviso per stato del progetto

Query

{
  "aggregations": {
    "projectStatus": {
      "terms": {
        "field": "project.status"
      },
      "aggs": {
        "data": {
          "children": {
            "type": "jobPartType"
          }
        }
      }
    }
  }
}

Risposta

{
  "hits": {
    "total": 359
  },
  "aggregations": {
    "projectStatus": {
      "doc_count_error_upper_bound": 0,
      "sum_other_doc_count": 0,
      "bucket": [
        {
          "doc_count": 326,
          "data": {
            "doc_count": 14318
          },
          "key": "NEW"
        },
        {
          "doc_count": 31,
          "data": {
            "doc_count": 89
          },
          "key": "COMPLETED"
        },
        {
          "doc_count": 1,
          "data": {
            "doc_count": 4
          },
          "key": "ASSIGNED"
        },
        {
          "doc_count": 1,
          "data": {
            "doc_count": 6
          },
          "key": "DECLINED_BY_VENDOR"
        }
      ]
    }
  }
}

Al modulo di analisi è stato detto di dividere i dati per stato del progetto prima dell'aggregazione dati.

Numero totale di lavori da nuovi progetti

Query

{
  "filter": {
    "term": {
      "project.status": "NEW"
    }
  },
  "aggregations": {
    "data": {
      "children": {
        "type": "jobPartType"
      }
    }
  }
}

Risposta

{
  "hits": {
    "total": 326
  },
  "aggregations": {
    "data": {
      "doc_count": 14318
    }
  }
}

Il campo filtrare viene utilizzato nella query. Questo restringe i dati prima delle aggregazioni successive.

Questo articolo ti è stato utile?

Sorry about that! In what way was it not helpful?

The article didn’t address my problem.
I couldn’t understand the article.
The feature doesn’t do what I need.
Other reason.

Note that feedback is provided anonymously so we aren't able to reply to questions.
If you'd like to ask a question, submit a request to our Support team.
Thank you for your feedback.