<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>Comments on: Some CSV import tricks in Neo4j</title>
	<atom:link href="http://blog.comperiosearch.com/blog/2015/02/04/csv-import-tricks-neo4j/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.comperiosearch.com/blog/2015/02/04/csv-import-tricks-neo4j/</link>
	<description>A blog about Search as THE solution</description>
	<lastBuildDate>Mon, 26 Oct 2015 18:07:52 +0000</lastBuildDate>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=3.9.40</generator>
	<item>
		<title>By: alynum</title>
		<link>http://blog.comperiosearch.com/blog/2015/02/04/csv-import-tricks-neo4j/#comment-19093</link>
		<dc:creator><![CDATA[alynum]]></dc:creator>
		<pubDate>Tue, 03 Mar 2015 11:42:29 +0000</pubDate>
		<guid isPermaLink="false">http://blog.comperiosearch.com/?p=3242#comment-19093</guid>
		<description><![CDATA[Thanks for the clarifications. Your usage of WITH with just csvLine is a lot easier in the eyes.]]></description>
		<content:encoded><![CDATA[<p>Thanks for the clarifications. Your usage of WITH with just csvLine is a lot easier in the eyes.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Hunger</title>
		<link>http://blog.comperiosearch.com/blog/2015/02/04/csv-import-tricks-neo4j/#comment-19082</link>
		<dc:creator><![CDATA[Michael Hunger]]></dc:creator>
		<pubDate>Thu, 05 Feb 2015 01:21:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.comperiosearch.com/?p=3242#comment-19082</guid>
		<description><![CDATA[Hi, thanks a lot for the great blog post, I just wanted to comment on two things:

1. Use MERGE always with one property only if you want to avoid duplicates (otherwise use CREATE). User ON CREATE SET .. to set the other properties, potentially also with ON CREATE SET n += csvLine

2. You don&#039;t have to decompose csvLine for WITH, this works perfectly fine, the use of WITH is currently still required for WHERE, but the decomposition is optional

but as WITH separates parts of the query we need to parse the whole CSV line here and bind it in the clause. Accessing the CSV line object won’t work within the clause.

USING PERIODIC COMMIT 1000
LOAD CSV WITH HEADERS FROM “file://blabla.csv” AS csvLine
WITH toInt(csvLine.twitterid) as twitterid, csvLine
WHERE twitterid IS NOT NULL
MERGE (u :USER { twitterid: twitterid }) ON CREATE SET
u.seat=toInt(csvLine.seat), u.firstname=csvLine.first name, u.lastname=csvLine.lastname, u.party=csvLine.party, u.region=csvLine.region, u.type = csvLine.type
....
or
ON CREATE SET u += csvLine, u.seat=toInt(csvLine.seat)]]></description>
		<content:encoded><![CDATA[<p>Hi, thanks a lot for the great blog post, I just wanted to comment on two things:</p>
<p>1. Use MERGE always with one property only if you want to avoid duplicates (otherwise use CREATE). User ON CREATE SET .. to set the other properties, potentially also with ON CREATE SET n += csvLine</p>
<p>2. You don&#8217;t have to decompose csvLine for WITH, this works perfectly fine, the use of WITH is currently still required for WHERE, but the decomposition is optional</p>
<p>but as WITH separates parts of the query we need to parse the whole CSV line here and bind it in the clause. Accessing the CSV line object won’t work within the clause.</p>
<p>USING PERIODIC COMMIT 1000<br />
LOAD CSV WITH HEADERS FROM “file://blabla.csv” AS csvLine<br />
WITH toInt(csvLine.twitterid) as twitterid, csvLine<br />
WHERE twitterid IS NOT NULL<br />
MERGE (u :USER { twitterid: twitterid }) ON CREATE SET<br />
u.seat=toInt(csvLine.seat), u.firstname=csvLine.first name, u.lastname=csvLine.lastname, u.party=csvLine.party, u.region=csvLine.region, u.type = csvLine.type<br />
&#8230;.<br />
or<br />
ON CREATE SET u += csvLine, u.seat=toInt(csvLine.seat)</p>
]]></content:encoded>
	</item>
</channel>
</rss>
