
About a month ago, Google made it possible for anyone searching for images to filter the results based on the license type. (See Find Creative Commons images with Image Search.)
But it was only in the last couple of days that they spelt out exactly how you can let the Google crawlers know what licenses you are making your own images available under, in a video by Peter Linsley, from Google Image Search -- which is to use RDFa.
Peter's created a great tutorial, but it's actually possible to mark-up license information even more simply than he shows in his video.
Introduction
The tutorial begins with the code for an image tag:
- <img src="image.jpg" />
Peter then suggests adding a link to the relevant license, as follows:
Peter rightly points out that with this mark-up, Google has no way to tell whether the license applies to the page or the image -- a problem that would be compounded if there were a number of images on the same page. However, he shows how this can be resolved by adding a container for the mark-up, and placing an @about value onto that container:
There's nothing wrong with Peter's approach and it will work in all situations. But there will be many occasions where a slightly easier solution is possible.
Placing @about on the anchor
This first scenario assumes that we still want the clickable link, but not the containing div. In that case we need only place the @about value onto the link itself, to achieve the same effect as having the container:
The nice thing about this technique is that the clickable link that refers to the license doesn't need to be directly next to the image, or even close on the page (which it does with the container approach), which gives publishers a little more flexibility when it comes to the document's layout.
Images and @rel
If we don't want the clickable link that points to the license, then we can place the @rel="license" directly onto the image:
- <img src="image.jpg" rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/">
This is a great solution for software tools such as editors or content management systems, because it means that licensing information can be added to the image, right at the point where the image is embedded into the mark-up. Not only that, the image reference and the license are combined in a self-contained unit that can move around the document with no side-effects.
Using the same license for many images
Note that if the same license is to be applied to many images, then the containing element technique becomes useful again; we can specify a reference to the license on the container, and then use @rev to make the connection with the images:
This gives Google exactly the same information as this:
- <img src="image1.jpg" rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/">
- <img src="image2.jpg" rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/">
- <img src="image3.jpg" rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/">
- <img src="image4.jpg" rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/">
License information in the head
One final approach worth mentioning for the sake of completeness, is to place all of the license information into the head of the document:
This may be useful in some CMS systems, where all of the licensing information for any element that appears on a particular page can simply be 'dumped' into the page in one go.
Conclusion
It's great to see Google improving the user's search experience by surfacing license information in this way, and it's great to see that RDFa is helping publishers to provide this information to Google's crawlers, however they choose to mark it up.



I have many images that have
I have many images that have a 95 pixel wide thumbnail, a 450 pixel wide image on a "image information" page, which links to a full-size (typically 1280 - 1600 pixel wide) image, in much the same way as used by wikipedia. (e.g. Austin Healey 3000)
All that seems to show up is the 95pixel thumbnail. Will labeling the img tag with a license improve indexing do you think? The "image information" page already mentions the img license twice, with links to the CC license. Is this not sufficient?
How about for images that are
How about for images that are not in an img tag?
I like to have a smaller version, say 500 x 350, and link that to a full size version, say 2816 x 2112. I'd like to specify the license for the large image, but it isn't contained in an img tag.
Scott, did you ever find out
Scott, did you ever find out the answer to this ? I am looking for an answer to the same myself.
Hi, I've become obsessed with
Hi,
I've become obsessed with the example above that uses rev="license" to generate a triple for each image in the containing div.
I've spent hours F5ing the W3C rdfa extractor with (what I imagined to be) the simple aim of adding a cc:attributionName property to this construct. I couldn't get it to work.
The "don't repeat yourself" principle would seem to apply in a scenario like this, but I'll be damned if I can work out how to get properties to propogate to all the images in the same way that the license does.
Is this even possible?
Stupid me... Now I see I can
Stupid me... Now I see I can use CURIEs...
One [most probably silly]
One [most probably silly] question: if the image URI is long, duplicating it in the @about looks ugly, so... would it be possible to use an id (or even a class) for the same purpose?
Thanks for this! Confirms my
Thanks for this! Confirms my interpretation of RDFa, on the implementation here: geograph.org.uk/p/19
One thing tho, cant seem to get the page to xhtml validate, I've tried adding
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
but the w3c validator rejected it.
Maybe the validator rejected
Maybe the validator rejected it because of the doctype? Should it not be RDFa doctype as mentioned in the document at http://www.w3.org/TR/rdfa-syntax/?
Post new comment