How can I combine to cypher queries related to CSV import?Combining Cypher Query resultsLIKE clause in CYPHER QueryCypher Query combining results that can be ordered as a whole“No relation” in cypher queryNeo4J CYPHER Query to make relationNeo4j Cypher query with hierarchy in relationsCombining Distinct Neo4j Cypher QueriesCypher import of CSV with arrayNeo4j cypher query to combine resultsCypher Query to CSV

Why is it correct to use ~た in this sentence, even though we're talking about next week?

Why are there five extra turns in tournament Magic?

Is there any deeper thematic meaning to the white horse that Arya finds in The Bells (S08E05)?

Is it standard for US-based universities to consider the ethnicity of an applicant during PhD admissions?

​Cuban​ ​Primes

Why aren't satellites disintegrated even though they orbit earth within their Roche Limits?

Roman Numerals Equation 2

Deleting the same lines from a list

refer string as a field API name

Would life always name the light from their sun "white"

How does this piece of code determine array size without using sizeof( )?

Why did nobody know who the Lord of this region was?

What kind of environment would favor hermaphroditism in a sentient species over regular, old sexes?

Is there a method to separate iron from mercury?

Why is the marginal distribution/marginal probability described as "marginal"?

FIFO data structure in pure C

Find the area of the rectangle

Does a non-singular matrix have a large minor with disjoint rows and columns and full rank?

Resistor Selection to retain same brightness in LED PWM circuit

What are the effects of eating many berries from the Goodberry spell per day?

Non-African Click Languages

Square spiral in Mathematica

Is it possible to pass a pointer to an operator as an argument like a pointer to a function?

Cycling to work - 30mile return



How can I combine to cypher queries related to CSV import?


Combining Cypher Query resultsLIKE clause in CYPHER QueryCypher Query combining results that can be ordered as a whole“No relation” in cypher queryNeo4J CYPHER Query to make relationNeo4j Cypher query with hierarchy in relationsCombining Distinct Neo4j Cypher QueriesCypher import of CSV with arrayNeo4j cypher query to combine resultsCypher Query to CSV






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















Sample CSV lines are as follows:



created_at,tweet_id,retweeted_user_screenName,retweeted_user_id,tweet_text,screen_name,source,hashtags,user_mentions,in_reply_to_status_id,in_reply_to_user_id,is_quote_status,retweet_count,favorite_count,favorited,retweeted,userid,name,location,protected,followers_cnt,friends_cnt,listed_cnt,favourites_count,statuses_count,verified,contributors_enabled,lang,user_creation_dt_at,max_id,since_id,query,next_results,result_type,user_description
3/23/2019 8:42,1.11E+18,NOBODY,0, Tributes to Shaheed Bhagat Singh Shivaram #Rajguru and #Sukhdev Thapar who were hanged by Britishers this day in 1931. Salute to the Bravest Sons Of India who lived for the country and died for the country. :pray::muscle::india: #MartyrsDay #BhagatSingh #ShaheedDiwas #ShaheedBhagatSingh httpt.co/fwj2uGDQaE, Being_Savvy, TwitterforAndroid, ['Rajguru'; 'Sukhdev'; 'MartyrsDay'; 'BhagatSingh'; 'ShaheedDiwas'; 'ShaheedBhagatSingh'], , , , False,0,0, False, False,2876088965, Savvy Tarafdar, Kolkata India, False,914,96,7,3876,3212, False, False, en, 2014-11-14 06:34:18,1.11E+18,0, %23Sukhdev, ?max_id=1109374390137815041&q=%23Sukhdev&count=100&include_entities=1&result_type=recent, recent, Musician | YouTuber Entertainer | Photographer | Story Teller | Artist ? TikTok / Snapchat : @ savvytarafdar ? Contact : thesavvy99gmail.com ??
3/23/2019 8:42,1.11E+18, BJP4Maharashtra,532895350, RT @BJP4Maharashtra: तरुणांच्या मनावर आजही अधिराज्य गाजवणारे शहीद-ए-आज़म भगतसिंग सुखदेव आणि राजगुरू यांचा आज बलिदान दिवस. त्यांच्या स्मृ…, archanamuth1, TwitterWebClient, , ['BJP4Maharashtra'], , , False,23,0, False, False,1.09E+18, archanamuth, , False,33,38,0,62,1488, False, False, en, 2019-02-06 06:24:03,1.11E+18,0, %23Sukhdev, ?max_id=1109374390137815041&q=%23Sukhdev&count=100&include_entities=1&result_type=recent, recent,


I am running following 2 queries



USING PERIODIC COMMIT
LOAD CSV WITH HEADERS FROM "file:///D:/Tools/ori_twecoll/twecoll-master/Sukhdev.csv" As row
MERGE (user:Userscreen_name:trim(row.retweeted_user_screenName),userid:row.retweeted_user_id)
RETURN user.screen_name

USING PERIODIC COMMIT
LOAD CSV WITH HEADERS FROM "file:///D:/Tools/ori_twecoll/twecoll-master/Sukhdev.csv" As row
MATCH (user:Userscreen_name:row.trim(retweeted_user_screenName),userid:row.retweeted_user_id)
MATCH (userInSys:Userscreen_name:row.screen_name)
CREATE UNIQUE (user)-[:RETWEETED_BY]->(userInSys)
RETURN user.screen_name,userInSys.screen_name


I want to combine them into one query.










share|improve this question
























  • CSV header is like bellow created_at,tweet_id,retweeted_user_screenName,retweeted_user_id,tweet_text,screen_name,source,hashtags,user_mentions,in_reply_to_status_id,in_reply_to_user_id,is_quote_status,retweet_count,favorite_count,favorited,retweeted,userid,name,location,protected,followers_cnt,friends_cnt,listed_cnt,favourites_count,statuses_count,verified,contributors_enabled,lang,user_creation_dt_at,max_id,since_id,query,next_results,result_type,user_description

    – user3297363
    Mar 23 at 15:19












  • What's the unique key for user node. If it's screen_name then above queries can be combined into one. Otherwise there will be some issues.

    – Raj
    Mar 24 at 9:22

















0















Sample CSV lines are as follows:



created_at,tweet_id,retweeted_user_screenName,retweeted_user_id,tweet_text,screen_name,source,hashtags,user_mentions,in_reply_to_status_id,in_reply_to_user_id,is_quote_status,retweet_count,favorite_count,favorited,retweeted,userid,name,location,protected,followers_cnt,friends_cnt,listed_cnt,favourites_count,statuses_count,verified,contributors_enabled,lang,user_creation_dt_at,max_id,since_id,query,next_results,result_type,user_description
3/23/2019 8:42,1.11E+18,NOBODY,0, Tributes to Shaheed Bhagat Singh Shivaram #Rajguru and #Sukhdev Thapar who were hanged by Britishers this day in 1931. Salute to the Bravest Sons Of India who lived for the country and died for the country. :pray::muscle::india: #MartyrsDay #BhagatSingh #ShaheedDiwas #ShaheedBhagatSingh httpt.co/fwj2uGDQaE, Being_Savvy, TwitterforAndroid, ['Rajguru'; 'Sukhdev'; 'MartyrsDay'; 'BhagatSingh'; 'ShaheedDiwas'; 'ShaheedBhagatSingh'], , , , False,0,0, False, False,2876088965, Savvy Tarafdar, Kolkata India, False,914,96,7,3876,3212, False, False, en, 2014-11-14 06:34:18,1.11E+18,0, %23Sukhdev, ?max_id=1109374390137815041&q=%23Sukhdev&count=100&include_entities=1&result_type=recent, recent, Musician | YouTuber Entertainer | Photographer | Story Teller | Artist ? TikTok / Snapchat : @ savvytarafdar ? Contact : thesavvy99gmail.com ??
3/23/2019 8:42,1.11E+18, BJP4Maharashtra,532895350, RT @BJP4Maharashtra: तरुणांच्या मनावर आजही अधिराज्य गाजवणारे शहीद-ए-आज़म भगतसिंग सुखदेव आणि राजगुरू यांचा आज बलिदान दिवस. त्यांच्या स्मृ…, archanamuth1, TwitterWebClient, , ['BJP4Maharashtra'], , , False,23,0, False, False,1.09E+18, archanamuth, , False,33,38,0,62,1488, False, False, en, 2019-02-06 06:24:03,1.11E+18,0, %23Sukhdev, ?max_id=1109374390137815041&q=%23Sukhdev&count=100&include_entities=1&result_type=recent, recent,


I am running following 2 queries



USING PERIODIC COMMIT
LOAD CSV WITH HEADERS FROM "file:///D:/Tools/ori_twecoll/twecoll-master/Sukhdev.csv" As row
MERGE (user:Userscreen_name:trim(row.retweeted_user_screenName),userid:row.retweeted_user_id)
RETURN user.screen_name

USING PERIODIC COMMIT
LOAD CSV WITH HEADERS FROM "file:///D:/Tools/ori_twecoll/twecoll-master/Sukhdev.csv" As row
MATCH (user:Userscreen_name:row.trim(retweeted_user_screenName),userid:row.retweeted_user_id)
MATCH (userInSys:Userscreen_name:row.screen_name)
CREATE UNIQUE (user)-[:RETWEETED_BY]->(userInSys)
RETURN user.screen_name,userInSys.screen_name


I want to combine them into one query.










share|improve this question
























  • CSV header is like bellow created_at,tweet_id,retweeted_user_screenName,retweeted_user_id,tweet_text,screen_name,source,hashtags,user_mentions,in_reply_to_status_id,in_reply_to_user_id,is_quote_status,retweet_count,favorite_count,favorited,retweeted,userid,name,location,protected,followers_cnt,friends_cnt,listed_cnt,favourites_count,statuses_count,verified,contributors_enabled,lang,user_creation_dt_at,max_id,since_id,query,next_results,result_type,user_description

    – user3297363
    Mar 23 at 15:19












  • What's the unique key for user node. If it's screen_name then above queries can be combined into one. Otherwise there will be some issues.

    – Raj
    Mar 24 at 9:22













0












0








0








Sample CSV lines are as follows:



created_at,tweet_id,retweeted_user_screenName,retweeted_user_id,tweet_text,screen_name,source,hashtags,user_mentions,in_reply_to_status_id,in_reply_to_user_id,is_quote_status,retweet_count,favorite_count,favorited,retweeted,userid,name,location,protected,followers_cnt,friends_cnt,listed_cnt,favourites_count,statuses_count,verified,contributors_enabled,lang,user_creation_dt_at,max_id,since_id,query,next_results,result_type,user_description
3/23/2019 8:42,1.11E+18,NOBODY,0, Tributes to Shaheed Bhagat Singh Shivaram #Rajguru and #Sukhdev Thapar who were hanged by Britishers this day in 1931. Salute to the Bravest Sons Of India who lived for the country and died for the country. :pray::muscle::india: #MartyrsDay #BhagatSingh #ShaheedDiwas #ShaheedBhagatSingh httpt.co/fwj2uGDQaE, Being_Savvy, TwitterforAndroid, ['Rajguru'; 'Sukhdev'; 'MartyrsDay'; 'BhagatSingh'; 'ShaheedDiwas'; 'ShaheedBhagatSingh'], , , , False,0,0, False, False,2876088965, Savvy Tarafdar, Kolkata India, False,914,96,7,3876,3212, False, False, en, 2014-11-14 06:34:18,1.11E+18,0, %23Sukhdev, ?max_id=1109374390137815041&q=%23Sukhdev&count=100&include_entities=1&result_type=recent, recent, Musician | YouTuber Entertainer | Photographer | Story Teller | Artist ? TikTok / Snapchat : @ savvytarafdar ? Contact : thesavvy99gmail.com ??
3/23/2019 8:42,1.11E+18, BJP4Maharashtra,532895350, RT @BJP4Maharashtra: तरुणांच्या मनावर आजही अधिराज्य गाजवणारे शहीद-ए-आज़म भगतसिंग सुखदेव आणि राजगुरू यांचा आज बलिदान दिवस. त्यांच्या स्मृ…, archanamuth1, TwitterWebClient, , ['BJP4Maharashtra'], , , False,23,0, False, False,1.09E+18, archanamuth, , False,33,38,0,62,1488, False, False, en, 2019-02-06 06:24:03,1.11E+18,0, %23Sukhdev, ?max_id=1109374390137815041&q=%23Sukhdev&count=100&include_entities=1&result_type=recent, recent,


I am running following 2 queries



USING PERIODIC COMMIT
LOAD CSV WITH HEADERS FROM "file:///D:/Tools/ori_twecoll/twecoll-master/Sukhdev.csv" As row
MERGE (user:Userscreen_name:trim(row.retweeted_user_screenName),userid:row.retweeted_user_id)
RETURN user.screen_name

USING PERIODIC COMMIT
LOAD CSV WITH HEADERS FROM "file:///D:/Tools/ori_twecoll/twecoll-master/Sukhdev.csv" As row
MATCH (user:Userscreen_name:row.trim(retweeted_user_screenName),userid:row.retweeted_user_id)
MATCH (userInSys:Userscreen_name:row.screen_name)
CREATE UNIQUE (user)-[:RETWEETED_BY]->(userInSys)
RETURN user.screen_name,userInSys.screen_name


I want to combine them into one query.










share|improve this question
















Sample CSV lines are as follows:



created_at,tweet_id,retweeted_user_screenName,retweeted_user_id,tweet_text,screen_name,source,hashtags,user_mentions,in_reply_to_status_id,in_reply_to_user_id,is_quote_status,retweet_count,favorite_count,favorited,retweeted,userid,name,location,protected,followers_cnt,friends_cnt,listed_cnt,favourites_count,statuses_count,verified,contributors_enabled,lang,user_creation_dt_at,max_id,since_id,query,next_results,result_type,user_description
3/23/2019 8:42,1.11E+18,NOBODY,0, Tributes to Shaheed Bhagat Singh Shivaram #Rajguru and #Sukhdev Thapar who were hanged by Britishers this day in 1931. Salute to the Bravest Sons Of India who lived for the country and died for the country. :pray::muscle::india: #MartyrsDay #BhagatSingh #ShaheedDiwas #ShaheedBhagatSingh httpt.co/fwj2uGDQaE, Being_Savvy, TwitterforAndroid, ['Rajguru'; 'Sukhdev'; 'MartyrsDay'; 'BhagatSingh'; 'ShaheedDiwas'; 'ShaheedBhagatSingh'], , , , False,0,0, False, False,2876088965, Savvy Tarafdar, Kolkata India, False,914,96,7,3876,3212, False, False, en, 2014-11-14 06:34:18,1.11E+18,0, %23Sukhdev, ?max_id=1109374390137815041&q=%23Sukhdev&count=100&include_entities=1&result_type=recent, recent, Musician | YouTuber Entertainer | Photographer | Story Teller | Artist ? TikTok / Snapchat : @ savvytarafdar ? Contact : thesavvy99gmail.com ??
3/23/2019 8:42,1.11E+18, BJP4Maharashtra,532895350, RT @BJP4Maharashtra: तरुणांच्या मनावर आजही अधिराज्य गाजवणारे शहीद-ए-आज़म भगतसिंग सुखदेव आणि राजगुरू यांचा आज बलिदान दिवस. त्यांच्या स्मृ…, archanamuth1, TwitterWebClient, , ['BJP4Maharashtra'], , , False,23,0, False, False,1.09E+18, archanamuth, , False,33,38,0,62,1488, False, False, en, 2019-02-06 06:24:03,1.11E+18,0, %23Sukhdev, ?max_id=1109374390137815041&q=%23Sukhdev&count=100&include_entities=1&result_type=recent, recent,


I am running following 2 queries



USING PERIODIC COMMIT
LOAD CSV WITH HEADERS FROM "file:///D:/Tools/ori_twecoll/twecoll-master/Sukhdev.csv" As row
MERGE (user:Userscreen_name:trim(row.retweeted_user_screenName),userid:row.retweeted_user_id)
RETURN user.screen_name

USING PERIODIC COMMIT
LOAD CSV WITH HEADERS FROM "file:///D:/Tools/ori_twecoll/twecoll-master/Sukhdev.csv" As row
MATCH (user:Userscreen_name:row.trim(retweeted_user_screenName),userid:row.retweeted_user_id)
MATCH (userInSys:Userscreen_name:row.screen_name)
CREATE UNIQUE (user)-[:RETWEETED_BY]->(userInSys)
RETURN user.screen_name,userInSys.screen_name


I want to combine them into one query.







neo4j cypher






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 23 at 16:13









double-beep

3,12151632




3,12151632










asked Mar 23 at 15:18









user3297363user3297363

113




113












  • CSV header is like bellow created_at,tweet_id,retweeted_user_screenName,retweeted_user_id,tweet_text,screen_name,source,hashtags,user_mentions,in_reply_to_status_id,in_reply_to_user_id,is_quote_status,retweet_count,favorite_count,favorited,retweeted,userid,name,location,protected,followers_cnt,friends_cnt,listed_cnt,favourites_count,statuses_count,verified,contributors_enabled,lang,user_creation_dt_at,max_id,since_id,query,next_results,result_type,user_description

    – user3297363
    Mar 23 at 15:19












  • What's the unique key for user node. If it's screen_name then above queries can be combined into one. Otherwise there will be some issues.

    – Raj
    Mar 24 at 9:22

















  • CSV header is like bellow created_at,tweet_id,retweeted_user_screenName,retweeted_user_id,tweet_text,screen_name,source,hashtags,user_mentions,in_reply_to_status_id,in_reply_to_user_id,is_quote_status,retweet_count,favorite_count,favorited,retweeted,userid,name,location,protected,followers_cnt,friends_cnt,listed_cnt,favourites_count,statuses_count,verified,contributors_enabled,lang,user_creation_dt_at,max_id,since_id,query,next_results,result_type,user_description

    – user3297363
    Mar 23 at 15:19












  • What's the unique key for user node. If it's screen_name then above queries can be combined into one. Otherwise there will be some issues.

    – Raj
    Mar 24 at 9:22
















CSV header is like bellow created_at,tweet_id,retweeted_user_screenName,retweeted_user_id,tweet_text,screen_name,source,hashtags,user_mentions,in_reply_to_status_id,in_reply_to_user_id,is_quote_status,retweet_count,favorite_count,favorited,retweeted,userid,name,location,protected,followers_cnt,friends_cnt,listed_cnt,favourites_count,statuses_count,verified,contributors_enabled,lang,user_creation_dt_at,max_id,since_id,query,next_results,result_type,user_description

– user3297363
Mar 23 at 15:19






CSV header is like bellow created_at,tweet_id,retweeted_user_screenName,retweeted_user_id,tweet_text,screen_name,source,hashtags,user_mentions,in_reply_to_status_id,in_reply_to_user_id,is_quote_status,retweet_count,favorite_count,favorited,retweeted,userid,name,location,protected,followers_cnt,friends_cnt,listed_cnt,favourites_count,statuses_count,verified,contributors_enabled,lang,user_creation_dt_at,max_id,since_id,query,next_results,result_type,user_description

– user3297363
Mar 23 at 15:19














What's the unique key for user node. If it's screen_name then above queries can be combined into one. Otherwise there will be some issues.

– Raj
Mar 24 at 9:22





What's the unique key for user node. If it's screen_name then above queries can be combined into one. Otherwise there will be some issues.

– Raj
Mar 24 at 9:22












1 Answer
1






active

oldest

votes


















0














You can use MERGE to create the users if not exists and then create the required relationship with the following query.



Instead of CREATE UNIQUE which is deprecated consider MERGE.



USING PERIODIC COMMIT
LOAD CSV WITH HEADERS FROM "file:///D:/Tools/ori_twecoll/twecoll-master/Sukhdev.csv" As row
MERGE (user:Userscreen_name:row.trim(retweeted_user_screenName), userid:row.retweeted_user_id)
MERGE (userInSys:Userscreen_name:row.screen_name, userid:row.userid)
MERGE (user)-[:RETWEETED_BY]->(userInSys)
RETURN user.screen_name,userInSys.screen_name


Suggestions:



  • Don't combine multiple MERGE in a single query, consider multiple
    queries and use MATCH in further queries.

  • Don't return the result in the data load query itself, consider
    another query for it.

  • Create the indices on keys of nodes





share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55315229%2fhow-can-i-combine-to-cypher-queries-related-to-csv-import%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    You can use MERGE to create the users if not exists and then create the required relationship with the following query.



    Instead of CREATE UNIQUE which is deprecated consider MERGE.



    USING PERIODIC COMMIT
    LOAD CSV WITH HEADERS FROM "file:///D:/Tools/ori_twecoll/twecoll-master/Sukhdev.csv" As row
    MERGE (user:Userscreen_name:row.trim(retweeted_user_screenName), userid:row.retweeted_user_id)
    MERGE (userInSys:Userscreen_name:row.screen_name, userid:row.userid)
    MERGE (user)-[:RETWEETED_BY]->(userInSys)
    RETURN user.screen_name,userInSys.screen_name


    Suggestions:



    • Don't combine multiple MERGE in a single query, consider multiple
      queries and use MATCH in further queries.

    • Don't return the result in the data load query itself, consider
      another query for it.

    • Create the indices on keys of nodes





    share|improve this answer



























      0














      You can use MERGE to create the users if not exists and then create the required relationship with the following query.



      Instead of CREATE UNIQUE which is deprecated consider MERGE.



      USING PERIODIC COMMIT
      LOAD CSV WITH HEADERS FROM "file:///D:/Tools/ori_twecoll/twecoll-master/Sukhdev.csv" As row
      MERGE (user:Userscreen_name:row.trim(retweeted_user_screenName), userid:row.retweeted_user_id)
      MERGE (userInSys:Userscreen_name:row.screen_name, userid:row.userid)
      MERGE (user)-[:RETWEETED_BY]->(userInSys)
      RETURN user.screen_name,userInSys.screen_name


      Suggestions:



      • Don't combine multiple MERGE in a single query, consider multiple
        queries and use MATCH in further queries.

      • Don't return the result in the data load query itself, consider
        another query for it.

      • Create the indices on keys of nodes





      share|improve this answer

























        0












        0








        0







        You can use MERGE to create the users if not exists and then create the required relationship with the following query.



        Instead of CREATE UNIQUE which is deprecated consider MERGE.



        USING PERIODIC COMMIT
        LOAD CSV WITH HEADERS FROM "file:///D:/Tools/ori_twecoll/twecoll-master/Sukhdev.csv" As row
        MERGE (user:Userscreen_name:row.trim(retweeted_user_screenName), userid:row.retweeted_user_id)
        MERGE (userInSys:Userscreen_name:row.screen_name, userid:row.userid)
        MERGE (user)-[:RETWEETED_BY]->(userInSys)
        RETURN user.screen_name,userInSys.screen_name


        Suggestions:



        • Don't combine multiple MERGE in a single query, consider multiple
          queries and use MATCH in further queries.

        • Don't return the result in the data load query itself, consider
          another query for it.

        • Create the indices on keys of nodes





        share|improve this answer













        You can use MERGE to create the users if not exists and then create the required relationship with the following query.



        Instead of CREATE UNIQUE which is deprecated consider MERGE.



        USING PERIODIC COMMIT
        LOAD CSV WITH HEADERS FROM "file:///D:/Tools/ori_twecoll/twecoll-master/Sukhdev.csv" As row
        MERGE (user:Userscreen_name:row.trim(retweeted_user_screenName), userid:row.retweeted_user_id)
        MERGE (userInSys:Userscreen_name:row.screen_name, userid:row.userid)
        MERGE (user)-[:RETWEETED_BY]->(userInSys)
        RETURN user.screen_name,userInSys.screen_name


        Suggestions:



        • Don't combine multiple MERGE in a single query, consider multiple
          queries and use MATCH in further queries.

        • Don't return the result in the data load query itself, consider
          another query for it.

        • Create the indices on keys of nodes






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 25 at 10:27









        RajRaj

        1,7371517




        1,7371517





























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55315229%2fhow-can-i-combine-to-cypher-queries-related-to-csv-import%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

            Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

            Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript