# How to model timeseries data in property graph?

**URL:** <https://community.neo4j.com/t/how-to-model-timeseries-data-in-property-graph/8713>\
**Category:** Modeling\
**Created:** [July 11, 2019, 3:03pm UTC](https://community.neo4j.com/t/how-to-model-timeseries-data-in-property-graph/8713 "2019-07-11T15:03:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![palandlom](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/palandlom/32/5600_2.png) [@palandlom](https://community.neo4j.com/u/palandlom)\
**Post date:** [July 11, 2019, 3:03pm UTC](https://community.neo4j.com/t/how-to-model-timeseries-data-in-property-graph/8713/1 "2019-07-11T15:03:36Z")

</div>

There will be a lot of data tied to time points (e.g. some measurement at some moment of time). We want to detect anomalies (some abnormal sets of values) in that data by using graph algorithms.  
What can be suitable way to represent such kind of data in that case in neo4j?

- [Time Tree Model](https://github.com/graphaware/neo4j-timetree)
- using of [temporal values](https://neo4j.com/docs/cypher-manual/current/syntax/temporal/) of Nodes
- [Entity-state model](https://h-omer.github.io/neo4j-versioner-core/)  
... or something else.

---

<div class="post-metadata">

**Author:** ![pingelsan](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/pingelsan/32/5224_2.png) [@pingelsan](https://community.neo4j.com/u/pingelsan)\
**Post date:** [July 15, 2019, 1:42pm UTC](https://community.neo4j.com/t/how-to-model-timeseries-data-in-property-graph/8713/2 "2019-07-15T13:42:45Z")

</div>

Mark Needham wrote about time trees about 2 years ago:

> **[Neo4j: Cypher - Creating a time tree down to the day | Mark Needham](https://www.markhneedham.com/blog/2014/04/19/neo4j-cypher-creating-a-time-tree-down-to-the-day/)**
>
> Michael recently wrote a blog post showing how to create a time tree representing time down to the second using Neo4j’s Cypher query language, something I built on top of for a side project I’m working on.
> The domain I want to model is RSVPs to...

I remember vaguely that there's also a chapter about representing time in one of the free PDFs from O'Reilly that you can obtain from neo4j which also boils down to using time trees.

Temporal values is a time-specific type of property on nodes and relationships and as such more concerned with formatting issues, time zones etc., so this might not be your first choice.

If entity-state-model is something to consider depends on how you model the measurements in general. My guess is that it might not apply since the measurements are more 'atomic' in nature and don't demand changing "state of relationships". So time trees is probably the way to go.

I found it very helpful to model a set of prototype data and see if the model lends itself to the kind of queries/information I want to retrieve from it.

Hope that helps,  
best regards,  
Christoph
