the date doesn't appear to be in a traditional US date format. Typically US dates are in the form of Month-Day-Year,
However for example
with "31/03/2010" as dateExample return date(split(dateExample,'/')[2] + split(dateExample,'/')[1] + split(dateExample,'/')[0]);
returns
2010-03-31
and this might be best for your example so as to get proper sorts.
maybe change your
match (c:Company)-[r:RELATED_EVENT]->(us:UpdateShare)
return c.name,c.code,us.date,us.note
order by us.date DESC
to
match (c:Company)-[r:RELATED_EVENT]->(us:UpdateShare)
return c.name,c.code,us.date,us.note
order by date ( split(us.date,'/')[2] + split(us.date,'/')[1] + split( us.date,'/')[0] ) DESC
I suggest you store the value as a Date type or a string in YYYY-MM-DD format. This way you will be able to sort chronologically. A Date value has additional capabilities that make it more useful than a string, but which to chose depends on your requirements and anticipated needs.
You could run something like the following to remediate your data. I would replace the string 'date' value all together instead of storing both attributes.
You will want to test it on a small set of data. You can do this by using the LIMIT clause. Also, if the number of nodes is above 10,000, you may want to use a call subquery in transactions.
It is ok sir.
Do you have any suggestion about modelling.
During the timeline.
Each company can change:
their own share so I create UpdateShare Node.
Their address so I create UpdateAddress Node.
-And Company A can change the number of share they have from other company (Company B) at each UpdateShare Node.
For person it is also the same. They also can change their role at the company.
To be honest, maintaining version history in a graph model seems difficult to me. What other solutions have you thought about? This seems like an accounting problem. You could record each transaction in an event table and replay the events to reconcile a stock when needed. You could checkpoint the data periodically so you don’t have to replay from t=0.
Hi, Thanks for sharing the db dump. I used your dump file and created the db in my Neo4j Desktop.
I have some ideas of about improving the design especially the Update nodes and timelines. If you want this to be private, you can email me at ameyasoft@gmail.com. Let me know. Thanks