At a Conference? Need a Dataset? Neo4j at NOSQL NOW
For the "Lunch and Learn around Neo4j" with Andreas Kollegger we wanted to use a dataset that is easy to understand and interesting enough for attendees of the conference.
So we chose to use just that days conference program as dataset. Conference data is usually well connected and has the opportunity for challenging data model discussions and insightful queries.
So we set up a Heroku instance, connected to a provisioned Neo4j database hosting an informational website. It explains Neo4j, the local installation, the Heroku add-on and lists available drivers for the different languages. We then used a small ruby script. with the neography gem by our community rock star Max De Marzi to populate the database.
From our example-data site, you can download the graph.db directory for your local Neo4j server.
02.require 'neography'
03.
04.def neo
05.@neo ||= Neography::Rest.new("http://localhost:7474")
06.end
07.
08.def has_rel(node, dir, type)
09.res = neo.get_node_relationships(node, dir, type)
10.return res && res.size > 0
11.end
12.
13.def add_talk(slot, title, speakers,audience,tags)
14.root = neo.get_root()
15.talk = neo.create_node({:title => title})
16.slot = neo.create_unique_node(:slots, :slot, slot, { :slot => slot})
17.neo.create_relationship(:at, talk, slot)
18.speakers.each do |name, from|
19.speaker = neo.create_unique_node(:speakers, :name, name, { :name => name})
20.neo.create_relationship(:presents, speaker, talk)
21.company = neo.create_unique_node(:companies, :company, from, { :company => from})
22.neo.create_relationship(:works_at, speaker, company) unless has_rel(speaker, :out, :works_at)
23.end
24.tags.each do |name|
25.tag = neo.create_unique_node(:tags, :tag, name, { :tag => name})
26.neo.create_relationship(:tagged, talk, tag)
27.neo.create_relationship(:tag, root, tag) unless has_rel(tag,:in, :tag)
28.end
29.who = neo.create_unique_node(:audience, :audience, audience, { :audience => audience})
30.neo.create_relationship(:for, talk, who)
31.end
32.
33.neo.execute_query("start n=node(*) match n-[r?]-m where ID(n)<>0 delete n,r")
34.
35.[:slots, :speakers, :companies, :tags, :audience].each do |name|
36.neo.create_node_index(name, :exact, :lucene)
37.end
38.
39.
40.add_talk("08:30 AM - 09:00 AM",'The Journey to Amazon DynamoDB: From Scaling by Architecture to Scaling by Commandment',
41.{'Swami Sivasubramanian'=>'Amazon Web Services'}, 'Technical - Introductory', [ 'Cloud Computing',"NoSQL Architecture and Design"])
42.add_talk("09:00 AM - 09:45 AM", 'Then Our Buildings Shape Us: A new way to think about NoSQL technology selection',
43.{'Tim Berglund'=>'GitHub'}, 'Business / Non-Technical', [ 'NoSQL Architecture and Design', "NoSQL Technology Evaluation"])
44.add_talk("09:45 AM - 10:00 AM",'Create Powerful New Applications with Graphs',
45.{'Emil Eifrem'=>'Neo Technology'}, 'Business / Non-Technical', [ 'Graph Databases'])
46.add_talk("10:30 AM - 11:15 AM",'Why and When You Should Use Redis',
47.{'Josiah Carlson'=>'ChowNow Inc.'}, 'Technical - Introductory', [ 'NoSQL Technology Evaluation'])
48....
49.add_talk("10:30 AM - 11:15 AM",'Intro to Graph Databases 101',
50.{'Andreas Kollegger'=>'Neo Technology'}, 'Technical - Introductory', ['Graph Databases'])
51....
52.add_talk("01:15 PM - 02:00 PM",'Lunch N Learn with Neo Technology and Neo4j',
53.{'Andreas Kollegger'=>'Neo Technology'}, 'Technical - Introductory', ['Graph Databases'])
54.add_talk("02:15 PM - 03:00 PM", 'Using Graph Databases to Analyze Relationships, Risks and Business Opportunities - A Case Study',
55.{'Jans Aasman'=>'Franz Inc'}, 'Technical - Introductory', [ 'Graph Databases'])
56.add_talk("04:15 PM - 04:45 PM", 'High performance graph database using cache, cloud, and standards',
57.{'Bryan Thompson'=>'SYSTAP, LLC'}, 'Technical - Advanced', [ 'Graph Databases'])
58.....
59.add_talk("04:15 PM - 04:45 PM", 'Introducing Hadoop and Big Data into a Healthcare Organization: A True Story and Learned Lessons',
60.{'Vladimir Bacvanski'=>'SciSpike'}, 'Technical - Intermediate', [ 'Big Data'])
61.add_talk("04:15 PM - 04:45 PM", 'NoSQL Data Modelling for Scalable eCommerce',
62.{'Dipali Trivedi'=>'Staples.com'}, 'Technical - Intermediate', [ 'NoSQL Architecture and Design'])
63.
64.
65.add_talk("05:30 PM - 06:30 PM",'The NoSQL "C Panel"', {"Robert Scoble"=>"RackSpace",
66."Bob Wiederhold"=>"Couchbase",
67."Dwight Merriman"=>"10gen",
68."Emil Eifrem"=>"Neo Technology",
69."Jay Jarrell"=>"Objectivity, Inc.",
70."Kirk Dunn"=>"Cloudera, Inc."},
71."Business / Non-Technical",
72.["Graph Databases","Hadoop", "MongoDB"])
So we chose to use just that days conference program as dataset. Conference data is usually well connected and has the opportunity for challenging data model discussions and insightful queries.
So we set up a Heroku instance, connected to a provisioned Neo4j database hosting an informational website. It explains Neo4j, the local installation, the Heroku add-on and lists available drivers for the different languages. We then used a small ruby script. with the neography gem by our community rock star Max De Marzi to populate the database.
From our example-data site, you can download the graph.db directory for your local Neo4j server.
CODE:
01.require 'rubygems'02.require 'neography'
03.
04.def neo
05.@neo ||= Neography::Rest.new("http://localhost:7474")
06.end
07.
08.def has_rel(node, dir, type)
09.res = neo.get_node_relationships(node, dir, type)
10.return res && res.size > 0
11.end
12.
13.def add_talk(slot, title, speakers,audience,tags)
14.root = neo.get_root()
15.talk = neo.create_node({:title => title})
16.slot = neo.create_unique_node(:slots, :slot, slot, { :slot => slot})
17.neo.create_relationship(:at, talk, slot)
18.speakers.each do |name, from|
19.speaker = neo.create_unique_node(:speakers, :name, name, { :name => name})
20.neo.create_relationship(:presents, speaker, talk)
21.company = neo.create_unique_node(:companies, :company, from, { :company => from})
22.neo.create_relationship(:works_at, speaker, company) unless has_rel(speaker, :out, :works_at)
23.end
24.tags.each do |name|
25.tag = neo.create_unique_node(:tags, :tag, name, { :tag => name})
26.neo.create_relationship(:tagged, talk, tag)
27.neo.create_relationship(:tag, root, tag) unless has_rel(tag,:in, :tag)
28.end
29.who = neo.create_unique_node(:audience, :audience, audience, { :audience => audience})
30.neo.create_relationship(:for, talk, who)
31.end
32.
33.neo.execute_query("start n=node(*) match n-[r?]-m where ID(n)<>0 delete n,r")
34.
35.[:slots, :speakers, :companies, :tags, :audience].each do |name|
36.neo.create_node_index(name, :exact, :lucene)
37.end
38.
39.
40.add_talk("08:30 AM - 09:00 AM",'The Journey to Amazon DynamoDB: From Scaling by Architecture to Scaling by Commandment',
41.{'Swami Sivasubramanian'=>'Amazon Web Services'}, 'Technical - Introductory', [ 'Cloud Computing',"NoSQL Architecture and Design"])
42.add_talk("09:00 AM - 09:45 AM", 'Then Our Buildings Shape Us: A new way to think about NoSQL technology selection',
43.{'Tim Berglund'=>'GitHub'}, 'Business / Non-Technical', [ 'NoSQL Architecture and Design', "NoSQL Technology Evaluation"])
44.add_talk("09:45 AM - 10:00 AM",'Create Powerful New Applications with Graphs',
45.{'Emil Eifrem'=>'Neo Technology'}, 'Business / Non-Technical', [ 'Graph Databases'])
46.add_talk("10:30 AM - 11:15 AM",'Why and When You Should Use Redis',
47.{'Josiah Carlson'=>'ChowNow Inc.'}, 'Technical - Introductory', [ 'NoSQL Technology Evaluation'])
48....
49.add_talk("10:30 AM - 11:15 AM",'Intro to Graph Databases 101',
50.{'Andreas Kollegger'=>'Neo Technology'}, 'Technical - Introductory', ['Graph Databases'])
51....
52.add_talk("01:15 PM - 02:00 PM",'Lunch N Learn with Neo Technology and Neo4j',
53.{'Andreas Kollegger'=>'Neo Technology'}, 'Technical - Introductory', ['Graph Databases'])
54.add_talk("02:15 PM - 03:00 PM", 'Using Graph Databases to Analyze Relationships, Risks and Business Opportunities - A Case Study',
55.{'Jans Aasman'=>'Franz Inc'}, 'Technical - Introductory', [ 'Graph Databases'])
56.add_talk("04:15 PM - 04:45 PM", 'High performance graph database using cache, cloud, and standards',
57.{'Bryan Thompson'=>'SYSTAP, LLC'}, 'Technical - Advanced', [ 'Graph Databases'])
58.....
59.add_talk("04:15 PM - 04:45 PM", 'Introducing Hadoop and Big Data into a Healthcare Organization: A True Story and Learned Lessons',
60.{'Vladimir Bacvanski'=>'SciSpike'}, 'Technical - Intermediate', [ 'Big Data'])
61.add_talk("04:15 PM - 04:45 PM", 'NoSQL Data Modelling for Scalable eCommerce',
62.{'Dipali Trivedi'=>'Staples.com'}, 'Technical - Intermediate', [ 'NoSQL Architecture and Design'])
63.
64.
65.add_talk("05:30 PM - 06:30 PM",'The NoSQL "C Panel"', {"Robert Scoble"=>"RackSpace",
66."Bob Wiederhold"=>"Couchbase",
67."Dwight Merriman"=>"10gen",
68."Emil Eifrem"=>"Neo Technology",
69."Jay Jarrell"=>"Objectivity, Inc.",
70."Kirk Dunn"=>"Cloudera, Inc."},
71."Business / Non-Technical",
72.["Graph Databases","Hadoop", "MongoDB"])
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/301743/viewspace-744995/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- NoSQL 新貴之崛起的 Neo4jSQL
- NEO4J 獨特的NoSQL graph資料庫SQL資料庫
- Everything you need to know about mobile app architectureAPP
- Unknown host ‘XXXX: nodename nor servname provided, or not known‘. You may need to adjust the proxyIDE
- 瞭解如何在 Neo4j 的 NoSQL 資料儲存中持久化物件和關係。SQL持久化物件
- [羅嗦的詳解BURP靶場]徹底理解nosql最終關Lab: Exploiting NoSQL operator injection to extract unknown fieldsSQL
- JavaScript datasetJavaScript
- Do we need HACMP?ACM
- NoSQLSQL
- [Javascript] Why need arrow function?JavaScriptFunction
- 【Dataset】Maple-IDS - Network Security Malicious Traffic Detection Dataset
- tensorflow dataset APIAPI
- image-classification-dataset
- Need to set ‘serverTimezone‘ propertyServer
- E. We Need More Bosses
- 聊聊 NoSQLSQL
- Why NoSQL?SQL
- NoSQL 初探SQL
- 《精通Neo4j》前言
- Neo4j簡介
- neo4j匯入
- Mmdetection dataset pipline
- 淺談DataSet 的用法
- Pytorch Dataset入門PyTorch
- Neo4j資料庫資料庫
- 擴充套件Neo4j套件
- neo4j docoker安裝
- Nosql分類SQL
- NoSQL之CassandraSQL
- NoSQL之HBaseSQL
- NoSQL RevolutionSQL
- NOSQL之旅---HBaseSQL
- NoSQL 述評SQL
- Spark2 Dataset聚合操作Spark
- asp.net---Dataset的用法ASP.NET
- DataSet的幾個基本操作
- DataAdapter & DataSet 使用小結APT
- SqlDataAdapter DataSet DataTable 詳解SQLLDAAPT