# Optional Queries

## Segment List Query

The **Segment List** query retrieves all segments within a given dataset.

### **Input Parameter**

Your query should support the following:

* **`dataset`** *(Required)* – A key-value pair for each metadata key checked in the dataset filter. Used in queries as `{{ dataset.id }}`.

### **Expected Output**

Each segment should be represented as a row containing:

* **`id`** *(Required)* – The unique identifier of the segment.
* **`label`** *(Required)* – A descriptive label for the segment.
* **`start`** *(Required)* – The timestamp of the first data point in the segment in nanoseconds.
* **`stop`** *(Required)* – The timestamp of the last data point in the segment in nanoseconds.
* **Additional metadata fields** *(Optional)* – Any relevant metadata attributes.

<figure><img src="https://3590686807-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwEBNWlmdcxXBXd7oyqyR%2Fuploads%2F1V1kpCvMYTwEXpGYE09C%2FScreenshot%202025-01-29%20at%2019.24.58.png?alt=media&#x26;token=bb51b562-1786-452e-a3b9-39ebd73169be" alt=""><figcaption></figcaption></figure>

## Other Optional Queries

In addition to the core queries, Marple supports several optional queries for improved performance and functionality:

* **Time Series Batch** – Retrieves data for multiple signals within a time range, with optional subsampling.
* **Cursor Values** – Fetches signal values at a specific timestamp, useful for scatter plots and maps.
* **Cursor Statistics** – Computes min, max, and mean values within a time range.
* **Signal Table** – Joins multiple signals into a single table with a common timestamp column.
* **Sandbox Signal** – Derives a new signal from existing ones using a formula.
* **Sandbox Preview** – Previews the results of a derived signal before applying it.

<figure><img src="https://3590686807-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwEBNWlmdcxXBXd7oyqyR%2Fuploads%2Ffn2H0OkfswZ0hKNw0PQ3%2FScreenshot%202025-01-30%20at%2009.20.45.png?alt=media&#x26;token=5d15cea7-a0bb-4675-acd4-d8d80dd5f6b6" alt=""><figcaption></figcaption></figure>
