Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
11-04-2020 08:46 AM
Hi, there.
I am a noob working on an historical database. I managed to write a first draft of my code that I can browse well and that describes each entry according to this usual pattern:
CREATE (Item123:Book {title:"Title of the book", printed:19xx})
CREATE
(JohnDoe)-[:PRINTED]->(Book123),
(NewYork)<-[:PRINTED_IN]-(Book123),
Now, I would like to locate these data in both time and space. Hence, my questions:
11-04-2020 02:33 PM
Hi @rabbiacher
Item123 in the first line has been changed to book123.
(JohnDoe)-[:PRINTED]->(Book123),
I didn't know if it was the author or the printing company, so I used company.
To use NeoMap, you just need to have the latitude and longitude.
If you have a name, it will be shown in the popup.
Here's the code.
CREATE (book123:Book {title: 'Title of the book', printed: 1980})
CREATE (johndoe:Company {name: 'John Doe'})
CREATE (newyork:City {name: 'New York', latitude: 40.730610, longitude: -73.935242})
CREATE
(johndoe)-[:PRINTED]->(book123),
(newyork)<-[:PRINTED_IN]-(book123),
(book123)-[:DATE_OF_PRINT]->(:PrintedYear {date: 1980})
11-07-2020 06:48 AM
Dear Koji,
thank you again for your help. I hope I can indulge your patience for a further explanation. Everything works fine and smooth than you to your suggestion. Yet I noted that multiple entries that share the same :PrintedYear variable are not shown under the same node but rather individually.
This is an expansion on your code:
CREATE (book123:Book {title: 'Title of the fist book', printed: 1980})
CREATE (book124:Book {title: 'Title of the second book', printed: 1980})
CREATE (johndoe:Company {name: 'John Doe'})
CREATE (thedude:Company {name: 'The Dude'})
CREATE (newyork:City {name: 'New York', latitude: 40.730610, longitude: -73.935242})
CREATE (losangels:City {name: 'Los Angeles', latitude: 34.052235, longitude: -118.243683})
CREATE
(johndoe)-[:PRINTED]->(book123),
(newyork)<-[:PRINTED_IN]-(book123),
(book123)-[:DATE_OF_PRINT]->(:PrintedYear {date: 1980})CREATE
(thedude)-[:PRINTED]->(book124),
(losangels)<-[:PRINTED_IN]-(book124),
(book124)-[:DATE_OF_PRINT]->(:PrintedYear {date: 1980})
Now, as you can see, PrintedDate always shows individually and not as a node from which both books could depart. They show like this:
And yet I would like to call the PrintedYear category (“1980") and rather have the two graphs displayed like this (I just dragged manually one graph unto the other):
11-07-2020 01:04 PM
Hi @rabbiacher
Create the year in a single node.
CREATE (book123:Book {title: 'Title of the fist book', printed: 1980})
CREATE (book124:Book {title: 'Title of the second book', printed: 1980})
CREATE (johndoe:Company {name: 'John Doe'})
CREATE (thedude:Company {name: 'The Dude'})
CREATE (newyork:City {name: 'New York', latitude: 40.730610, longitude: -73.935242})
CREATE (losangels:City {name: 'Los Angeles', latitude: 34.052235, longitude: -118.243683})
CREATE (py1980:PrintedYear {date: 1980})
CREATE
(johndoe)-[:PRINTED]->(book123),
(newyork)<-[:PRINTED_IN]-(book123),
(book123)-[:DATE_OF_PRINT]->(py1980)
CREATE
(thedude)-[:PRINTED]->(book124),
(losangels)<-[:PRINTED_IN]-(book124),
(book124)-[:DATE_OF_PRINT]->(py1980)
You can see this graph.
11-08-2020 04:43 AM
Thank you for your kindness!
11-05-2020 12:51 AM
It works fine. Thank you, sir!
All the sessions of the conference are now available online