Prior to Neo4j 3.0, if you wanted to parse the JSON results from a call to a Web API, it would require you use one of the database drivers to fetch and parse the JSON data. This is described here.
With the inclusion of stored procedures as part of Neo4j 3.0.x and the APOC procedure package, one can read the JSON data and create nodes and relationships in the graph. The following describes how this is accomplished when using the Trello API. Trello is a collaboration tool that organizes your projects into boards. In one glance, Trello shows you what’s being worked on, who’s working on what, and where something is in a process. The Trello taxonomy includes boards, lists, and cards where tasks are recorded.
When using the Trello API you must register an API key and token as they are required to access the URL. The key and token can be created here. In the example below, the generated key and token are:
And the goal of the Cypher in this example is to create a Graph Model similar to:
To produce such a data model we are going to interact with the Trello API /1/member/me/actions?filter=createCard which will return a JSON result representing the detail on when cards were created. Additionally, the inclusion of the ‘me’ value in the URL indicates to only retrieve createCards actions that I have taken.
The following Cypher will process the JSON results of the
And then one can run
This is helpful in attempting to find metrics about the author/creator of Trello cards.
The above is but one example of the Trello API and all data represented above is not actual data but representations.