Skip to content

Instantly share code, notes, and snippets.

View peterneubauer's full-sized avatar

Peter Neubauer peterneubauer

View GitHub Profile
= Models Sports Leagues
Aravind R. Yarram <[email protected]>
v1.0, 08-Sep-2013
== Domain Model
Each *League* has multiple *Level*s like playoffs, quarter-finals etc. The levels are ordered: first is playoffs, +NEXT+ is quarter-finals, +NEXT+ is semi-finals and then the next and last one is the finals. The ordering is represented using a http://docs.neo4j.org/chunked/milestone/cookbook-linked-list.html[linked-list].
A *Player* can play for more than one team over multiple leagues but can only play for a single team in a given league. This is captured by the +PLAYED_IN_FOR_LEAGUE+ http://docs.neo4j.org/chunked/milestone/cypher-cookbook-hyperedges.html[hyperedge] between player, team and league using http://docs.neo4j.org/chunked/milestone/cypher-cookbook-hyperedges.html[hypernode] *PlayerTeamLeague* . A team can register in a new league with a different name in which case, we want to know what it was +PREVIOUSLY_KNOWN_AS+.The fact that a player had for a given team (irrespective of which league) is capture
@peterneubauer
peterneubauer / overlap.adoc
Last active December 26, 2015 05:19 — forked from s1ck/overlap.adoc
CREATE INDEX on :User(name)
CREATE (alice:User{name:'Alice'})

A Simple Meta-Data Model for a Graph Database

Setting up a Meta-Data Framework made shamelessly by Peter

This GraphGist is a quick exploration of a simple meta-data administration which can be used to store the structure of the nodes and relationships in a graph database like neo4j.

The data that is set up here could be used in an application layer to provide tailored

= Product Catalog Peter
Aravind R. Yarram <[email protected]>
v1.0, 17-Sep-2013
== Domain
A product catalog is a collection of products, their categories, manufacturers with their pricing information. Products can be sold separately, included in one or more catalogs or used as substitute products
You can perform the following operations on a product:
Create, Update, Delete (Not recommended, deactivate instead), Deactivate (We should deactivate products that are no longer available instead of deleting them, because they are included in past orders, quotes, or opportunities.), Search etc.

DocGist Example

DocGist is a tool that renders AsciiDoc documents fetched from GitHub gists or other sources. The rendering is performed in the browser using the asciidoctor.js library. The original use case for this was http://gist.neo4j.org/ which has additional features to create examples for the Neo4j graph database.

How To Use

\$`x/x={(1,if x!=0),(text{undefined},if x=0):}`\$

The test

H2

Create (a)-[:test]->(b) return a,b

Hello Graphgist

create (n{name:'Test'})-[:has]->({name:'Foo'}) return n as node;

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.

@peterneubauer
peterneubauer / OneNode
Last active December 21, 2015 20:49 — forked from quagly/OneNode
= One Node Kant
//console
query to create one node with one property
[source,cypher]
----
CREATE (n {name : 'Immanuel'})
----

Tracing bus lines with neo4j

The setup

This is a simple bus map, containing one line line1 and line2 and line3, set as a property on the connecting releationships between bus stops.