Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
12-20-2022 03:31 AM
Hello everyone! I'm new to GDB and need help to clarify a few things. I want to create a really simple database of a website domain and its subdomains (example.com, sub1.example.com, sub2.example.com) with IP as a property value. In JSON it would be looked like this:
{
"Domains": [
{
"Name": "sub1.example.com",
"IP": "10.0.0.0"
},
{
"Name": "sub2.example.com",
"IP": "10.0.0.1"
}
]}
What I want to do next is to create a relationship between those domains that share the same IP. What is the proper way to create such neo4j nodes?
I've already tried with the following cypher query:
CREATE (a:Domain {name:"sub1.example.com", ip:"10.0.0.1"})
But then I don't see how to apply the MATCH query.
12-20-2022 05:55 AM
For what you want, maybe you domain model should consist of ‘Domain’ nodes and ‘Host’ nodes. A Domain node for each web domain and a ‘Hist’ node for each ip address. You can then relate each domain to its host with a relationship like ‘HOSTED_BY’, or whatever you want.
12-20-2022 07:12 AM
Good point! For some reason I thought that I can escape adding additional type of a node. Thank you 🙂
All the sessions of the conference are now available online