Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Graph Karaoke: The Piano has been Drinking
"The Piano Has Been Drinking (Not Me)"
The piano has been drinking, my necktie is asleep
And the combo went back to New York, the jukebox has to take a leak
And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...
And the menus are all freezing, and the light man's blind in one eye
And he can't see out of the other
And the piano-tuner's got a hearing aid, and he showed up with his mother
And the piano has been drinking, the piano has been drinking
As the bouncer is a Sumo wrestler cream-puff casper milktoast
And the owner is a mental midget with the I.Q. of a fence post
'Cause the piano has been drinking, the piano has been drinking...
And you can't find your waitress with a Geiger counter
And she hates you and your friends and you just can't get served without her
And the box-office is drooling, and the bar stools are on fire
And the newspapers were fooling, and the ash-trays have retired
'Cause the piano has been drinking, the piano has been drinking
The piano has been drinking, not me, not me, not me, not me, not me
//Graph Karaoke
//Title: The piano has been drinking (not me)
//Artist: Tom Waits
//add the song
merge (start:Instrument {name:'Piano'})-[:HAS_BEEN {sequence:1}]->(end:Activity {name:'Drinking'});
merge (start:Group {name:'Combo'})-[:WENT_BACK_TO {sequence:3}]->(end:City {name:'New York'});
merge (start:Furniture {name:'Carpet'})-[:NEEDS {sequence:5}]->(end:Activity {name:'Haircut'});
merge (start:Device {name:'Telephone'})-[:IS_OUT_OF {sequence:7}]->(end:Drug {name:'Cigarettes'});
match (start:Instrument {name:'Piano'}), (end:Activity {name:'Drinking'})
merge (start)-[:HAS_BEEN {sequence:9}]->(end);
merge (start:Document {name:'Menus'})-[:ARE {sequence:11}]->(end:Activity {name:'Freezing'});
merge (start:Person {name:'Light Man'})-[:HAS {sequence:13}]->(end:Condition {name:'Cannot see out the other eye'});
merge (start:Person {name:'Piano-tuner'})-[:HAS {sequence:14}]->(end:Device {name:'Hearing Aid'});
match (start:Instrument {name:'Piano'}), (end:Activity {name:'Drinking'})
merge (start)-[:HAS_BEEN {sequence:16}]->(end);
merge (start:Person {name:'Bouncer'})-[:IS_A {sequence:18}]->(end:Person {name:'Sumo Wrestler'});
match (start:Instrument {name:'Piano'}), (end:Activity {name:'Drinking'})
merge (start)-[:HAS_BEEN {sequence:22}]->(end);
merge (start:Person {name:'You'})-[:CANT_FIND {sequence:24}]->(end:Person {name:'Waitress'});
match (start:Person {name:'You'})
merge (start)-[:USE {sequence:25}]->(end:Device {name:'Geiger counter'});
merge (end2:Condition {name:'The IQ of a fencepost'})-[:HAS {sequence:21}]->(start:Person {name:'The Owner'})-[:IS_A {sequence:20}]->(end:Condition {name:'Mental Midget'});
match (start:Person {name:'Waitress'}),(end:Person {name:'You'})
merge (start)-[:HATES {sequence:26}]->(end);
match (start:Person {name:'Waitress'})
merge (start)-[:HATES {sequence:26}]->(end:Group {name:'Your Friends'});
merge (start:Location {name:'Box-office'})-[:IS {sequence:28}]->(end:Activity {name:'Drooling'});
merge (start:Document {name:'Newspapers'})-[:ARE {sequence:30}]->(end:Activity {name:'Fooling'});
match (start:Instrument {name:'Piano'}), (end:Activity {name:'Drinking'})
merge (start)-[:HAS_BEEN {sequence:33}]->(end);
match (start:Instrument {name:'Piano'}), (end:Activity {name:'Drinking'})
merge (start)-[:HAS_BEEN {sequence:34}]->(end);
merge (start:Garment {name:'Necktie'})-[:IS {sequence:2}]->(end:Condition {name:'Asleep'});
merge (start:Instrument {name:'Jukebox'})-[:HAS_TO {sequence:4}]->(end:Activity {name:'Take a leak'});
merge (start:Device {name:'Spotlight'})-[:LOOKS_LIKE {sequence:6}]->(end:Activity {name:'Prison break'});
merge (start:Location {name:'Balcony'})-[:IS {sequence:8}]->(end:Activity {name:'On the make'});
match (start:Instrument {name:'Piano'}), (end:Activity {name:'Drinking'})
merge (start)-[:HAS_BEEN {sequence:10}]->(end);
match (start:Person {name:'Light Man'})
merge (start)-[:IS {sequence:12}]->(end:Condition {name:'Blind in one eye'});
match (start:Person {name:'Piano-tuner'})
merge (start)-[:SHOWES_UP_WITH {sequence:15}]->(end:Person {name:'Piano-tuners mother'});
match (start:Instrument {name:'Piano'}), (end:Activity {name:'Drinking'})
merge (start)-[:HAS_BEEN {sequence:17}]->(end);
merge (start:Food {name:'Cream-Puff'})-[:CASPER {sequence:19}]->(end:Food {name:'Milk-toast'});
match (start:Instrument {name:'Piano'}), (end:Activity {name:'Drinking'})
merge (start)-[:HAS_BEEN {sequence:23}]->(end);
match (start:Person {name:'You'}), (end:Person {name:'Waitress'})
merge (start)-[:CANT_GET_SERVED_WITHOUT {sequence:27}]->(end);
merge (start:Furniture {name:'Bar Stools'})-[:ARE_ON {sequence:29}]->(end:Condition {name:'Fire'});
merge (start:Device {name:'Ash-trays'})-[:HAVE_BEEN {sequence:31}]->(end:Condition {name:'Retired'});
match (start:Instrument {name:'Piano'}), (end:Activity {name:'Drinking'})
merge (start)-[:HAS_BEEN {sequence:32}]->(end);
merge (start:Person {name:'Me'})-[:NOT {sequence:35}]->(start);
//connect the sequences
UNWIND range(1,35) AS sequence
match (n1)-[r1]->(m1), (n2)-[r2]->(m2)
where r1.sequence = sequence and r2.sequence = sequence+1
merge (m1)-[r:NEXT]->(n2)
return n1, m1,n2,m2,r;
//title and chorus
match (n)-[r {sequence:1}]->(m)
return n, r, m
limit 1
//second line
unwind range(1,34) as first_five
match (n)-[r]->(m)
where r.sequence = first_five
return n, r, m
order by r.sequence ASC
skip 1
limit 1
//third part
match (n)-[r {sequence:11}]->(m)
return n, r, m
order by r.sequence ASC
//fourth part
match (n)-[r {sequence:18}]->(m)
return n, r, m
order by r.sequence ASC
//fifth part
match (n)-[r {sequence:24}]->(m)
return n, r, m
order by r.sequence ASC
//who was NOT drinking?
match (n {name:"Me"})-[r]-(n) return type(r),n.name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.