Hi Nick

as each row of your CSV contains two products, you have to set the data 
separately.
Not sure what's in the "PRODUCTX" column, I presume some kind of ID

Your label is still :Product for both of them. (Think of it like a table name 
for simplification).

> LOAD CSV WITH HEADERS FROM "/products.csv" AS row
> CREATE (p1:Product {id:row.PRODUCT1})
> SET p1.event = row.PRODUCT_PROPERTY1, ...
> CREATE (p2:Product {id:row.PRODUCT2})
> SET p2.event = row.PRODUCT_PROPERTY2, ...
> CREATE (p1)-[:DEPENDS_ON]->(p2)

Michael

> Am 04.01.2016 um 20:37 schrieb Nick Wolf <[email protected]>:
> 
> Hi,
> 
> I am new to Neo4j and trying to write a loading script for the following edge 
> file format. I need some help validating my script.
> 
> PRODUCT1,PRODUCT_PROPERTY1,PRODUCT2,PRODUCT_PROPERTY2
> 
> This is my attempt to write a neo script for this file.
> 
> LOAD CSV WITH HEADERS FROM "/products.csv" AS row
> CREATE (p1:Product1)
> SET p1 = row,
>   p1.event = row.PRODUCT_PROPERTY1
> CREATE (p2:Product2)
> SET p2 = row,
>   p2.event = row.PRODUCT_PROPERTY2
> CREATE (p1)-[:depends]->(p2)
> 
> 
> 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Neo4j" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] 
> <mailto:[email protected]>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
You received this message because you are subscribed to the Google Groups 
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to