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
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.
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'})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With