Importing data and creating relationships - 7.3

Neo4j

EnrichVersion
Cloud
7.3
EnrichProdName
Talend Big Data
Talend Big Data Platform
Talend Data Fabric
Talend Data Integration
Talend Data Management Platform
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for Big Data
Talend Real-Time Big Data Platform
EnrichPlatform
Talend Studio
task
Data Governance > Third-party systems > NoSQL components > Neo4j components
Data Quality and Preparation > Third-party systems > NoSQL components > Neo4j components
Design and Development > Third-party systems > NoSQL components > Neo4j components

Procedure

  1. Double-click the second tNeo4jRow component to open its Basic settings view on the Component tab.
  2. From the DB Version list, select Neo4J 2.X.X.
  3. Select the Remote server check box and specify the URL of the Neo4j server in the Server URL field, "http://localhost:7474/db/data" in this example.
  4. In the Query field, type in the following Cypher query to import family data from the CSV file, create relevant Person and Family nodes, and create relationships between persons and families:
    "LOAD CSV WITH HEADERS FROM 'file:E:/Talend/Data/Input/families.csv' AS csvLine FIELDTERMINATOR ';' 
    MERGE (family:Family { name: csvLine.Family })
    CREATE (person:Person { name: csvLine.Name, gender: csvLine.Gender, age: toInt(csvLine.Age)})
    CREATE (person)-[:From]->(family)"