<commit_before>
# Timeseries API

This document will show several examples on how to interact with timeseries using the QuasarDB Java API. For the sake of clarity it will show the usage of double data types only; the blob interface mirros the double interface exactly, and you should use the respective blob classes you find in the [https://doc.quasardb.net/java/][(JavaDoc).

Given a QuasarDB timeseries table `doubles_test` that looks as follows

| timestamp           | value     |
| ------------------- | --------- |
| 2017-10-01 12:09:03 | 1.2345678 |
| 2017-10-01 12:09:04 | 8.7654321 |
| 2017-10-01 12:09:05 | 5.6789012 |
| 2017-10-01 12:09:06 | 2.1098765 |

## Inserting double data

The `insertDoubles` function is available on a `QdbTimeSeries` object which can be used to insert new double data into a timeseries. The following example shows how 

```java
String qdbUri = "qdb://127.0.0.1:2838";
QdbCluster cluster = new QdbCluster(qdbUri);
QdbTimeSeries series = cluster.gettimeSeries("doubles_test");

QdbDoubleColumnCollection data = new QdbDoubleColumnCollection("value");
data.add(new QdbDoubleColumnValue(1.2345678));
data.add(new QdbDoubleColumnValue(8.7654321));
data.add(new QdbDoubleColumnValue(5.6789012));
data.add(new QdbDoubleColumnValue(2.1098765));

series.insertDoubles(data);
```

## Querying double data<commit_msg>Fix broken link<commit_after>
# Timeseries API

This document will show several examples on how to interact with timeseries using the QuasarDB Java API. For the sake of clarity it will show the usage of double data types only; the blob interface mirros the double interface exactly, and you should use the respective blob classes you find in the [JavaDoc](https://doc.quasardb.net/java/)

Given a QuasarDB timeseries table `doubles_test` that looks as follows

| timestamp           | value     |
| ------------------- | --------- |
| 2017-10-01 12:09:03 | 1.2345678 |
| 2017-10-01 12:09:04 | 8.7654321 |
| 2017-10-01 12:09:05 | 5.6789012 |
| 2017-10-01 12:09:06 | 2.1098765 |

## Inserting double data

The `insertDoubles` function is available on a `QdbTimeSeries` object which can be used to insert new double data into a timeseries. The following example shows how 

```java
String qdbUri = "qdb://127.0.0.1:2838";
QdbCluster cluster = new QdbCluster(qdbUri);
QdbTimeSeries series = cluster.gettimeSeries("doubles_test");

QdbDoubleColumnCollection data = new QdbDoubleColumnCollection("value");
data.add(new QdbDoubleColumnValue(1.2345678));
data.add(new QdbDoubleColumnValue(8.7654321));
data.add(new QdbDoubleColumnValue(5.6789012));
data.add(new QdbDoubleColumnValue(2.1098765));

series.insertDoubles(data);
```

## Querying double data
{'fraction_non_alphanumeric': 0.1204460966542751, 'fraction_numerical': 0.09665427509293681, 'mean_word_length': 4.339285714285714, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1153754', 'n_tokens_mistral': 1017, 'n_tokens_neox': 838, 'n_words': 273}