cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! Site migration is underway. Phase 2: migrate recent content

Relationship between nodes

simsree9
Node

Hi ,

Can anyone help on these how to create relationship between these fields 

simsree9_0-1658723185513.png

 

12 REPLIES 12

Hi simsree9,

when loading the data, you can use the following cypher query:

 

LOAD CSV WITH HEADERS FROM <your file name> as row
 MERGE (reg:Region {name: row.Region})
 MERGE (loc:Location {name: row.Location})
 MERGE (cat:Category {name: row.Category})
 MERGE (reg)<-[:IS_IN_REGION]-(loc)
 MERGE (loc)-[:HAS_CATEGORY]->(cat);

 

 
To be absolutely sure you could add "trim(..)" around the reading in of the Strings to avoid having empty spaces read in which will result in new nodes being created, e.g. if there is a possibility that in your list exists the entry "Email" and "Email " (with an empty space at the end).
 
Regards,
Elena

Thank you for response 

Hi ,

How to make relatopnship with existing "CallDescription Data and how to make meaningfull insights with CallDescription row , Please refer screenshot 

simsree9_0-1658741474600.png

 

That really depends on what you want to do with the data afterwards. I can see several options. First of all, you could have a node type "Issue", where you put in the message. This can then me connected up to the Location via a relationship. However, your "Call Description" column contains a lot more data than just the description. It has e.g. the "logged through" information which might be again a new node type, e.g. something like (:Issue)-[:LOGGED_THROUGH]->(:System). Also the contacts could be different node types. 

When modelling, you should keep in mind the query that you want to send in the end.

koji
Ninja
Ninja

Hi @simsree9 

Here is an example of using this data as a node in a transaction.
The nodes are Data, Region, Location, and Category.

I created the small csv file.

"Region","Location","Category"
"India","Chandigarh SEZ SDB1","Server Hosting in DMZ"
"India","Chandigarh SEZ SDB1","Software"
"India","Bangalore_GHS","Email"
"India","Gurgaon-Uniworld Towers","Remote Connectivity"
"India","InfyCity B(01-10)","Laptop"
"India","InfyCity B(01-10)","Email"

 

 

Load CSV

This is one simple example; if you have a lot of data, you will need to add indexes.

 

 

LOAD CSV WITH HEADERS FROM 'file:///sampledata.csv' AS line
CREATE (data:SampleData {
  region: trim(line.Region),
  location: trim(line.Location),
  category: trim(line.Category)
})
MERGE (reg:Region {name: trim(line.Region)})
MERGE (loc:Location {name: trim(line.Location)})
MERGE (cat:Category {name: trim(line.Category)})
CREATE (data)-[:REGION_IS]->(reg)
CREATE (data)-[:LOCAtiON_IS]->(loc)
CREATE (data)-[:CATEGORY_IS]->(cat);

 

 

CALL db.schema.visualization

  • Green: Data
  • Yellow: Location
  • Blue: Region
  • Red: Category
    スクリーンショット 2022-07-25 15.57.04.png

MATCH (n) RETURN n
スクリーンショット 2022-07-25 15.56.16.png








Hi ,

How to make relatopnship with existing "CallDescription Data and how to make meaningfull insights with CallDescription row , Please refer screenshot 

Hi ,

How to make relatopnship with existing "CallDescription Data and how to make meaningfull insights with CallDescription row , Please refer screenshot 

simsree9_1-1658741524492.png

 

ameyasoft
Graph Maven

Try this:

MERGE (reg:Region {name:"India"})
MERGE (loc:Location {name:"Chandigarh SEZ SBDB1"})
MERGE (cat:Category {name:"Server Hosting DMZ"})
MERGE (sub:SubCategory {name:"AWS"})

MERGE (reg)-[:LOCATION]-(loc)
MERGE (loc)-[:CATEGORY]->(cat)
MERGE (cat)-[:SUB_CATEGORY]->(sub)

CREATE (b:CallOriginator {name: "Banco Azteca"})
CREATE (sub)-[:CALL_ORIGI NATOR]->(b)

CREATE (a:Description {descr: "Hi team, I am unable to connect to unix server via putty. Banco "})
CREATE (b)-[:CALL_DESCRIPTION]->(a)

CREATE(c:HostName {name: "ecIssues-100-Issues4-Issues-01-114.compute-1.amazon1.com.From 10.0.0"})
CREATE (a)-[:HOST_NAME]->(c)

CREATE (d:LoggedThrough {loggedThrough: "#OneClickAHD#"})
CREATE (c)-[:LOGGED_THROUGH]->(d)

CREATE (f:ContactName {name:"Abhishek Jaladi", addnl:"FNSP BAZCHILP"})
CREATE (d)-[:CONTACT_NAME]->(f)
Result:

Screen Shot 2022-07-25 at 4.53.47 PM.png

Hi ,

I agree this solution for small amount of data set & we cannot create every time hostname with esclation & contact name please refer below data and can you share any other way to sort it with this data to meaningful insights 

simsree9_0-1658808066698.png

 

 

ameyasoft
Graph Maven

I am not clear about your data model. When you say 'existing Call Description' data, question is where it exists. Does it exist in Neo4j , if so please share how you stored that data in Neo4j.

simsree9
Node

Hi @ameyasoft ,

I am try to build model in IT Operations HelpDesk Data , This Data contain different categories i wan take top searching keywords like under category software, Laptop ,EMAIL ,Internet ..we are able to make relationship among these fields  Location,Region , category,Subcategory  how ever Call Description have lots of data & i wan bring meaingfull insitghts from Call description . please refer the data 

simsree9_0-1658813527192.pngsimsree9_1-1658813557644.png

Please check calldescription data , it contains more data and need to bring meaningfull insights from it 

 

ameyasoft
Graph Maven

Yes call description has more data, but all in a kind of block. How did you store this data in Neo4j? Also, let me know what kind of report you want to generate from this data. Post  your LOAD csv  Cypher script.

Hi @ameyasoft ,

I am trying to build a dynamic Dashboard for IT Operations &  identifying problem aera from the data  top 5 search keywords  under the category 1.Software 2.Laptop 3. Email 4.Ineternet connectivity  5.Other Issues . to build trend analysis and meaningful classification