August 15, 2023

Creating actor-movie relationship in Neo4j – Docs for ESB 6.x

Creating actor-movie relationship in Neo4j

  1. Double-click the third tFileInputDelimited component to open its Basic settings view on the Component tab.

    components-tneo4joutputrelationship_s1-7.png

  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:
  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.

    components-tneo4joutputrelationship_s1-12.png

  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


Document get from Talend https://help.talend.com
Thank you for watching.
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x