Skip to content

Instantly share code, notes, and snippets.

@Bachstelze
Last active October 24, 2016 15:02
Show Gist options
  • Save Bachstelze/dc5124caba3b408e2fdfad0fd453b39f to your computer and use it in GitHub Desktop.
Save Bachstelze/dc5124caba3b408e2fdfad0fd453b39f to your computer and use it in GitHub Desktop.

Disc Database Schema

Introduction

This is the basic domain model for Disc. Roles and User aren’t integrated. For this checkout first: https://neo4j.com/use-cases/identity-and-access-management/

CREATE
  (init:Argument{title:'init',text:'Kalle drückt sich nur vor seiner Bachelorarbeit', ts:timestamp(), popular:'low'}),
  (foo:Argument{title:'foo',text:'Johannes liebt panierte Kürbise', ts:timestamp(), popluar:'low'}),
  (crazyShit:Hashtag{title:'crazyShit'}),
  (init)-[:rel{up:0, down:0, crushed:false}]->(foo),
  (init)-[:tag]->(crazyShit),
  (foo)-[:tag]->(crazyShit)

The Query should be bidirectional to find all nodes, because relationships are stored directional.

Match (a:Argument)--(b:Argument)
RETURN (a),(b)

Find Arguments over Hashtags

Match (h:Hashtag)--(a:Argument)
RETURN (h),(a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment