Creating actor-movie relationship in Neo4j - 7.3

Neo4j

Version
7.3
Language
English
Product
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 Real-Time Big Data Platform
Module
Talend Studio
Content
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
Last publication date
2024-02-21

Procedure

  1. Double-click the third tFileInputDelimited component to open its Basic settings view on the Component tab.
  2. In the File name/Stream field, specify the path to the CSV file that describes the actors' roles in the movies.
    The input CSV file used in this example is as follows:
    Actor;Movie;Role
    Keanu Reeves;The Matrix;Neo
    Keanu Reeves;The Matrix Reloaded;Neo
    Keanu Reeves;The Matrix Revolutions;Neo
    Laurence Fishburne;The Matrix;Morpheus
    Laurence Fishburne;The Matrix Reloaded;Morpheus
    Laurence Fishburne;The Matrix Revolutions;Morpheus
    Carrie-Anne Moss;The Matrix;Trinity
    Carrie-Anne Moss;The Matrix Reloaded;Trinity
    Carrie-Anne Moss;The Matrix Revolutions;Trinity
  3. In the Header field, specify the number of rows to skip as header rows. In this example, the first row of the CSV file is the header row.
  4. Click the [...] button next to Edit schema to open the Schema dialog box, and define the input schema based on the structure of the input file. In this example, the input schema is composed of three columns, actor, movie, and role, all of type String.
    When done, click OK to close the Schema dialog box and propagate the schema to the next component.
  5. Double-click the tNeo4jOutputRelationship component to open its Basic settings view.
  6. Select the Use an existing connection check box to reuse the Neo4j database connection opened by the tNeo4jConnection component, which is the only connection component used in this example.
  7. In the Relationship type field, enter the type of relationship to be created, between double quotation marks. In this example, the relationship type is ACTED_IN, which will appear as the label of the relationship between nodes.
  8. Define the start and end nodes and the direction of the relationship to be created. In this example, the relationship will be created from Actors nodes, on which an index called name has been defined, to Movies nodes, on which an index called title has been defined.
    • Start node: enter name between double quotation marks in the Index name and Index key fields, and select the schema column name from the Index value list. As the Value field is left blank in index creation, the index value will be the value of column name for each row.

    • From the Relationship direction list, select Outgoing.

    • End node: enter title between double quotation marks in the Index name and Index key fields, and select the schema column title from the Index value list. As the Value field is left blank in index creation, the index value will be the value of column title for each row.

  9. Click the [+] button three times to add three rows in the Mapping table to define three properties of the relationship:

    Property

    Value taken from...

    Actor

    actor column of the schema

    Movie

    movie column of the schema

    Role

    role column of the schema