Creating relationships in bulk
-
Double-click the third tFileInputDelimited component to open its Component view.
-
In the File name/Stream field, enter the path or browse to the CSV file that describes the actor-movie relationships.
The input CSV file used in this example reads as follows:
123456789keanu,"Neo",tt0133093,ACTED_INkeanu,"Neo",tt0234215,ACTED_INkeanu,"Neo",tt0242653,ACTED_INlaurence,"Morpheus",tt0133093,ACTED_INlaurence,"Morpheus",tt0234215,ACTED_INlaurence,"Morpheus",tt0242653,ACTED_INcarrieanne,"Trinity",tt0133093,ACTED_INcarrieanne,"Trinity",tt0234215,ACTED_INcarrieanne,"Trinity",tt0242653,ACTED_INThe double quotation marks on the role names are not mandatory. The value
ACTED_IN is an user-defined relationship type
that explains the relationship between the actors and the movies. -
Click the […] button next to Edit schema to open the schema editor, and define the input schema based on
the structure of the input file.In this example, the columns are from,
role, to and
type.
-
Click OK to close this editor and accept the propagation
of the schema to the next component. -
In the Field separator field, enter a comma (,) to
replace the default semicolon (;). -
Double-click the tNeo4jBatchOutputRelationship component
to open its Component view.
-
Select the Use an existing connection
check box to reuse the Neo4j database connection opened by the tNeo4jConnection component. - Verify that the Shutdown after Job check box is clear.
-
From the Field for relationship type drop-down list,
select the column that provides the relationship types. -
From the Direction of the relationship drop-down list,
select Outgoing. -
In the Start node of the relationship area, select the
tNeo4jBatchOutput component that provides the index of
the start nodes, which is the asActors index in this
example from the first tNeo4jBatchOutput. Then from the
Field name for the batch index drop-down list, select the
column that provides the actor names as the start nodes. -
Repeat this action in the End node of the relationship
area to select the asMovie index from the second
tNeo4jBatchOutput and then select the column that provides
the movie names as the end nodes.
Document get from Talend https://help.talend.com
Thank you for watching.
Subscribe
Login
0 Comments