Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Ruby code to insert openbeacon tracker sightings into a neo4j graph using neography and cypher
JavaScript Ruby
Fetching latest commit...
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Sample Ruby application to read OpenBeacon RFID tracking sightings into a neo4j graph. and visualizing a RFID-Graph with Neovigator (connected donuts)

Data Model

(person {name, twitter,github})-[:HAS_TAG]->(tag {tag})

Simple with talk as relationship

tag1-[talk:TALKED {begin,end}]->tag2 # simple model

Advanced with talk as node

tag1-[:TALKED]->(talk {interval,begin,end})<-[:TALKED]-tag2
// old data (later than TIMEOUT) pushed to separate node
talk-[:PREV]->(prev {interval,begin,end})


Setup Openbeacon Tracker

  1. get openbeacon tags and reader, configure the reader via serial port to an ip network of your choice
  2. power the reader via USB or PoE and connect to your machine, make sure to set it up as the server-ip from the reader configuration
  3. put batteries in the tags and use them
  4. clone the openbeacon github repository
  5. go to openbeacon/host/services/openbeacon-tracker
  6. enter your reader as {0x457 /*=id 1111*/ , 1 /* room */, 1 /* floor */, 1 /* group */, 100 /* X */, 100 /* Y */}, in bmReaderPositions.h; run make
  7. run ./openbeacon-tracker 2>&1 | ./filter-singularsighting logs/sightings.json
  8. those json files can then be polled and inserted into the neo4j graph

Configure and Start the Neo4j Server

  1. download and unzip Neo4j server
  2. add node_auto_indexing=true and node_keys_indexable=tag,name,twitter,github,interval to /path/to/neo4j/conf/
  3. start the server with /path/to/neo4j/bin/neo4j start

Configure the data insertion

apt-get install ruby rubygems
sudo gem install bundler
bundle install

Make a people.cvs file (name,rfid-tag-id,twitteraccount):

head people.cvs
>David Peart,554,
>Marcus Ericsson,573,mericsson

Import the people

bundle exec -Ilib lib/people.rb people.csv

pull in tag data from openbeacong tracker every 20s

while [ true ]; do bundle exec -Ilib lib/parse.rb path/to/last_json; sleep 20; done

sample.json graph in Neo4j Web interface


  • bundle install
  • bundle exec rackup # neovigator webapp
  • push it to heroku and add the neo4j add-on (heroku addons:add neo4j --neo4j-version 1.8.M06)
Something went wrong with that request. Please try again.