Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
11-29-2022 02:12 AM
HiGuys!
This is my first question on here, so I hope I'm in the right place!
I have imported three different CSV files - tables - named Category, Product, Supplier from Northwind base. In those tables exist key ids name the same, e.g. in categories "categoryid" and in products also "categoryid" is there any possiblilty to create (auto detect) realations beetwen tables without queringi any Cypher code?
This idea will be helpfull in fast drawing db schem .
Thank you in advance !
11-29-2022 05:57 AM
@MatFarma if you're using the data importer, you can specifically tell it about the relationships when you do the import.
11-29-2022 06:36 AM - edited 11-29-2022 06:38 AM
Thank you @steggy for advise !
Can you please specify importer? Till now I use in Neo4j desktop below statement to create tables:
// Create products
LOAD CSV WITH HEADERS FROM 'file:///products.csv' AS row
MERGE (product:Product {productID: row.ProductID})
ON CREATE SET product.productName = row.ProductName, product.unitPrice = toFloat(row.UnitPrice);
// Create suppliers
LOAD CSV WITH HEADERS FROM 'file:///suppliers.csv' AS row
MERGE (supplier:Supplier {supplierID: row.SupplierID})
ON CREATE SET supplier.companyName = row.CompanyName;
// Create categories
LOAD CSV WITH HEADERS FROM 'file:///categories.csv' AS row
MERGE (c:Category {categoryID: row.CategoryID})
ON CREATE SET c.categoryName = row.CategoryName, c.description = row.Description;
Is there any other possibility - to create tables without above statement?
And to create relation bettwen them ?
Above statement will be problematic if i will upload over 100 tables in csv..
Thank you in advance !
All the sessions of the conference are now available online