> For the complete documentation index, see [llms.txt](https://docs.geopard.tech/geopard-tutorials/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.geopard.tech/geopard-tutorials/ukrainian/dokumentaciya-api/geopard-api-requests-overview/16.-query-get-yielddatasets.md).

# 16. Запит: Отримати YieldDatasets

## Огляд

Отримати всі YieldDataset для вибраного поля.

YieldDataset можна отримати за допомогою універсальних запитів GraphQL:

1. `getFarms` за повною ієрархією Farm > Field > YieldDataset із фільтрами
2. `getFields` із пов’язаного Field та за ієрархією Field > YieldDataset
3. getYieldDatasets із широким набором фільтрів і підтримкою пагінації

{% hint style="warning" %}
Об’єкт "YieldDataset" потрібно завантажити заздалегідь.
{% endhint %}

## Сутність Yield Dataset

YieldDataset містить багато атрибутів. GraphQL дає змогу отримувати лише потрібні поля, значно зменшуючи розмір запиту й відповіді. Нижче наведено докладні пояснення кожного атрибута.

{% hint style="info" %}
Атрибути "YieldDataset", позначені нижче як *отримані з метаінформації,* є необов’язковими. Їх отримують із метаінформації набору даних, яка за своєю природою присутня не в кожному YieldDataset.
{% endhint %}

{% hint style="success" %}
Докладніше про атрибут `geoMaps` для YieldDataset можна дізнатися [тут](https://docs.geopard.tech/geopard-tutorials/ukrainian/dokumentaciya-api/geo-endpoints-for-spatial-data-access/wms-get-raster-pictures-of-spatial-data-layers/12.-yielddatasetsmap.md).
{% endhint %}

{% hint style="success" %}
Докладніше про те, як запускати очищення й калібрування для YieldDataset, можна дізнатися [тут](https://docs.geopard.tech/geopard-tutorials/ukrainian/dokumentaciya-api/geopard-api-requests-overview/84.-mutation-calibrate-and-clean-yielddataset.md).
{% endhint %}

```graphql
{
  uuid
  name #pattern "<OperationType> <YYYY-mm-DD>" Tillage
  number #total number of geofeatures
  geometryType #Polygons or Points
  totalCoveredArea(unit: HECTARES) #total area of all geometries (relevant for Polygons)
  fieldCoverage #percent of the field covered by the dataset
  fieldCoveredArea(unit: HECTARES) #union of geometries (without duplicates)

  attributes
  fullAttributes { #complete details per attribute
    name #link to statistics >> attribute
    transliteratedName
    fullName #correct human-readable name
    unit#units of measure
  }

  usedMachines { #used machines, which comes from the metainformation
    id
    serial
    operatorId
  } 

  createdDate #entity created datetime in GeoPard
  updatedDate #last update datetime
  operationId
  operationType
  operationFileDate #file creation datetime comes from the metainformation 
  operationStartDate #start of the operation comes from the metainformation
  
  statistics { #statistics distribution for every attribute
    attribute
    min
    max
    avg
    mdn
    var
    std
    sum
  }
  
  cropName #crop name comes from the metainformation
  cropToken #crop token (in uppercase) comes from the metainformation

  appliedCorrections #list of applied corrections in the mentioned order
  appliedCorrectionsVersion #version of the used correction algorithm

  geoMaps {
    url
    shortName #prefix options: raw, thumbnail_raw, processed, thumbnail_processed
    hexColorCodes
    classes
  } 
}
```

## 1. Запит getFarms

### Запит

{% code overflow="wrap" lineNumbers="true" %}

```graphql
query GetYieldDatasetsViaGetFarms {
  getFarms (farmUuids: ["9eecef55-f74f-4099-991a-05cbd976d50a"]) {
    uuid
    name
    fields (fieldUuids: ["a050fc6f-1df8-4997-ae5b-5d0afa03a1ba"]) {
      uuid
      yieldDatasets {
        uuid
        name
        number
        geometryType
        totalCoveredArea(unit: HECTARES)
        fieldCoverage
        fieldCoveredArea(unit: HECTARES)
      }
    }
  }
}
```

{% endcode %}

### Відповідь

```json
{
  "data": {
    "getFarms": [
      {
        "uuid": "9eecef55-f74f-4099-991a-05cbd976d50a",
        "name": "TEST VECTOR DATA",
        "fields": [
          {
            "uuid": "a050fc6f-1df8-4997-ae5b-5d0afa03a1ba",
            "yieldDatasets": [
              {
                "uuid": "08f0fee4-daf4-4a98-97e5-660b7b6cfbeb",
                "name": "CALIBRATE-CLEAN-YieldCORN2017",
                "number": 14657,
                "geometryType": "POINTS",
                "totalCoveredArea": -1.0,
                "fieldCoverage": 0.97578,
                "fieldCoveredArea": 21.024173
              },
              {
                "uuid": "2b4fbd15-c961-49c8-8cc2-3031397d0380",
                "name": "CALIBRATE-YieldCORN2017",
                "number": 16200,
                "geometryType": "POINTS",
                "totalCoveredArea": -1.0,
                "fieldCoverage": 0.98791,
                "fieldCoveredArea": 21.285677
              },
              {
                "uuid": "465769d3-14dd-419f-9740-fb230c0505fd",
                "name": "YieldSbean2018_reupload",
                "number": 9073,
                "geometryType": "POINTS",
                "totalCoveredArea": -1.0,
                "fieldCoverage": 0.92874,
                "fieldCoveredArea": 20.0107663
              },
              {
                "uuid": "73d247ad-c45b-47a5-b94d-a2eb502857fe",
                "name": "CLEAN-YieldCORN2017 before build",
                "number": 14709,
                "geometryType": "POINTS",
                "totalCoveredArea": -1.0,
                "fieldCoverage": 0.98305,
                "fieldCoveredArea": 21.1808419
              },
              {
                "uuid": "74f06214-1051-47a2-a560-696d9290245a",
                "name": "YieldSbean2018",
                "number": 10179,
                "geometryType": "POINTS",
                "totalCoveredArea": -1.0,
                "fieldCoverage": 0.92874,
                "fieldCoveredArea": 20.0107663
              },
              {
                "uuid": "7e2bc706-2da4-43ae-beaa-240300d20c53",
                "name": "YieldSbean2015",
                "number": 10293,
                "geometryType": "POINTS",
                "totalCoveredArea": -1.0,
                "fieldCoverage": 0.96217,
                "fieldCoveredArea": 20.730980600000002
              },
              {
                "uuid": "7fb9fb1f-c4df-4146-892c-ba672dab9cd7",
                "name": "CALIBRATE-CLEAN-YieldSbean2018",
                "number": 9026,
                "geometryType": "POINTS",
                "totalCoveredArea": -1.0,
                "fieldCoverage": 0.92426,
                "fieldCoveredArea": 19.914270300000002
              },
              {
                "uuid": "8a97fc98-d6a5-4fb0-bd8d-d50c50b1adb8",
                "name": "CLEAN-YieldCORN2017 after build",
                "number": 14709,
                "geometryType": "POINTS",
                "totalCoveredArea": -1.0,
                "fieldCoverage": 0.98305,
                "fieldCoveredArea": 21.1808419
              },
              {
                "uuid": "a7f9d7cc-e1e1-46ff-b13d-468518749ba9",
                "name": "CALIBRATE-YieldSbean2015",
                "number": 9310,
                "geometryType": "POINTS",
                "totalCoveredArea": -1.0,
                "fieldCoverage": 0.95482,
                "fieldCoveredArea": 20.5726658
              },
              {
                "uuid": "cbd0c66b-21e3-4997-96a7-f1179da18c36",
                "name": "CLEAN-CALIBRATE-YieldSbean2015",
                "number": 9183,
                "geometryType": "POINTS",
                "totalCoveredArea": -1.0,
                "fieldCoverage": 0.90674,
                "fieldCoveredArea": 19.5366444
              },
              {
                "uuid": "fdfd701f-6529-4f4e-8027-e831fb557fe2",
                "name": "YieldCORN2017",
                "number": 16334,
                "geometryType": "POINTS",
                "totalCoveredArea": -1.0,
                "fieldCoverage": 0.97947,
                "fieldCoveredArea": 21.103661199999998
              }
            ]
          }
        ]
      }
    ]
  }
}
```

## 2. Запит getFields

### Запит

{% code overflow="wrap" lineNumbers="true" %}

```graphql
query GetYieldDatasetsViaGetFields {
  getFields (filter: {fieldUuid: "a050fc6f-1df8-4997-ae5b-5d0afa03a1ba"}) {
    fields {
      uuid
      area(unit: HECTARES)
      yieldDatasets(yieldDatasetUuids: ["8a97fc98-d6a5-4fb0-bd8d-d50c50b1adb8"]) {
        uuid
        name
        number
        geometryType
        totalCoveredArea(unit: HECTARES)
        fieldCoverage
        fieldCoveredArea(unit: HECTARES)
      }
    }
  }
}
```

{% endcode %}

### Відповідь

```json
{
  "data": {
    "getFields": {
      "fields": [
        {
          "uuid": "a050fc6f-1df8-4997-ae5b-5d0afa03a1ba",
          "area": 21.541909393943847,
          "yieldDatasets": [
            {
              "uuid": "8a97fc98-d6a5-4fb0-bd8d-d50c50b1adb8",
              "name": "CLEAN-YieldCORN2017 after build",
              "number": 14709,
              "geometryType": "POINTS",
              "totalCoveredArea": -1.0,
              "fieldCoverage": 0.98305,
              "fieldCoveredArea": 21.1808419
            }
          ]
        }
      ]
    }
  }
}
```

## 3. Запит getYieldDatasets

### Запитайте першу сторінку

```graphql
query GetPaginatedYieldDatasets {
    getYieldDatasets(
        filter:{
            fieldUuid: "a050fc6f-1df8-4997-ae5b-5d0afa03a1ba"
            pageSize: 2
        }
    ) {
        yieldDatasets {
            uuid
            name
            fieldCoverage
            fieldCoveredArea(unit: HECTARES)
            number
        }
        lastEvaluatedKey {
            PartitionKey
            SortKey
            TagString
        }
    }
}
```

### Відповідь для першої сторінки

```json
{
  "data": {
    "getYieldDatasets": {
      "yieldDatasets": [
        {
          "uuid": "08f0fee4-daf4-4a98-97e5-660b7b6cfbeb",
          "name": "CALIBRATE-CLEAN-YieldCORN2017",
          "fieldCoverage": 0.97578,
          "fieldCoveredArea": 21.024173,
          "number": 14657
        },
        {
          "uuid": "2b4fbd15-c961-49c8-8cc2-3031397d0380",
          "name": "CALIBRATE-YieldCORN2017",
          "fieldCoverage": 0.98791,
          "fieldCoveredArea": 21.285677,
          "number": 16200
        }
      ],
      "lastEvaluatedKey": {
        "PartitionKey": "FIELD-a050fc6f-1df8-4997-ae5b-5d0afa03a1ba",
        "SortKey": "YVDATA-2b4fbd15-c961-49c8-8cc2-3031397d0380",
        "TagString": null
      }
    }
  }
}
```

### Запитайте наступну сторінку

Параметри пагінації передаються через `lastEvaluatedKey`, використовуючи значення, повернуте у відповіді для першої сторінки вище.

```graphql
query GetPaginatedYieldDatasets {
    getYieldDatasets(
        filter:{
            fieldUuid: "a050fc6f-1df8-4997-ae5b-5d0afa03a1ba"
            pageSize: 2
            lastEvaluatedKey: {
                PartitionKey: "FIELD-a050fc6f-1df8-4997-ae5b-5d0afa03a1ba",
                SortKey: "YVDATA-2b4fbd15-c961-49c8-8cc2-3031397d0380",
                TagString: null
            }
        }
    ) {
        yieldDatasets {
            uuid
            name
            fieldCoverage
            fieldCoveredArea(unit: HECTARES)
            number
        }
        lastEvaluatedKey {
            PartitionKey
            SortKey
            TagString
        }
    }
}
```

### Відповідь для наступної сторінки

```json
{
  "data": {
    "getYieldDatasets": {
      "yieldDatasets": [
        {
          "uuid": "465769d3-14dd-419f-9740-fb230c0505fd",
          "name": "YieldSbean2018_reupload",
          "fieldCoverage": 0.92874,
          "fieldCoveredArea": 20.0107663,
          "number": 9073
        },
        {
          "uuid": "73d247ad-c45b-47a5-b94d-a2eb502857fe",
          "name": "CLEAN-YieldCORN2017 before build",
          "fieldCoverage": 0.98305,
          "fieldCoveredArea": 21.1808419,
          "number": 14709
        }
      ],
      "lastEvaluatedKey": {
        "PartitionKey": "FIELD-a050fc6f-1df8-4997-ae5b-5d0afa03a1ba",
        "SortKey": "YVDATA-73d247ad-c45b-47a5-b94d-a2eb502857fe",
        "TagString": null
      }
    }
  }
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.geopard.tech/geopard-tutorials/ukrainian/dokumentaciya-api/geopard-api-requests-overview/16.-query-get-yielddatasets.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
