Giter Site home page Giter Site logo

Comments (2)

redapple avatar redapple commented on July 1, 2024

Hi @seawolff

it seems to me your user_rels.tsv represents properties for the users, not really relationships between users
or is there an implicit COMPANY end-node?

The first 2 columns in your rels file should represent the IDs of the start-node and end-node
(see https://github.com/jexp/batch-import#relscsv)
and the 3rd column should be the type of relationship

The subsequent columns represent additional properties of the relationship

then, with an additional 1st node representing the company,
and representing the relationship using "WORKS_AT",
you could write your files in this way:
nodes.tsv

id  type    name    email   full_name 
1   COMPANY ACMECorp.   [email protected]    ACME Corporation
2   USER    wolff   [email protected]  Wolff 
3   USER    test    [email protected]   Test
...

and
rels.tsv

startnode   endnode relationtype    type    lang    date_joined           
2   1   WORKS_AT    staff   en-us   2010-09-22 11:58:10
3   1   WORKS_AT        en-us   2010-09-29 12:00:09
...

Node 2 (user wolff) works at Node1 (ACME) as a staff member, speaks English, and joined on Sep. 22, 2010
Node 3 (user test) works at Node1 (ACME) (role in company undefined), speaks English, and joined on Sep. 29, 2010

Hope this helps.

from batch-import.

redapple avatar redapple commented on July 1, 2024

Note that the "id" column in user.tsv will be used as just another property for the node, not the Node ID in Neo4J

Using batch-import it's the order in which the nodes appear in the nodes file that should be used as reference for the rels file

In other words, you could have:

id  type    name    email   full_name 
2597    COMPANY ACMECorp.   [email protected]    ACME Corporation
1350    USER    wolff   [email protected]  Wolff 
93754   USER    test    [email protected]   Test

and still define the relationships using:

startnode   endnode relationtype    type    lang    date_joined           
2   1   WORKS_AT    staff   en-us   2010-09-22 11:58:10
3   1   WORKS_AT        en-us   2010-09-29 12:00:09

from batch-import.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.