GraphGists

Going to a Conference can be a lot of fun, an important networking opportunity, and a great learning experience. But it can also be hard to choose which workshops to attend. Conference workbooks can help you choose by providing long descriptions of the presentations offered and the biographies of the presenters. But they also can only provide one linear way to look at your options: by date & time. Neo4j and Graph Databases allow you to easily explore the conference by different category types, presenters, companies, vendors, room numbers, and more.

LpaP8IJ

In our example, we will input data from a specific conference: The Annual MOSES Organic Gardening Conference from 2015. This is the largest event in the U.S. about organic & sustainable farming. It has 160 presenters, 281 companies, and 135 workshops & presentations. These were spread out over the course of 3 days, with 16 rooms, and 45 sessions.

Here is our Domain Model:

PsBNDs3

Example Data: Load & View

Here is one example of a MOSES Conference Presentation: "Does It Pay to Irrigate Pasture Here?" This one happens to have 2 presenters. One of the presenters works for 2 different companies. We also load the room, session time, category & presentation types of this Presentation.

Create (per154:Person {id:154, name:'Tom Kriegl', city:'', state:'', email1:'tskriegl@wisc.edu', email2:'', website:'cdp.wisc.edu', description:'Tom Kriegl recently officially retired as a Farm Financial Analyst at the University of Wisconsin Center For Dairy Profitability where he has been conducting research on the economic competitiveness of dairy systems. He has been the primary researcher in the Wisconsin Grazing Dairy Profitability Analysis and lead researcher in the Great Lakes Grazing Network Dairy Financial Summary.'}),
(per155:Person {id:155, name:'Paul Onan', city:'Amherst Junction', state:'WI', email1:'ponan@wi-net.com', email2:'', website:'', description:'Paul Onan has been dairy farming with grazing as the primary source of forage for his 100-cow milking herd for the past 20 years. He installed a K-line irrigation system in 2009 on his Amherst Junction, Wis. farm to irrigate 30 acres and participated in research to determine its economic feasibility.'}),
(pres19:Presentation {id:19, name:'Does it Pay to Irrigate Pasture Here?', description:'Many dairy and livestock operations use management intensive rotational grazing for controlling feed costs. Yet many believe the cost of irrigation can’t be justified for pasture. Considering that many pastures are dominated by grasses that are not drought tolerant, and we’ve seen a substantial increase in agricultural commodity and input prices since 2006, it’s worth looking at the economic feasibility of irrigating pasture in the Upper Midwest.'}),
(co34:Company {id:34, booth:'', exhibitor:'FALSE', sponsor:'FALSE', name:'Great Lakes Grazing Network Dairy Financial Summary', address:'', phone:'', email:'', website:'', description:''}),
(co99:Company {id:99, booth:'', exhibitor:'FALSE', sponsor:'FALSE', name:'University of Wisconsin Center for Dairy Profitability', address:'', phone:'', email:'', website:'', description:''}),
(co62:Company {id:62, booth:'', exhibitor:'FALSE', sponsor:'FALSE', name:'Onan Dairy Farm', address:'', phone:'', email:'', website:'', description:''}),
(prest2:PresentationType {id:2, name:'Workshops', description:''}),
(rm8:Room {id:8, Name:'Room K'}),
(presceu5:ContinuedEducationType {id:5, ShortName:'SW', name:'Soil & Water Management'}),
(press3:Symbol {id:3, name:'Research Forum', description:'The MOSES Conference will highlight several workshops where researchers, and often the organic farmers that assisted, will present the findings and implications of recent work.'}),
(presct2:CategoryType {id:2, name:'Livestock'}),
(ses10:Session {id:10, Name:'Saturday Session 3', Day:'S', TimeBegin:'3:00 PM', TimeEnd:'4:30 PM'}),
(per154-[:Works_For]->co34),
(per154-[:Works_For]->co99),
(per155-[:Works_For]->co62),
(pres19-[:Presented_By]->per154),
(pres19-[:Presented_By]->per155),
(pres19-[:Is_In_Room]->rm8),
(pres19-[:Is_Presentation_Type]->prest2),
(pres19-[:Is_In_Session]->ses10),
(pres19-[:Is_Category_Type]->presct2),
(pres19-[:Is_CEU_Type]->presceu5),
(pres19-[:Has_Symbol]->press3)

Clearing out the data.

With the sample data load finished, let us clear the data out to prepare for the final load of data.

Clear out relationships

MATCH ()-[r]-() WITH r LIMIT 1000000 DELETE r

Clear out nodes

MATCH (n) WITH n LIMIT 1000000 DELETE n

Create & load database. (1,727 rows)

This creation file is too big to display here, but you may look at the entire file here.

Results: Added 663 labels, created 663 nodes, set 6213 properties, created 1064 relationships.


Attend Your Favorite Presentation Category

Suppose you are crazy about Livestock. Perhaps you make your living with Livestock. Here is how we can make sure we are aware of try to attend all the Presentations with a Category Type of "Livestock".

MATCH (p:Presentation)-[:Is_Category_Type]->(c:CategoryType {name:'Livestock'}),
      (p)-[:Is_In_Session]->(s:Session),
      (p)-[:Is_In_Room]->(r:Room)
RETURN c.name AS CategoryType, p.name as PresentationName, s.Name as Session, r.Name as Room

Where’s the BEEF?

MATCH (p:Presentation)-[:Is_Category_Type]->(c:CategoryType {name:'Livestock'})
RETURN p, c

Attend Your Favorite Author/Presenter/Friend

Imagine sitting through your first session at a Conference, and the speaker is so good, you want to make sure you attend all of their workshops and sessions. That is, if they’re even doing more than one! You frantically skim through the conference workbook, trying to read the speakers' names listed at the bottom of every Presentation description. A tedious and error prone process. Here is a simple query in Neo4j:

MATCH (pr:Presentation)-[:Presented_By]->(p:Person {name:'John Jeavons'}),
      (pr)-[:Is_In_Session]->(s:Session),
      (pr)-[:Is_In_Room]->(r:Room)
RETURN p.name as PersonName, pr.name as PresentationName, s.Name as Session, r.Name as Room
Qe3rWF7

Which Speakers Never Shut Up?

Just kidding! (I hear the secret is to wear comfortable shoes!)
Which speakers at the conference have to stand up the most because they are giving the most Presentations? Are they Conference Royalty, or are these the thought leaders in your industry? You have decided to review their Presentations for your schedule.

This query returns Persons that are giving 3 or more Presentations at the Conference. We will also return the Company Name they work for, and concatenate the names if they work for multiple Companies.

//Which presenters have the most presentations (TABLE)
MATCH (pr:Presentation)-[:Presented_By]->(p:Person)
WITH p, COUNT(*) as Count
WHERE Count > 2
MATCH (p)-[Works_For]->(c:Company)
WITH p, COLLECT(c) as Companies, Count
RETURN p.name as Name, Extract(c in Companies | c.name) as `Company Names`, Count
ORDER BY Count Desc
MATCH (:Presentation)-[:Presented_By]->(p:Person)
WITH p,  COUNT(*) as Count
WHERE Count > 2
MATCH (pr:Presentation)-[Presented_By]->(p)-[:Works_For]->(c:Company)
RETURN pr, p, c

I didn’t know my neighbor was here!

There’s nothing quite like traveling hundreds of miles just to meet someone you live in the same town with! Suddenly your industry or niche isn’t as small as you thought it was. Discovering vendors, companies, and presenters from your neck of the woods can create a wonderful, future opportunity for both you.

MATCH (c:Company)
WITH c.city as NCity, c.state as NState, COUNT(*) AS Count
RETURN
   CASE NCity
     WHEN "" THEN "No City Listed"
     ELSE NCity
   END as City,
   CASE NState
      WHEN "" THEN "No State Listed"
      ELSE NState
   END as State, Count
ORDER BY Count DESC

Conclusion

Graph Databases allow for unique opportunities to view your data.

Future work for this "Exploring A Conference" dataset will include breaking out City/State data into their own Nodes. This will allow more interesting traversal in the graph, and would allow for adding a good insertion point to connect outside data to. For instance, Longitude & Latitude values would allow for distance caculations against the user (How far away is this vendor from me?), or against conference location (Who traveled the farthest?)

Categories could be applied to Companies, which could allow users to filter for their specific needs or interests. Did they also have a booth at the conference? Then you could target your booth visits.