Monday, August 9, 2010

Storing Metadata on Flickr

A Boy and His Dog, by Julie Martin
One goal we're really shooting for in this project is to have all the image metadata "live" on Flickr. But we want more than the standard metadata Flickr offers with each image (title, description, EXIF data). We want to be able to choose our own metadata schema, or use a standard like VRA Core 4 or Dublin Core. Fortunately Flickr provides the architecture for this in the form of machine tags.

Unlike typical Flickr tags, machine tags have a three part structure, with the format namespace:field=value. The namespace can be thought of as a unifier, or a common element in all images in a collection. And the field=value part is just that: you determine field and add the value.

 To provide an example of how this can work, I decided to make a quick and dirty image collection of the public art around my neighborhood in Lake Oswego, OR. So for about an hour, I rode my bike around town, took pictures of art, and scribbled each work's artist and title in a notepad. I then uploaded the images to Flickr, and "cataloged" them with machine tags (you can enter them on a Flickr image page, just like regular tags). For example, the work in the image above is called "A Boy and His Dog" by the artist Julie Martin. The machine tags look like this:

lakeoswegoart:title="A Boy and His Dog"

lakeoswegoart:artist="Julie Martin"

On the Flickr image page, you can see the tags above by clicking "show machine tags". I chose the namespace "lakeoswegoart" because it hadn't been used in Flickr (you can check here), and I wanted something unique so when I construct the API query, it's limited to Flickr images with machine tags containing the namespace "lakeoswegoart".

So the Lake Oswego public art page I made is pretty basic (here's the source code). First it uses flickr.photos.search to return a result set of images that have a machine tag with the namespace "lakeoswegoart". The thumbnail images are then displayed on the left side. When you click on a thumbnail, the image id of that thumbnail is sent off to a php script (source code), which uses flickr.photos.getInfo to get all the tags of that image. The script parses the xml response from Flickr, reformats the machine tags into a basic "field: value" display, and returns a large image with the metadata to the right side of the main page. But the point is this: everything (images, metadata) lives on Flickr. The little bit of code just pulls it all together.

There are plenty of other ways to make queries on machine tags in Flickr, and we'll cover them in this blog as the project evolves. It should be noted that machine tags are also being used in really interesting ways for semantic web purposes. The music site lastfm provides machine tags for users to tag their images of specific concerts, which are then gathered into their site (in this case the tag is likely a unique identifier in lastfm's database). Thus far we're taking a more "traditional" librarian/visual resources approach to use machine tags to catalog images. Just like with Places, Flickr has provided the infrastructure for projects like this. We (and others) just need to take advantage of it.

No comments:

Post a Comment