Wikipedia data extraction and The Simpsons

Simpsons Family Picture

Illustration of The Simpsons family

While starting to scratch the surface of the SPARQL and big data possibilities I found an interesting article on how to dig out of Wikipedia the chalkboard gags (the sentences that Bart writes as punishment in the opening sequence of each episode) on Bob DuCharme’s weblog. So I adapted the original query,  created in a 2007 to download every series and to retrieve the coach gags as well (very important).

Since my knowledge is limited, I randomly updated the code until I was able to get the result I wanted (download the full dataset). The code is not at all optimized as it returns a lot of duplicates rows and have the feeling I got the intended results by chance, still now I have achieved two main targets: a) steps on learning SPARQL, b) life long dream 🙂

The code:

SELECT distinct * WHERE
{
?episodeNo 
<http://dbpedia.org/resource/Category:The_Simpsons> .
?episode dbpedia2:blackboard ?chalkboard_gag .
?episode dbpedia2:couchGag ?couchGag .
}

So, here a sample of my hard work:

Chalkboard gag Couch gag
Wedgies are unhealthy for children and other living things The Simpsons are a family of sea monkeys and swim to a couch made of clam shells to stare at an open treasure chest.
The nurse is not dealing The Simpsons swim to the couch in deep-sea diving gear. The camera zooms out to reveal that the living room is in a fish bowl.
I am not the acting President. Maggie is on the couch. The rest of the Simpsons waddle in dressed as Teletubbies and Maggie applauds with delight.
The hamster did not have a ‘full life’ A Sigmund Freud-esque psychiatrist sits on a chair and Homer leaps onto the couch and sobs about going crazy while the rest of the family looks confused.
I will not surprise the incontinent. The family jumps towards the couch. In mid-leap, the picture freezes and turns 180 degrees, in a Bullet Time fashion. It then unfreezes, and the Simpsons drop onto the couch.
Temptation Island was not a sleazy piece of crap The Simpsons are black belts in karate. They use their hands to chop up the couch while Homer does an elaborate flip and switches on the TV with his remote.
Network TV is not dead The Simpsons are placed on the couch by the pneumatic transport tubes used on Futurama. Philip J. Fry is on the couch for a split second before the rest of the family looks at him in confusion; he is sucked up and replaced by Bart.
Sherri does not ‘got back’ A parody of a scene from the film Dr. Strangelove; the Simpsons straddle the couch as it drops from a bomb bay door towards the ground.
Genetics is not an excuse A cement truck pours out concrete statues of the Simpson family. The head of Homer’s statue breaks off and falls at his feet.
Grammar is not a time of waste. The Simpsons sit on the couch as normal. A crash bar lowers onto their laps and the couch takes the family on a wild rollercoaster ride.
Fridays are not really ‘pants optional’. The crudely drawn Simpsons family from the Tracey Ullman Show shorts are on the couch. The Simpsons come in. All ten of them scream and run away.
The Giving Tree is not a chump The family forms a chorus line, which turns into a large production number.
I will not ‘let the dogs out’ The Simpsons sit on the couch and the wall spins around, revealing on the other side of the wall a cackling mad scientist who looks like Vincent Price and a scared Ned Flanders who is shackled upside-down and moaning.
I was not the Sixth Beatle Marge, Bart, Lisa and Maggie successfully do skateboard tricks off a ramp and onto the couch but Homer falls off the ramp and is hit on the head by his skateboard.
Today is not Mothra’s Day The Simpsons are a family of crash test dummies that get slammed into the TV as part of the test. The Homer dummy’s head falls off from the sudden trauma.
I will only do this once a year A montage of a select few previously aired couch gags, culminating into the showbiz extravaganza couch gag from Lisa’s First Word
Vampire is not a career choice The Simpsons rushing to and sitting on the couch is animated in flipbook style, with the pages flipped by real hands.
I cannot absolve sins The family run in and slip up on banana skins.
The President did it’ is not an excuse. The Simpsons sit on the couch. Two hydraulic presses from the sides and one from above crushes the family into a cube.
Advertisements

One thought on “Wikipedia data extraction and The Simpsons

  1. Pingback: Reading Digest: Full Spectrum Fan Art Edition « Dead Homer Society

Interested? Let's discuss!

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s