0
votes

I have this network I'm working on from STRING database . I have extracted that network so that I can impor it into Neo4j , The format I used is TSV and i have converted it to csv and done the import yet , I can see only nodes and no relationships in between . How can I make Neo4j able to know the relationships .and represent them Here is the STRING network : http://string-db.org/cgi/network.pl?taskId=sPvqsEhi3Tk6&sessionId=MKQKZSH3dCb3&bottom_page_content=table

and that is the tabular form [1]: https://i.stack.imgur.com/IMMFk.png And here is the Neo4j graph [1]: https://i.stack.imgur.com/eKeYv.png

1

1 Answers

0
votes

I think the following will do the trick :

CREATE CONSTRAINT ON (n:Node) ASSERT a.NodeID IS UNIQUE;
USING PERIODIC COMMIT
LOAD CSV WITH HEADERS FROM 'file:///strings.csv'
AS line
WITH line
MERGE (n1:Node {NodeID: line.node1_string_internal_id, NodeName: line.node1})
MERGE (n2:Node {NodeID: line.node2_string_internal_id, NodeName: line.node2})
MERGE (n1)-[:INTERACTS {Score: TOFLOAT(line.combined_score)}]->(n2);

I hope this helps.

Regards, Tom