• Like
Using Clojure to Marry Neo4j and Open Democracy
Upcoming SlideShare
Loading in...5
×

Using Clojure to Marry Neo4j and Open Democracy

  • 199 views
Uploaded on

A more technologically in-depth look at how we can use Clojure and Neocons to integrate with Neo4j and increase transparency in UK politics.

A more technologically in-depth look at how we can use Clojure and Neocons to integrate with Neo4j and increase transparency in UK politics.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
199
On Slideshare
0
From Embeds
0
Number of Embeds
2

Actions

Shares
Downloads
0
Comments
0
Likes
1

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Election Results with Neo4j
  • 2. Who am I? • David Simons • @SwamWithTurtles • Software Developer • … for a bespoke solutions provider Softwire (hint: we’re recruiting) • … for fun
  • 3. ACADEMIC WEBSITE CONTAINING POORLY FORMATTED DATA DATA SCRAPER (PYTHON) NEO4J REST ENDPOINT (CLOJURE)
  • 4. ring-clojure
  • 5. (let [env (str (get (System/getenv) "GRAPHENEDB_URL") "/db/data")] (defn connection-string [] (nr/connect! env))) (defn run-query [query] (connection-string) (cy/tquery query) )
  • 6. (defn wardResults [year, areaId] (run-query ( "MATCH (pa:party)<-[member_of]- (p:politician)-[r:stood_in]-> (e:election)-[held_in]->(a:area), (e:election)-[during]->(y:year) WHERE y.name="" year "" AND id(a)=" areaId " RETURN id(p), pa.name AS partyName, SUM(r.votes) AS numVotes")))
  • 7. github.com/pimterry/ national-hack-the-government-2014/
  • 8. Thanks! David Simons david.simons@softwire.com @SwamWithTurtles github.com/SwamWithTurtles