Skip to content

Instantly share code, notes, and snippets.

@shivswami
shivswami / gist:7783422
Last active December 30, 2015 05:29
Test101
//console
[source,cypher]
----
CREATE (n{name:'cypher'})-[r:LIKES]->({name:'icecream'})
RETURN n.name, r
----
//output

Shiv’s First Graph Gist - Copy of Peter’s Simple gist.

CREATE (n{name:'India'})-[r:LIKES]->({name:'Spicy Food'}) return n.name, r

Harry Potter

harry

Welcome to the wonderful world of Harry Potter!

v0 of this graph models some of Harrys friends, enemies and their parents. Also have some pets and a few killings. The obvious relation missing is the one between Harry Potter and Voldemort- it took us 7 books to figure that one out, so you’ll have to wait till I add more data :-)

The model

Movie Database

Our example graph consists of movies with title and year and actors with a name. Actors have ACTS_IN relationships to movies, which represents the role they played. This relationship also has a role attribute.

cineasts

We’ll go with three movies and three actors:

@shivswami
shivswami / Mahabharata.adoc
Last active December 30, 2015 08:38
The example graph consists of characters in Mahabharata - the Indian Epic.

Mahabharata

The example graph consists of characters in Mahabharata - the Indian Epic. Key nodes - Relations, Wars and their key actions

File:LUNAR DYNASTY (Chandravamsha)

We’ll go with key characters:

@shivswami
shivswami / MahabharataV1.adoc
Created December 5, 2013 10:56
The example graph consists of characters in Mahabharata - the Indian Epic.

Mahabharata

The example graph consists of characters in Mahabharata - the Indian Epic. Key nodes - Relations, Wars and their key actions

File:LUNAR DYNASTY (Chandravamsha)

We’ll go with key characters:

@shivswami
shivswami / MahabharataV4.adoc
Last active December 30, 2015 11:09
The example graph consists of characters in Mahabharata - the Indian Epic. Created by Shivprakash Swami

Mahabharata

The example graph consists of characters in Mahabharata - the Indian Epic. Key nodes - Relations, Wars and their key actions

We’ll go with key characters. There is great debate on Mahabharata genealogy, so we will stick to Wikipedia version for now http://en.wikipedia.org/wiki/Mahabharata

How to create a GraphGist

You create a GraphGist by creating a GitHub Gist in AsciiDoc and enter the URL to it in the form on this page. Alternatively, you can put an AsciiDoc document in Dropbox and enter the public URL in the form.

This GraphGist shows the basics of using AsciiDoc syntax and a few additions for GraphGists. The additions are entered as comments on their own line. They are: //console for a query console; //hide, //setup and //output to configure a query; //graph and //table to visualize queries and show a result table.

Click on the Page Source button in the menu to see the source for this GraphGist.

'gistThat@mcpher.com :do not modify this line - see ramblings.mcpher.com for details: updated on 15/10/2013 10:52:06 : from manifest:5055578 gist https://gist.github.com/brucemcpherson/3423885/raw/cRest.cls
' This is a generalized class for dealing with rest queries
Option Explicit
' v2.12
'for more about this
' http://ramblings.mcpher.com/Home/excelquirks/classeslink/data-manipulation-classes
'to contact me
' http://groups.google.com/group/excel-ramblings
'reuse of code
' http://ramblings.mcpher.com/Home/excelquirks/codeuse
Option Explicit
'for more about this
' http://ramblings.mcpher.com/Home/excelquirks/classeslink/data-manipulation-classes
'to contact me
' http://groups.google.com/group/excel-ramblings
'reuse of code
' http://ramblings.mcpher.com/Home/excelquirks/codeuse
' google rules and api documentation
' http://code.google.com/apis/patentsearch/v1/jsondevguide.html