07.29.06

Simple pleasures

Posted in personal at 6:58 pm by wingerz

  • Bike ride along the river
  • Pinocchio’s steak & cheese sub
  • Eating outside
  • Playing Ultimate barefoot
  • Sitting in the shade, feeling the breeze
  • Cherry Slurpee for the walk home

All in the course of two hours.

07.28.06

Students everywhere

Posted in community at 11:39 pm by wingerz

Through my work with Boston Latin Academy, our office’s partner school, I’ve gotten to know Cathleen, our regional corporate community relations program manager. A few weeks ago she told me that there was an opportunity to speak to some high school students, so I decided to do it. It turned out to be the Research Science Institute (RSI) summer program at MIT, which puts 75 rising high school seniors into a six-week research internship. I found out that one of my college friends actually participated in the program.

I had dinner with a handful of students and the director of the program and talked for an hour about software engineering, Adtech, the Semantic Web, and the process of learning to program. It was quite fun until I realized that I was 10 years older than the students. High school is now officially A Long Time Ago.

Our summer internships are starting to wrap up as well. We have about a week and a half until our demos are to be shown. Queso is coming along. I’ve been spending a good amount of time working, which explains the recent lack of posting on my blog.

As I was lining up for the Chinatown bus to come back from New York last weekend, I saw the young lady in front of me holding a Cambridge IBM printout cover sheet. Turns out that her boyfriend is working upstairs with CUE for the summer and is going to MIT in the fall. He’s actually going to be joining the Simile group, which does Semantic Web research. It’s a small world.

Whole Foods Night

Posted in food, home cooking at 11:07 pm by wingerz

Once in a while, Jen and I like to do a “Whole Foods Night” – we’ll pick a few recipes and adopt a temporary spare-no-expense attitude towards food shopping at the pricey organic grocery store. Our most notable previous purchase was a (very small) $10 bag of fleur de sel – the most expensive salt I’ve ever used (a few grains were used to enhance the flavor of some home-made toffee).

A few weeks ago we made the following (for 8 people):

  • Popovers: In theory, very fluffy bread; in practice (at least this time), dense, eggy bread.
  • Shrimp and Avocado Salad: Red leaf lettuce and watercress tossed with a citrus dressing, topped with orange slices, steamed shrimp, and avocado slices.
  • Roasted Yukon Gold Potatoes: Roasted potatoes with olive oil, kosher salt, and pepper. Simple and delicious.
  • Filet Mignon with Bordelaise Sauce: Seared (and cooked the rest of the way in the oven) filet mignon topped with a rich brown sauce. Main sauce ingredients: small slices of bone marrow (which kind of melt in your mouth), shallots, red wine, and veal demi-glace (an absurdly expensive sauce base).
  • Apple Pie with Vanilla Ice Cream: We didn’t make the pie. It was from Petsi’s.

All in all, a very good meal. Getting the bone marrow out of the bone was a pain. Cooking with demi-glace was a first. Unfortunately, I don’t know what bordelaise sauce is supposed to taste like so I don’t know if I did a good job of replicating it.

Thunderstorm

Posted in weather at 10:43 pm by wingerz

It was a bit windy and cloudy when I left work today. I stopped by the grocery store, and when I came out the western sky was full of ominous dark grey clouds. It was drizzling lightly. A minute later, it started pouring, with the rain coming down so forcefully that the windshield wipers had trouble keeping the view clear. Flashes of lightning lit up the darkened sky. Powerful. Awesome. Spectacular. And quite refreshing, dropping the temperature from an uncomfortable, humid 90 to a pleasant 74.

07.19.06

A Queso Example

Posted in development, semantic web, web at 11:17 pm by wingerz

I received an email from a friend who wanted to learn more about my work. He is not that familiar with the Semantic Web, and I tweaked my reply to him because it does a decent job of explaining what Queso does. Pre-reading: Queso introduction, RDFa in Queso.

Core technologies, in order of appearance:

  • RDF – Resource Description Framework – representing data in subject-predicate-object triples, heart and soul of the Semantic Web
  • Atom – most widely known as a feed format, also for publishing content
  • JSON – Javascript Object Notation – representing objects as strings that can be eval’ed in Javascript (there are also libraries for parsing JSON in other languages) – takes the pain out of parsing responses on the client
  • XHTML – HTML as XML, which means that you can’t have open tags, (p, I’m looking at you), attribute values must have quotation marks around them, etc.
  • RDFa – a standard for embedding RDF in XHTML
  • SPARQL – SPARQL Protocol and RDF Query Language – I like it even more because 1) it’s a recursive acronym and 2) Elias and Lee are on the working group.
  • Microtemplates – templates for HTML – bind Javascript objects to them to display your data

Our high-level goal this summer is to put a web front-end onto Boca, our RDF store. Most of our group’s work over the past few years has focused on building infrastructure to support the Semantic Web. Our UI work has primarily involved creating libraries for RCP-based applications, but we’ve always known that making things web-accessible is important.

In Queso, we want to store both data and XHTML/Javascript application code. We want web application designers to be able to dump their (potentially structured) data into the system, which stores everything as RDF triples. SPARQL provides an easy, standardized way to query for data in a flexible, precise manner. The data in the system can be easily extracted and repurposed for use in other applications, such as mash-ups. The following is a simple example where I’ve tried to improve readability by leaving out namespaces and base URIs. Don’t follow this as a copy-and-paste tutorial.

There’s a site called mywikimap that shows local gas prices on a Google Map. If you wanted to store data for an application like this using Queso, you could post Atom entries of the following format as XHTML:

<div about="[queso:thisEntry]">
	price: 		<span property="price">2.95</span>
	latitude: 	<span property="latitude">7</span>
	longitude: 	<span property="longitude">9</span>
	time found: 	<span property="time">2006-07-19T10:27:00</span>
</div>

While this will display in a (somewhat ugly) human readable form, it is also valid RDFa, so Queso extracts RDF triples from it (semicolon at the end of the line just means that the following triple has the same subject):


_:gasEntry  "2.95" ;
   "7" ;
   "9" ;
  

These triples will be stored along with the triples that represent the Atom entry. Now you can query them using SPARQL, with the following query (which restricts the results to entries from July 17 or later located in a certain area):


select ?price ?lat ?lon ?time
where {
  ?entry  ?price ;
     ?lat ;
     ?lon ;
    

What’s more, you can get this back as a JSON object that looks something like this (according to this standard):


{ price : "2.95", lat : "7" ... }

Then you can eval it in Javascript (in the real world you’d do some checking on it before eval’ing it):


var gasEntry = eval(jsonResult);
var str = "Price: " + gasEntry.price 
  + ", latitude: " + gasEntry.lat 
  + ", longitude: " + gasEntry.lon;

Rather than constructing a string on the client via string concatentation, we can use microtemplates to display the data. An example template (Note that the names of the classes match the names of the variables in the SPARQL query above):

<div id="gastemplate">
	price: <span class="price"></span>
	latitude: <span class="lat"></span>
	longitude: <span class="lon"></span>
	time found: <span class="time"></span>
</div>

In Javascript, the data can be bound to the template with the following line:


new IBM.ET4A.Template("gastemplate").bind(entry);

And now the div will show up with data values filled in.

So what’s so great about all of this? We didn’t have to deal with anything database related, like setting up tables and writing SQL code for inserting data into the system or querying. If we wanted to add additional data (say, the gas station name, the street address, etc.), we could encode additional triples very easily. We also didn’t have to write a web API to expose our data to the world. On the client, we didn’t have to parse any XML or RDF in Javascript. Anyone can use the data, either for its originally intended purpose (display on a Google Map) or something else (trend analysis across time and location or something more interesting).

Now that we’ve got the data set up, we move on to application development. In this (simple) case, one would develop the XHTML and Javascript files (including our libraries for Atom publishing and SPARQL querying) necessary for a web UI for this application and upload them to Queso. They would be posted to Queso as Atom entries containing the appropriate content types. And that’s it for application deployment – pointing your web browser to the appropriate URL would give you the content as XHTML. These files can also contain some RDFa markup so that additional metadata about the application can be stored. This would give us a server application registry for free via a SPARQL query for everything on the system that is of type application. For more complex applications we can set up traditional web frameworks and have them interact with Queso on behalf of a client.

Of course, there are a lot of problems as well. We haven’t looked much at security, though our store has built-in access control. We’re looking into how to make this as scalable as possible, and the thought of having an open SPARQL endpoint is frightening. But for now we hope that this can serve as a sandbox for people to experiment with RDF, Atom, RDFa, and SPARQL.

07.18.06

Space Invaders with human pixels

Posted in amusing, games at 1:11 am by wingerz

http://www.notsonoisy.com/spaceinvaders/

Kind of mesmerizing. Watch the movie.

Atom/XHTML/RDFa in Queso

Posted in development, semantic web, web at 12:03 am by wingerz

Elias posted about Queso, our summer project that mixes the Web2.0 (REST-ful URLs, JSON, some nice Ajax-y UI libraries) and Semantic Web (data stored as RDF, queryable via SPARQL) worlds.

Content is inserted into the system is by posting Atom entries. The entries are stored as RDF (converted via Atom OWL by Henry Story), so their content and metadata is accessible via SPARQL queries. Because Atom relies on both an ID and a timestamp to establish the uniqueness of an entry, the ID cannot be used as the resource that serves as the subject of statements describing the particular Atom entry. Instead we use a blank node that has and http://www.w3.org/2005/10/23/Atom#updated> properties. All of the triples for a particular Atom id are stored in a named graph that has this id as its name.

Of course, we might want to store some additional RDF triples in addition to the ones that represent the Atom entry. For this we use RDFa which gives us a means of embedding RDF triples in XHTML. Using RDFa is one way to transition from the current web towards a more semantic web.

If the Atom entry is posted with the content type set to “xhtml”, Queso will run an RDFa parser on the content, extracting any embedded triples and storing them along with the triples for the entry (in the same named graph). For example, posting the following as content type “xhtml” (if you are posting with the ATOMbrowser, leave off the enclosing divs):


Wing Yung

will result in the following triples being added to the store:


_:thisEntry a Person ;
	  .
	  .
	 "Wing Yung"^^

along with other triples describing the author, title, content, summary, etc. of the Atom entry:


_:thisEntry a ;
	  .
	 "2006-08-25T23:22:00.995Z^^ .
	...

Note that we use in the XHTML as a magic resource that gets replaced by the blank node that represents this particular Atom entry.

Once the content has been posted it can be accessed in several ways. The first one is the ATOMbrowser. Navigate to the appropriate collection (“wingerz”) and entry (“RDFa test”). The content and other attributes are viewable in the right-most column. Grabbing id (urn:lsid:abdera.watson.ibm.com:entries:397859049), we can visit the entry’s content, which is output as XHTML.

Finally, if you go to the SPARQL browser, you can query the store for the triples. Click the “Graphs” tab and add the id (urn:lsid:abdera.watson.ibm.com:entries:397859049). Uncheck the introspection document and click back over to the “Query” tab. Run the default query (which brings back all of the triples in this named graph). For less data try the following query instead:


SELECT ?person ?blog ?pic
WHERE {graph ?g {
    ?person a  ;
       ?blog ;
       ?pic .
  }
} 

And of course, if you hit the SPARQL endpoint, preferably with Lee‘s SPARQL Javascript library, you can request your output in JSON format so that your client never has to parse RDF or Atom.

So what good is this? We hope to serve both data (content as Atom and RDF) and applications (content as Javascript and XHTML) off the server. Application deployment should be trivial. Semantic Web-aware developers can easily create, remove, update, and delete data, speeding up development time. And because everything is accessible through SPARQL, others can use the data or combine data from different applications in interesting ways.

See also:
Ben‘s entry about posting Atom entries using Abdera.

07.16.06

Worst URLs

Posted in amusing at 10:00 am by wingerz

Courtesy of Rob, who clearly needs a blog to publish stuff like this:

http://independentsources.com/2006/07/12/worst-company-urls/

07.12.06

Game night

Posted in games at 1:04 am by wingerz

Games played tonight:

We had four DS’s. MKDS is really nice in that people with and without the cartridge can play the same game. I’m inching closer to my dream of having an 8-player Mario Kart race (or a 10-player Tetris game), especially if I can get Jen and my sister to come next time (who will bring the total to 6). This is the best version of Mario Kart, even if I can’t beat anyone at it.

Busted out the Dreamcast for the first time in several years because it’s the only console I have that has VGA out (and therefore could be played on the projector). I missed my partner in Soul Calibur crime, crv. I can’t believe the Dreamcast was out five years ago because it still looks great. Hoping to hunt down a copy of Power Stone 2, since my copy got stolen (along with all my other games) several years ago.

I didn’t get around to playing any of the strategy games but somehow ended up giving San Juan advice despite only having played it a handful of times. I think Lee blamed his loss on me. Besides that it was a very good night.

07.09.06

Games update

Posted in games, soccer, sports, world cup at 9:33 pm by wingerz

The World Cup is over. It has been a fun month of watching soccer. Today’s game was quite exciting. How different things would have been had Zidane headed that ball into the corner instead of directly at Buffon (who made an awesome save). Instead, his vicious headbutt got him thrown out and cost his team a better shot at winning the game during penalty kicks. I wasn’t really rooting for anyone (maybe just a bit for Italy), but it was sad to see him leave the World Cup stage like that. Now that the World Cup is over, I may cancel the cable again (and revert to the basic channels).

A few nights ago after work, Ben, Alex, and I kicked a soccer ball around a bit. Brought back some good memories of youth league soccer.

I paid off my last mortgage in Animal Crossing. I didn’t get anything for it and am a bit disappointed. On the flip side, I have collected lots of interesting beetles and a hammerhead shark. Jen discovered that part of the game involves interior design, so she spent two hours redecorating my house.

I have become re-addicted to online Tetris DS. Jen and I played our first online matches this past week.

I picked up Drill Dozer from Best Buy because it was on sale for $10. Your primary weapon is a drill, which is used to defeat enemies, drill through obstacles, and interact with other game elements. The game has a built in rumble-pack which shakes as you activate the drill, which is a nice touch.

Played San Juan, a strategy card game that Jess and Cy love, for the first time yesterday. It was quite fun. Basically you build up a town out of different types of buildings that contribute to your point total and give you special privileges once you build them. For better or worse, I have an unhealthy (and irrational) obsession with the “Black Market” card.

Going to the Red Sox-A’s game on Thursday!

« Previous entries Next Page » Next Page »