Showing posts with label graph karaoke. Show all posts
Showing posts with label graph karaoke. Show all posts

Thursday, 30 November 2017

Podcast Interview with Ray Bernard, SuprFanz


The last GraphConnect conference in New York City was a true blast - sweet memories. One of the highlights for me was a visit to the SuprFanz booth at the Community Corner, where I chatted to Ray Bernard in a 360 degree recording:

Ray and I had been connected indirectly through something called "graph karaoke", which you will learn about a bit later. So, I published the above, but decided that it would be cool to have a longer chat with Ray on our podcast. So that's what we did, and here's the result:


Tuesday, 8 March 2016

The MULTILINGUAL graph database conference? GraphConnect of course!

I know you have been asking yourself the question! Where could I meet graphistas of all kinds of different creeds, nationalities, languages, etcetera? That would be GraphConnect of COURSE.

We are all getting ready, the agenda is (almost fully) set, and ... we will have Graph Karaoke there - of course!

Here's another example - in German, this time.


Hope you enjoyed it - and SEE YOU in London on April 26th!

Cheers

Rik

Wednesday, 24 February 2016

What's a graph without a laugh? Multi-lingual Graph Karaoke is HERE!

Indeed. If you follow this blog and some of my work with Neo4j a little bit, then I am hoping you know that I like to have FUN with Neo4j as well. It's actually quite amazing that you CAN in fact have fun with something as "boring" as a database - but hey, I really think you can.

I have been doing Graph Karaoke for a long time (I still blame Nigel) - and that has been a ton of fun along the way. Over the years, I gathered quite a playlist:
And now with GraphConnect Europe coming up in April, I felt like we would really need some more songs to spice up the conference. But: being in Europe - WHY would we limit ourselves to boring ENGLISH songs all the time. So I figured, there has to be a way to do Graph Karaoke in a multi-lingual way. And that's what I will be doing in the next few months - and today is the first episode in "MultiLingual Graph Karaoke".

Google Sheets to the rescue!

We'll start with a nice little Dutch song that I really like, by the world-famous (!) group "Doe Maar!". The song is "Dansmuziek", and has a lovely vibe to it, I think.

I grabbed the lyrics online, and put it in a google spreadsheet. It looks like this:
As you can see (access the sheet yourself over here), I have one column in there with the lyrics in the original, Dutch language, but I also have a couple of other columns that are automatically translated into English, German and French using the Googletranslate function of Google Sheets. I simply do:

=GOOGLETRANSLATE(C2,"nl","en")
=GOOGLETRANSLATE(C2,"nl","fr")
=GOOGLETRANSLATE(C2,"nl","de")


and these lyrics get automatically translated into the other languages. Obviously the translations will not be perfect, but hey, at least you get to do multi-lingual graph karaoke then! Yey!

Once I have this, I can download the spreadsheet as a CSV file, and then I can start working with it in Cypher. I have created an Import gist on Github - so you can basically run it yourself and import the graph at your own convenience.

Creating the Karaoke video

Once we have that, it's child's play to actually create the Karaoke video. A few very simple queries suffice:

match (w:Dutch {seq:1})
return w;




to find a sentence in a specific language. Or

match (w {seq:1})
return w;



to find a sentence in any language. And then finally also a "tabular" representation that would be easy to read:

match (w {seq:4})
where not ("SongSentence"in labels(w))
return w.seq as Sequence, labels(w) as Language, collect(w.name) as Sentence
order by Language[0]


All of that then brings me to the following - slightly stupid, I agree - slightly wonderful result:


That's it! I plan make a few more of these before GraphConnect, and publish them here as well. If you have any "song requests" in your own language, then PLEASE let me know.

Cheers

Rik

Wednesday, 14 October 2015

Stockholm meetup got a bit out of hand

Tonight we had a lovely meetup in lovely Stockholm at our friends of HiQ. They have a wonderful office and event area overlooking downtown Stockholm, a perfect setting to sit back and talk graphs. So we did. My friend and colleague David Montag did a wonderful talk, and I tried to tell people how to really NOT mess up their Neo4j project. The presentation is over here:

But somewhere along the way, I also started talking about my lack of a social life (so sad!!!) and the fact that I have a bit of fun with graph karaoke. I know - it's stupid. But so about half an hour before my talk, someone says "Can you do that for "Roxanne"?" ... and I am like - being a big Police fan and all - alright, Challenge Accepted.

So here's what I did:
  • I grabbed the lyrics from AZLyrics
  • I put it into this google sheet.
  • I made the google sheet available to the public (important).
  • I downloaded that sheet as a CSV file, and grabbed the URL from my downloads folder.
  • and then ran this cypher query over it:
 load csv with headers from "https://docs.google.com/a/neotechnology.com/spreadsheets/d/1WK-AKp-KNegaQ5-hbS79wvaNEj_SDj971iCuX9GMDSo/export?format=csv&id=1WK-AKp-KNegaQ5-hbS79wvaNEj_SDj971iCuX9GMDSo&gid=0" as csv  
 with csv.Sequence as seq, csv.Songsentence as row  
 unwind row as text  
 with seq, reduce(t=tolower(text), delim in [",",".","!","?",'"',":",";","'","-"] | replace(t,delim,"")) as normalized  
 with seq, [w in split(normalized," ") | trim(w)] as words  
 unwind range(0,size(words)-2) as idx  
 MERGE (w1:Word {name:words[idx], seq:toInt(seq)})  
 MERGE (w2:Word {name:words[idx+1], seq:toInt(seq)})  
 MERGE (w1)-[r:NEXT {seq:toInt(seq)}]->(w2)  

And that's it. Graph is ready. Next I find the song in Spotify, play it a few times to rehearse, and then we get this:



So there you go. I hope you enjoyed it as much as I did. And don't forget to register for GraphConnect next week!!!

Cheers

Rik

Friday, 9 October 2015

Graph Karaoke for the weekend: Return to the Moon

I have always been a fan of The National, and when Matt Berninger embarked on a new band thingy, I of course had to check it out. Now this song has been in my head all week - so I mad a little "graph karaoke" for you guys - hope you enjoy!


See you at GraphConnect for some more of this stuff?

Rik

Saturday, 4 July 2015

AC/DC is on Spotify - need to celebrate with Graph Karaoke!

As reported this week in the mediaAC/DC is now available on different streaming sites. Finally. So we need to celebrate that with some GRAPH KARAOKE of course. Here's one of my all time favourite songs:



Hope you play it LOUD and on REPEAT :))

Cheers

Rik

Friday, 27 March 2015

Graph Karaoke: Dancing in the Dark

After having done the "Ignite" talk yesterday at the Data Innovation Summit, The Boss kept ringing in my head. What better way to keep it there if not for some Graph Karaoke. Here it goes:


Hope you liked it.

Cheers

Rik

Friday, 27 February 2015

GET INTO the GRAPH

It's that time again. That Karaoke time. After having had the King of Pop, The Boss, and many other celebrities, it was time for the Queen of Pop. I chose this song, just to GET YOU INTO THE GRAPH. Seemed appropriate. Here goes:


Hope you enjoyed it.

Rik

Friday, 6 February 2015

Graph Karaoke - prepping for a big party!

Don't know if you know this, but in a few months from now, we are going to have the biggest Graph Party in Europe this year. GraphConnect is *ON* in London on May 7th, and you should all register. There will be talks, trainings, tracks by users, community contributors, briefings - and above all, LOTS OF FUN. Which is why I thought I would share a video that I recently saw with an entire TV studio just boasting lots of FUN:

This is, of course a WONDERFUL song, and there's "a capella" versions of it too, but of course I had to prepare a Graph Karaoke version of it too. Hoping to share that one with all the folks coming to London in May.


Hope you enjoyed that one. Play it LOUD!!!

Cheers

Rik

Monday, 12 January 2015

Graph Karaoke using "Natural Language Analytics": Billie Jean

Last week, my friend and colleague Michael wrote a really interesting blogpost on natural language analytics using Neo4j. He used the One Ring poem as an example of how you could use Cypher to analyse a text file and put it into a Neo4j database for some advanced analytics. That immediately made me think about my Graph Karaoke Playlist, and how I could use this technique for some more Graph Karaoke generation. Wouldn't that be nice? More graph karaoke == good!

So in this post I will show you how easy it is to get this done. A couple of quick steps is all what is needed. Let's run through it and show you how it's done.

Loading a song

The first thing to do, as always, was picking a song. So this time, my kids picked it:
Billie Jean, by the King of Pop himself. Not wanting to sound pretentious, but I think it's great for my kids to big fans of that kind of music - seems like all of our educational efforts are yielding some results :) ...

Then I picked up the lyrics of the song over here, and put it into a google doc. The reason why, is that I wanted to do one small manipulation to the file in order to be able to use it for Karaoke: I added the Songpart and the Songpartsentence in two additional columns. Plus: the Google sheet has a very easy conversion into a csv file that we can then point the Load CSV process to.

Customizing the query

With that CSV file available, I then proceeded to customize Michael's query. Here it is:

 //create the karaoke graph  
 load csv with headers from "https://docs.google.com/a/neotechnology.com/spreadsheets/d/1DLu2bl1ZO7Zm8zU1UXNCDZGxsnBkicAJD4J-FSbVXLE/export?format=csv&id=1DLu2bl1ZO7Zm8zU1UXNCDZGxsnBkicAJD4J-FSbVXLE&gid=0" as csv  
 with csv.Songpart as songpart, csv.Songpartsentence as songpartsentence, csv.Songsentence as row  
 unwind row as text  
 with songpart, songpartsentence, reduce(t=tolower(text), delim in [",",".","!","?",'"',":",";","'","-"] | replace(t,delim,"")) as normalized  
 with songpart, songpartsentence, [w in split(normalized," ") | trim(w)] as words  
 unwind range(0,size(words)-2) as idx  
 MERGE (w1:Word {name:words[idx]})  
 MERGE (w2:Word {name:words[idx+1]})  
 MERGE (w1)-[r:NEXT {songpart:toInt(songpart), songpartsentence:toInt(songpartsentence)}]->(w2)  
  ON CREATE SET r.count = 1 ON MATCH SET r.count = r.count +1  

Let's run through this query to make it easier for you to digest. We start with the "load csv" statement. We point to the csv download link mentioned above, user the first row as headers and identify that with an identifier called "csv".
 load csv with headers from "https://docs.google.com/a/neotechnology.com/spreadsheets/d/1DLu2bl1ZO7Zm8zU1UXNCDZGxsnBkicAJD4J-FSbVXLE/export?format=csv&id=1DLu2bl1ZO7Zm8zU1UXNCDZGxsnBkicAJD4J-FSbVXLE&gid=0" as csv  

Then we pull the csv into three different sets that we can address separately with separate identifiers:
 with csv.Songpart as songpart, csv.Songpartsentence as songpartsentence, csv.Songsentence as row   

Then we use the Cypher "unwind" operator to create separate rows out of the "row" collection, and call these rows containing lyrics "text". 
 unwind row as text  

Afterwards, we are gong to be using "reduce" to remove punctuation marks and then split the text into individual lyrical words:
 with songpart, songpartsentence, reduce(t=tolower(text), delim in [",",".","!","?",'"',":",";","'","-"] | replace(t,delim,"")) as normalized  
 with songpart, songpartsentence, [w in split(normalized," ") | trim(w)] as words  

Lastly, we want to write these words into the graph. In order to do that, we are going to use "unwind" to generate an in-memory index, and then stepping through every sentence to generate the sequences. We do that with "Merge", first for the words, and then for the relationships. On every relationship, we will "karaoke-ize" the graph by assigning "songpart" and "songpartsentence" identifiers to every relationship.
 UNWIND range(0,size(words)-2) as idx  
 MERGE (w1:Word {name:words[idx]})  
 MERGE (w2:Word {name:words[idx+1]})  
 MERGE (w1)-[r:NEXT {songpart:toInt(songpart), songpartsentence:toInt(songpartsentence)}]->(w2)  
  ON CREATE SET r.count = 1 ON MATCH SET r.count = r.count +1  

That was easy!

So where is the KARAOKE???

Hah! That's what you came here for huh? Well, here's the result. 

I have put the queries on a gist so that you can take a look at it yourself. If you have any comments, then please let me know!

Cheers

Rik

Friday, 5 December 2014

Always look at the bright side of life!

A life lesson AND a great way to have fun together with one of the nicest colleagues: Nigel. He got me going on the Graph Karaoke thing, and now gave me another idea for a song that had to be sung, so he deserves the credit, and a picture:
As you can see, Nigel is a big fan of Karaoke, and his mission in life is to make you smile. He can't stop. It's amazing. Such a hero. And yesterday he was talking to me about how great it would be to have a Monty Python song in the Graph Karaoke playlist - so here we are:

Hihi. I guess I don't have a social life - and most definitely not when locked into a hotel room far away from home. 

Hope you enjoy it.

Rik

Thursday, 23 October 2014

Graph Karaoke!

Now that GraphConnect is almost behind us, I can finally talk about and publish the playlist that I have been compiling of songs that I have loaded in Neo4j.
Thanks to Nigel Small for the creative ideas along the way - onto many more musical discoveries!!!

Cheers

Rik