I am interested in storing stock price data on dgraph. To do so, I have set up nodes (subjects) in the graph to be companies (with predicates like name, ticker_symbol, market_cap, etc.) I would like to add a predicate <closing_day_price> with a datetime facet (date=“2019-04-16T:00:00.00”) for each closing day price for the past X years. So the mutation would look something like:
{
set {
_:company_a_id <closing_day_price> 102.23 (date=“2019-04-17T:00:00.00”) .
_:company_a_id <closing_day_price> 102.23 (date=“2019-04-16T:00:00.00”) .
_:company_a_id <closing_day_price> 101.55 (date=“2019-04-15T:00:00.00”) .
_:company_a_id <closing_day_price> 110.1 (date=“2019-04-14T:00:00.00”) .
_:company_a_id <closing_day_price> 112.99 (date=“2019-04-13T:00:00.00”) .
}
}
So, for node “company_a”, will this create a new edge for each closing day price with a different date facet that I can filter on later (like getting all the closing prices between 2 dates, etc.) or will it overwrite the same predicate <closing_day_price> over and over with different date facet and values?
In general, is this a good strategy for storing timeseries data for a particular node that is filterable? If not, what would you suggest?