Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the Neo4j raw data accessible via REST interface #1

Open
marcelmaatkamp opened this issue Jan 10, 2018 · 0 comments
Open

Make the Neo4j raw data accessible via REST interface #1

marcelmaatkamp opened this issue Jan 10, 2018 · 0 comments
Assignees

Comments

@marcelmaatkamp
Copy link
Owner

marcelmaatkamp commented Jan 10, 2018

Make the Neo4j raw data accessible via REST interface

Introduction

Now that version v1.0 of https://github.com/marcelmaatkamp/steemit-neo4j-data-analysis-platform is ready and having the raw data available in a Neo4j database does not make it accessible for an application and giving end-users a direct connection to Neo4j is also not an option.

This suggestion will be on how to serve the data to 'end-users' where an end-user can be a user behind a browser or an application requesting the raw data for its own analysis and display.

The REST server

The data should come from a webserver serving one or more urls. Behind those urls is a controller which will pickup the the attributes given, make a query for Neo4j and serve the resulting data in a common format like 'json'.

An example which can be used is https://spring.io/guides/gs/rest-service. Because Spring has already a build-in webserver in the form of Jetty it can thus serve the requests and with the right settings added in the application.properties and a configuration bean it can also connect to the Neo4j datastore.

The controller should define the end-points where an application can query the data.

Since v1.0 focused on authors, votes and posts, in order to get (a subsection of) the data to analyse or display in an client application the following URL's are proposed:

Single node queries

These will al return exactly one instance of an object in the database with all its fields in json format.

  • /api/v1/author/
  • /api/v1/voter/
  • /api/v1/post/

Set of nodes queries

These will return a set of results of a single node_type like posts or votes in a given timeframe

  • /api/v1/votes?start_time=<start_time,stop=<stop_time> | time=1d,1month..
  • /api/v1/posts?start_time=<start_time,stop=<stop_time> | time=1d,1month..

Search queries

  • /api/v1/match?limit=

This will return the query "MATCH (n) RETURN n LIMIT ;"

Client application

The server can also serve static HTML pages like '/index.html' On that page a client library like Keylines or d3.js can be included which fetches the data from the url endpoint '/api/v1/match?limit=1000' for example.

Expected result

The expected result will be an interactive /index.html which renders the data from Neo4j in the browser and a REST interface on /api to let client applications connect to.

Example output with d3.js would be like this:

image.png

@marcelmaatkamp marcelmaatkamp self-assigned this Jan 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant