This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
neo4j-meetup.core> (take 1 (map (fn [x] (println (str "printing..." x))) (range))) | |
(printing...0 | |
printing...1 | |
printing...2 | |
printing...3 | |
printing...4 | |
printing...5 | |
printing...6 | |
printing...7 | |
printing...8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn offsets [perpage] | |
(map #(* perpage %) (range))) | |
(defn events | |
[{perpage :perpage offset :offset orderby :orderby}] | |
(->> (client/get | |
(str "https://api.meetup.com/2/events?page=" perpage | |
"&offset=" offset | |
"&orderby=" orderby | |
"&status=upcoming,past&" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MATCH (meetup)-[:INITIALLY_RSVPD]->(rsvp1 {response: "yes"})-[:NEXT]->(rsvp2 {response: "no"})-[:TO]->(event) | |
MATCH (event)-[:HAPPENED_ON]->(ed1)<-[:HAS_DAY]-(em1)<-[:HAS_MONTH]-(ey1) | |
MATCH (rsvp1)-[:HAPPENED_ON]->(d1)<-[:HAS_DAY]-(m1)<-[:HAS_MONTH]-(y1) | |
MATCH (rsvp2)-[:HAPPENED_ON]->(d2)<-[:HAS_DAY]-(m2)<-[:HAS_MONTH]-(y2) | |
MATCH path = (d2)<-[:NEXT*]-(d1) | |
RETURN meetup.name, | |
event.name, | |
ed1.day + "/" + em1.month + "/" + ey1.year AS eventDate, | |
d1.day + "/" + m1.month + "/" + y1.year AS initialYes, | |
d2.day + "/" + m2.month + "/" + y2.year AS changedToNo, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
= Rounding a float value to decimal places | |
:neo4j-version: 2.1.0-RC1 | |
:author: Mark Needham | |
:twitter: @markhneedham | |
Every now and then I find myself dealing with float values such as the following: | |
[source,cypher] | |
---- | |
RETURN toFloat("12.336666") AS value |
This GraphGist answers a Stackoverflow question.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(Rneo4j) | |
library(ggplot2) | |
graph = startGraph("http://localhost:7474/db/data/") | |
query = "MATCH (group1:Group), (group2:Group) | |
WHERE group1 <> group2 | |
OPTIONAL MATCH path = (group1)<-[:MEMBER_OF]-()-[:MEMBER_OF]->(group2) | |
WITH group1, group2, COLLECT(path) AS paths |
Answer to this Stackoverflow Question
OlderNewer