Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

when will neo4j support dates as properties

Tags:

neo4j

As an medieval historian i'm building graph-databases about informations from charters and other historical documents.

It would be very helpfull, to add dates as attributes as we often ask for documents from a specific time-range.

At the moment I'm using normalized data (YYYY-MM-DD) combined with regular expressions but the native support of date-informations (in a normalized way) would be very nice.

Greeting, Andreas

like image 857
Andreas Kuczera Avatar asked Oct 20 '22 18:10

Andreas Kuczera


2 Answers

Most people store date/time information using a long property holding the millisecs since epoch (aka Date.getTime()). This way you can do easily math and comparison with time information. In case you need a timezone, store the timezone name in an additional property.

like image 181
Stefan Armbruster Avatar answered Oct 28 '22 20:10

Stefan Armbruster


Stefan's answer is probably better than mine, though depending on what you're trying to do you might also want to consider a Date hierarchy as part of your graph. For example you could have the following structure for

(:Year {text: '1227'})<-[:IN_YEAR]-(:Month {text: '1227-08'})<-[:IN_MONTH]-(:Day {text: '1227-08-18'})<-[:HAPPENED_ON]-(:Event {title: 'Death of Genghis Khan'})
like image 30
Brian Underwood Avatar answered Oct 28 '22 21:10

Brian Underwood