This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // this script uses the neo4j-shell-tools | |
| // create personal nodes | |
| import-cypher -d ; -i ./IMPORT/INPUT/PersonalNodes.csv -o ./IMPORT/OUTPUT/personalnodeout.csv create (n:url {id:{id}+1000,name:{name},type:{type}}) return n.name as name | |
| // create indices | |
| CREATE index on :url(name); | |
| CREATE index on :url(id); | |
| CREATE index on :url(type); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ####### | |
| # GENERAL NOTES | |
| ####### | |
| * Node labels are case-sensitive. Customer and customer are different! | |
| * Relationship names are case-sensitive. OWNS and owns are different! | |
| * You can create nodes/relationships iff they don't exist using UNIQUE: http://docs.neo4j.org/chunked/snapshot/query-create-unique.html. | |
| ####### | |
| # ADMIN QUERIES |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package prizedraw; | |
| import com.twilio.Twilio; | |
| import com.twilio.base.ResourceSet; | |
| import com.twilio.rest.api.v2010.account.Message; | |
| import com.twilio.type.PhoneNumber; | |
| import org.joda.time.DateTime; | |
| import java.util.Collections; | |
| import java.util.stream.Collectors; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Let's create the top of the tree, the PRODUCT | |
| create (n1:PRODUCT {id:1}); | |
| //Let's create 100 children of the PRODUCT, COST_GROUPS connected to the top of the tree | |
| match (n1:PRODUCT {id:1}) | |
| with range(1,100) as RANGE, n1 | |
| foreach (r in RANGE | create (n2:COST_GROUP {id:r})-[:PART_OF {quantity:round(rand()*100)}]->(n1) ); | |
| //for every COST_GROUP, let's connect 100 children at a 3rd level, the COST_TYPEs | |
| match (n2:COST_GROUP) |
##Neo4j GraphGist - Enterprise Architectures: Real-time Graph Updates using Kafka Messaging
Neo4j Use Case: Low Latency Graph Analytics & OLTP - Update 1M Nodes in 90 secs with Kafka and Neo4j Bolt
A recent Neo4j whitepaper describes how Monsanto is performing real-time updates on a 600M node Neo4j graph using Kafka to consume data extracted from a large Oracle Exadata instance.
This modern data architecture combines a fast, scalable messaging platform (Kafka) for low latency data provisioning and an enterprise graph database (Neo4j) for high performance, in-memory analytics & OLTP - creating new and powerful real-time graph analytics capabilities for your enterprise applications.