cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Please help me with my neo4j project futher. I made some progress

I created these...

CREATE (:8 {8: ""})<-[:_RELATED {Fast Ethernet Ports: ""}]-(n2:C1000-8T-2G-L {C1000-8T-2G-L: ""})<-[:_RELATED {Produces: ""}]-(CiscoRouters:CiscoRouters {CiscoRouters: ""})-[:_RELATED {Produces: ""}]->(n1:C1000-8T-E-2G-L {C1000-8T-E-2G-L: ""})-[:_RELATED {Faster Ethernet Ports: ""}]->(:8 {8: ""}),
(:24 {24: ""})<-[:_RELATED {Fast Ethernet Ports: ""}]-(n4:C1000-24FP-4G-L {C1000-24FP-4G-L: ""})<-[:_RELATED {Produces: ""}]-(CiscoRouters)-[:_RELATED {Produces: ""}]->(n3:C1000-24T-4G-L {C1000-24T-4G-L: ""})-[:_RELATED {Fast Ethernet Ports: ""}]->(:24 {24: ""}),
(:16 {16: ""})<-[:_RELATED {Fast Ethernet Ports: ""}]-(n6:C1000-16P-E-2G-L {C1000-16P-E-2G-L: ""})<-[:_RELATED {Produces: ""}]-(CiscoRouters)-[:_RELATED {Produces: ""}]->(n5:C1000-16T-E-2G-L {C1000-16T-E-2G-L: ""})-[:_RELATED {Fast Ethernet Ports: ""}]->(:16 {16: ""}),
(:None {None: ""})<-[:Power {Power: ""}]-(n2)-[:_RELATED {Up Link: ""}]->(:2 SFP/RJ-45 combo {2 SFP/RJ-45 combo: ""}),
(:10.56in {10.56: "", 10.56in: ""})<-[:Width {Width: ""}]-(n2)-[:Fanless {Fanless: ""}]->(:Yes {Yes: ""}),
(:1.73in {1.73in: ""})<-[:Height {Height: ""}]-(n2)-[:Depth {Depth: ""}]->(:7.28in {7.28in: ""}),
(n2)-[:Weight {Weight: ""}]->({1.8in: ""}),
(:None {None: ""})<-[:Power {Power: ""}]-(n1)-[:_RELATED {Up Link: ""}]->(:2 SFP/RJ-45 combo {2 SFP/RJ-45 combo: ""}),
(:10.56in {10.56in: ""})<-[:Width {Width: ""}]-(n1)-[:Fanless {Fanless: ""}]->(:Yes {Yes: ""}),
(:1.73in {1.73in: ""})<-[:Height {Height: ""}]-(n1)-[:Depth {Depth: ""}]->(:7.28in {7.28in: ""}),
(n1)-[:Weight {Weight: ""}]->(:1.55 {1.55: ""}),
(:None {None: ""})<-[:Power {Power: ""}]-(n5)-[:_RELATED {Up Link: ""}]->(:2 SFP {2 SFP: ""}),
(:10.56in)<-[:Width {Width: ""}]-(n5)-[:Fanless {Fanless: ""}]->(:Yes {Yes: ""}),
(:1.73in {1.73in: ""})<-[:Height {Height: ""}]-(n5)-[:Depth {Depth: ""}]->(:8.26in {8.26in: ""}),
(n5)-[:Weight {Weight: ""}]->(:1.42 {1.42: ""}),
(:120W {120W: ""})<-[:Power {Power: ""}]-(n6)-[:_RELATED {Up Link: ""}]->(:2 SFP {2 SFP: ""}),
(:10.56in {10.56in: ""})<-[:Width {Width: ""}]-(n6)-[:Fanless {Fanless: ""}]->(:Yes {Yes: ""}),
(:1.73in {1.73in: ""})<-[:Height {Height: ""}]-(n6)-[:Depth {Depth: ""}]->(:8.26in {8.26in: ""}),
(n6)-[:Weight {Weight: ""}]->(:1.42 {1.42: ""}),
(:None {None: ""})<-[:Power {Power: ""}]-(n3)-[:_RELATED {Up Link: ""}]->(:4 SFP {4 SFP: ""}),
(:17.48in {17.48in: ""})<-[:Width {Width: ""}]-(n3)-[:Fanless {Fanless: ""}]->(:Yes {Yes: ""}),
(:1.73in {1.73in: ""})<-[:Height {Height: ""}]-(n3)-[:Depth {Depth: ""}]->(:9.45in {9.45in: ""}),
(n3)-[:Weight {Weight: ""}]->(:2.63 {2.63: ""}),
(:370W {370W: ""})<-[:Power {Power: ""}]-(n4)-[:_RELATED {Up Link: ""}]->(:4 SFP {4 SFP: ""}),
(:17.48in {17.48in: ""})<-[:Width {Width: ""}]-(n4)-[:Fanless {Fanless: ""}]->(:No {No: ""}),
(:1.73in {1.73in: ""})<-[:Height {Height: ""}]-(n4)-[:Depth {Depth: ""}]->(:13.59in),
(n4)-[:Weight {Weight: ""}]->(:4.6 {4.6: ""})

I match these...

MATCH path0 = (:8 {8: ""})<-[{Fast Ethernet Ports: ""}]-(n2:C1000-8T-2G-L {C1000-8T-2G-L: ""})<-[{Produces: ""}]-(CiscoRouters:CiscoRouters {CiscoRouters: ""})-[{Produces: ""}]->(n1:C1000-8T-E-2G-L {C1000-8T-E-2G-L: ""})-[{Faster Ethernet Ports: ""}]->(:8 {8: ""}),
path1 = (:24 {24: ""})<-[{Fast Ethernet Ports: ""}]-(n4:C1000-24FP-4G-L {C1000-24FP-4G-L: ""})<-[{Produces: ""}]-(CiscoRouters)-[{Produces: ""}]->(n3:C1000-24T-4G-L {C1000-24T-4G-L: ""})-[{Fast Ethernet Ports: ""}]->(:24 {24: ""}),
path2 = (:16 {16: ""})<-[{Fast Ethernet Ports: ""}]-(n6:C1000-16P-E-2G-L {C1000-16P-E-2G-L: ""})<-[{Produces: ""}]-(CiscoRouters)-[{Produces: ""}]->(n5:C1000-16T-E-2G-L {C1000-16T-E-2G-L: ""})-[{Fast Ethernet Ports: ""}]->(:16 {16: ""}),
path3 = (:None {None: ""})<-[:Power {Power: ""}]-(n2)-[{Up Link: ""}]->(:2 SFP/RJ-45 combo {2 SFP/RJ-45 combo: ""}),
path4 = (:10.56in {10.56: "", 10.56in: ""})<-[:Width {Width: ""}]-(n2)-[:Fanless {Fanless: ""}]->(:Yes {Yes: ""}),
path5 = (:1.73in {1.73in: ""})<-[:Height {Height: ""}]-(n2)-[:Depth {Depth: ""}]->(:7.28in {7.28in: ""}),
path6 = (n2)-[:Weight {Weight: ""}]->({1.8in: ""}),
path7 = (:None {None: ""})<-[:Power {Power: ""}]-(n1)-[{Up Link: ""}]->(:2 SFP/RJ-45 combo {2 SFP/RJ-45 combo: ""}),
path8 = (:10.56in {10.56in: ""})<-[:Width {Width: ""}]-(n1)-[:Fanless {Fanless: ""}]->(:Yes {Yes: ""}),
path9 = (:1.73in {1.73in: ""})<-[:Height {Height: ""}]-(n1)-[:Depth {Depth: ""}]->(:7.28in {7.28in: ""}),
path10 = (n1)-[:Weight {Weight: ""}]->(:1.55 {1.55: ""}),
path11 = (:None {None: ""})<-[:Power {Power: ""}]-(n5)-[{Up Link: ""}]->(:2 SFP {2 SFP: ""}),
path12 = (:10.56in)<-[:Width {Width: ""}]-(n5)-[:Fanless {Fanless: ""}]->(:Yes {Yes: ""}),
path13 = (:1.73in {1.73in: ""})<-[:Height {Height: ""}]-(n5)-[:Depth {Depth: ""}]->(:8.26in {8.26in: ""}),
path14 = (n5)-[:Weight {Weight: ""}]->(:1.42 {1.42: ""}),
path15 = (:120W {120W: ""})<-[:Power {Power: ""}]-(n6)-[{Up Link: ""}]->(:2 SFP {2 SFP: ""}),
path16 = (:10.56in {10.56in: ""})<-[:Width {Width: ""}]-(n6)-[:Fanless {Fanless: ""}]->(:Yes {Yes: ""}),
path17 = (:1.73in {1.73in: ""})<-[:Height {Height: ""}]-(n6)-[:Depth {Depth: ""}]->(:8.26in {8.26in: ""}),
path18 = (n6)-[:Weight {Weight: ""}]->(:1.42 {1.42: ""}),
path19 = (:None {None: ""})<-[:Power {Power: ""}]-(n3)-[{Up Link: ""}]->(:4 SFP {4 SFP: ""}),
path20 = (:17.48in {17.48in: ""})<-[:Width {Width: ""}]-(n3)-[:Fanless {Fanless: ""}]->(:Yes {Yes: ""}),
path21 = (:1.73in {1.73in: ""})<-[:Height {Height: ""}]-(n3)-[:Depth {Depth: ""}]->(:9.45in {9.45in: ""}),
path22 = (n3)-[:Weight {Weight: ""}]->(:2.63 {2.63: ""}),
path23 = (:370W {370W: ""})<-[:Power {Power: ""}]-(n4)-[{Up Link: ""}]->(:4 SFP {4 SFP: ""}),
path24 = (:17.48in {17.48in: ""})<-[:Width {Width: ""}]-(n4)-[:Fanless {Fanless: ""}]->(:No {No: ""}),
path25 = (:1.73in {1.73in: ""})<-[:Height {Height: ""}]-(n4)-[:Depth {Depth: ""}]->(:13.59in),
path26 = (n4)-[:Weight {Weight: ""}]->(:4.6 {4.6: ""})
RETURN path0, path1, path2, path3, path4, path5, path6, path7, path8, path9, path10, path11, path12, path13, path14, path15, path16, path17, path18, path19, path20, path21, path22, path23, path24, path25, path26

I merge these...

MERGE (:8 {8: ""})<-[:_RELATED {Fast Ethernet Ports: ""}]-(n2:C1000-8T-2G-L {C1000-8T-2G-L: ""})<-[:_RELATED {Produces: ""}]-(CiscoRouters:CiscoRouters {CiscoRouters: ""})-[:_RELATED {Produces: ""}]->(n1:C1000-8T-E-2G-L {C1000-8T-E-2G-L: ""})-[:_RELATED {Faster Ethernet Ports: ""}]->(:8 {8: ""})
MERGE (:24 {24: ""})<-[:_RELATED {Fast Ethernet Ports: ""}]-(n4:C1000-24FP-4G-L {C1000-24FP-4G-L: ""})<-[:_RELATED {Produces: ""}]-(CiscoRouters)-[:_RELATED {Produces: ""}]->(n3:C1000-24T-4G-L {C1000-24T-4G-L: ""})-[:_RELATED {Fast Ethernet Ports: ""}]->(:24 {24: ""})
MERGE (:16 {16: ""})<-[:_RELATED {Fast Ethernet Ports: ""}]-(n6:C1000-16P-E-2G-L {C1000-16P-E-2G-L: ""})<-[:_RELATED {Produces: ""}]-(CiscoRouters)-[:_RELATED {Produces: ""}]->(n5:C1000-16T-E-2G-L {C1000-16T-E-2G-L: ""})-[:_RELATED {Fast Ethernet Ports: ""}]->(:16 {16: ""})
MERGE (:None {None: ""})<-[:Power {Power: ""}]-(n2)-[:_RELATED {Up Link: ""}]->(:2 SFP/RJ-45 combo {2 SFP/RJ-45 combo: ""})
MERGE (:10.56in {10.56: "", 10.56in: ""})<-[:Width {Width: ""}]-(n2)-[:Fanless {Fanless: ""}]->(:Yes {Yes: ""})
MERGE (:1.73in {1.73in: ""})<-[:Height {Height: ""}]-(n2)-[:Depth {Depth: ""}]->(:7.28in {7.28in: ""})
MERGE (n2)-[:Weight {Weight: ""}]->({1.8in: ""})
MERGE (:None {None: ""})<-[:Power {Power: ""}]-(n1)-[:_RELATED {Up Link: ""}]->(:2 SFP/RJ-45 combo {2 SFP/RJ-45 combo: ""})
MERGE (:10.56in {10.56in: ""})<-[:Width {Width: ""}]-(n1)-[:Fanless {Fanless: ""}]->(:Yes {Yes: ""})
MERGE (:1.73in {1.73in: ""})<-[:Height {Height: ""}]-(n1)-[:Depth {Depth: ""}]->(:7.28in {7.28in: ""})
MERGE (n1)-[:Weight {Weight: ""}]->(:1.55 {1.55: ""})
MERGE (:None {None: ""})<-[:Power {Power: ""}]-(n5)-[:_RELATED {Up Link: ""}]->(:2 SFP {2 SFP: ""})
MERGE (:10.56in)<-[:Width {Width: ""}]-(n5)-[:Fanless {Fanless: ""}]->(:Yes {Yes: ""})
MERGE (:1.73in {1.73in: ""})<-[:Height {Height: ""}]-(n5)-[:Depth {Depth: ""}]->(:8.26in {8.26in: ""})
MERGE (n5)-[:Weight {Weight: ""}]->(:1.42 {1.42: ""})
MERGE (:120W {120W: ""})<-[:Power {Power: ""}]-(n6)-[:_RELATED {Up Link: ""}]->(:2 SFP {2 SFP: ""})
MERGE (:10.56in {10.56in: ""})<-[:Width {Width: ""}]-(n6)-[:Fanless {Fanless: ""}]->(:Yes {Yes: ""})
MERGE (:1.73in {1.73in: ""})<-[:Height {Height: ""}]-(n6)-[:Depth {Depth: ""}]->(:8.26in {8.26in: ""})
MERGE (n6)-[:Weight {Weight: ""}]->(:1.42 {1.42: ""})
MERGE (:None {None: ""})<-[:Power {Power: ""}]-(n3)-[:_RELATED {Up Link: ""}]->(:4 SFP {4 SFP: ""})
MERGE (:17.48in {17.48in: ""})<-[:Width {Width: ""}]-(n3)-[:Fanless {Fanless: ""}]->(:Yes {Yes: ""})
MERGE (:1.73in {1.73in: ""})<-[:Height {Height: ""}]-(n3)-[:Depth {Depth: ""}]->(:9.45in {9.45in: ""})
MERGE (n3)-[:Weight {Weight: ""}]->(:2.63 {2.63: ""})
MERGE (:370W {370W: ""})<-[:Power {Power: ""}]-(n4)-[:_RELATED {Up Link: ""}]->(:4 SFP {4 SFP: ""})
MERGE (:17.48in {17.48in: ""})<-[:Width {Width: ""}]-(n4)-[:Fanless {Fanless: ""}]->(:No {No: ""})
MERGE (:1.73in {1.73in: ""})<-[:Height {Height: ""}]-(n4)-[:Depth {Depth: ""}]->(:13.59in)
MERGE (n4)-[:Weight {Weight: ""}]->(:4.6 {4.6: ""})

My question is how do I write a query for one of the router or all of the routers? Please help...

Thank you,
Dar

1 REPLY 1

Bennu
Graph Fellow

Hi @daredevyl

Before going deep into querying... Have you considered a different model? Maybe using propierties with values related to the size instead of specific labels?

I strongly suggest you to spend sometime here:

H