# Newbie need help inputting multiple relationships

**URL:** <https://community.neo4j.com/t/newbie-need-help-inputting-multiple-relationships/3027>\
**Category:** Browser\
**Created:** [November 15, 2018, 12:20pm UTC](https://community.neo4j.com/t/newbie-need-help-inputting-multiple-relationships/3027 "2018-11-15T12:20:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![matt.swart](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/matt.swart/32/2060_2.png) [@matt.swart](https://community.neo4j.com/u/matt.swart)\
**Post date:** [November 15, 2018, 12:20pm UTC](https://community.neo4j.com/t/newbie-need-help-inputting-multiple-relationships/3027/1 "2018-11-15T12:20:29Z")

</div>

Maybe someone can help me here. I am totally new to Neo4j. I have built a database with 3 different Nodes I now need to define the relationship between the data and like before I tested one relationship in the browser to ensure it works then moved over to Python to produce a dump file with commands to add the rest of the relationship data ( create (WR:WebSiteName{WebIP: '104.20.29.141'}) - [:WEBSITELOCATIONRELATION] -\>(LR:Location{Ip: '104.20.29.141'}); ) Sample of my connection. Anyway when I dump the lines into the browser to run the create statements it I get an error (Neo.ClientError.Statement.SyntaxError: Expected exactly one statement per query but got: 1019) now I understand that it is looking for one statement at a time but is there away around this as I have a total of 1325 relationships to define?

I have run single statements and they do work.

Kind regards

Matthew Swart

---

<div class="post-metadata">

**Author:** ![12kunal34](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/12kunal34/32/2617_2.png) [@12kunal34](https://community.neo4j.com/u/12kunal34)\
**Post date:** [November 15, 2018, 1:24pm UTC](https://community.neo4j.com/t/newbie-need-help-inputting-multiple-relationships/3027/2 "2018-11-15T13:24:50Z")

</div>

Hi Matt,

Could you please share the data schema or Sample data for which you want to Create Relationship.  
Bdw you can use below query structure for adding relationship

```auto
MATCH (WR:WebSiteName{WebIP: '104.20.29.141'})
MATCH (LR:Location{Ip: '104.20.29.141'}) 
CREATE (WR)-[:WEBSITELOCATIONRELATION]->(LR)

```

in above query if you want to avoid duplicate Relationshio then USE Merge instead of Create  
one more thing as i can see in your query that is your location Ip and Website WebIP is same .

do you want to use constraint that Website WebIP = location Ip ??

If you want to use this Constraint then Query can be like below

```auto
Match(WR:WebSiteName)
Match (LR:Location) WITH WR,LR WHERE WR.WebIP= LR.Ip
merge(WR)-[r:Having]->(LR)

```

---

<div class="post-metadata">

**Author:** ![matt.swart](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/matt.swart/32/2060_2.png) [@matt.swart](https://community.neo4j.com/u/matt.swart)\
**Post date:** [November 15, 2018, 1:45pm UTC](https://community.neo4j.com/t/newbie-need-help-inputting-multiple-relationships/3027/3 "2018-11-15T13:45:42Z")

</div>

Data summary:  
107 of ---\> CREATE (W0:WebSiteName { webIP: "104.24.19.110" ,webName: "www.agriland.ie"}); (Obviously each one is different website and ip.

995 of ----\> CREATE (H0:HopInfo { webIPForHop: "104.24.19.110" ,HopNumber: "1" ,HopIP: "192.168.43.1" ,RTT1: "12.221" ,RTT2: "12.198" ,RTT3: "12.177"});

1917 of ----\> CREATE (L0:Location { lon: "-122.348" ,lat: "47.6339" ,Ip: "52.93.101.61" });

Then I need to make connections/relationships:  
147 of -----\> create (WR:WebSiteName{WebIP: '104.123.112.198'}) - [:WEBSITELOCATIONRELATION] -\> (LR:Location{Ip: '104.123.112.198'});

1176 of ----\> create (HR:HopInfo{HopIP: '129.250.6.18'}) - [:HOPLOCATIONRELATION] -\> (LHR:Location{Ip: '129.250.6.18'});

Thanks for the suggestion on the add relationships I am rebuilding dump file now.

The top 3 create statements have gone in to the database with no trouble at all.  
It is just the relationship data that is giving me issues, But I can input those statements one at a time.

 ![Capture](https://us1.discourse-cdn.com/flex021/uploads/neo4jcommunity/original/2X/e/e259eee1a96da1355083b9a59f6db44af55d3e55.png)

As you can see if I try run two of the revised statements it says it was expecting one but got 2 and I am wondering is there a way to overcome this.

 ![Capture](https://us1.discourse-cdn.com/flex021/uploads/neo4jcommunity/original/2X/e/e478d8295337d6446682af986b26ca00c729974b.png)  
Running one revised query works perfectly fine.

---

<div class="post-metadata">

**Author:** ![matt.swart](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/matt.swart/32/2060_2.png) [@matt.swart](https://community.neo4j.com/u/matt.swart)\
**Post date:** [November 15, 2018, 2:06pm UTC](https://community.neo4j.com/t/newbie-need-help-inputting-multiple-relationships/3027/4 "2018-11-15T14:06:20Z")

</div>

OK figured out the issue on the desktop I needed to go into settings and tick the "Enable multi statement query editor" box.

 ![Capture](https://us1.discourse-cdn.com/flex021/uploads/neo4jcommunity/original/2X/d/d22a375dff22c712d32b13c2085c453b84db3d6a.png)

---

<div class="post-metadata">

**Author:** ![12kunal34](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/12kunal34/32/2617_2.png) [@12kunal34](https://community.neo4j.com/u/12kunal34)\
**Post date:** [November 15, 2018, 8:23pm UTC](https://community.neo4j.com/t/newbie-need-help-inputting-multiple-relationships/3027/5 "2018-11-15T20:23:31Z")

</div>

so is it working fine now ??  
or is there any issue ?
