I'm working with FOAF and RDFa, and struggling to figure out whether I should be using foaf:depiction or foaf:depicts and the correct way to use them. Here's what I've already established:
<div class="profile" typeof="foaf:Person">
<p>Employee Name: <span property="foaf:name">Fred Flintstone</span></p>
<p><img src="http://www.example.com/fred.jpg" alt="Photo of Fred Flintstone" /></p>
</div>
I understand that depicts and depiction are inversely related. I've searched across the vast reaches of the Internet but can't find any concrete examples. From what I've read, Image depicts Person, so I'm feeling inclined to use foaf:depiction because my subject is Person, but I'm not sure how to do so correctly. Rel or rev? On the image itself or on the enclosing paragraph?
Looks like I'm dealing with a niche subject. I've done some more searching and reading, and I think I found my answer here: http://www.w3.org/TR/2008/WD-xhtml-rdfa-primer-20080317/#using-src-on-img.
To summarize, my suspicions on the terminology were correct:
Image -> depicts -> Person
Person -> depiction -> Image
However, the foaf:img property is a more specific term than merely depiction specifically for relating a Person to the Image which represents them. So it would have been correct to use rel="foaf:depiction"
, it is more correct (in my situation) to use rel="foaf:img"
.
Here's the final code:
<div class="profile" typeof="foaf:Person">
<p>Employee Name: <span property="foaf:name">Fred Flintstone</span></p>
<p rel="foaf:img" rev="foaf:depicts"><img src="http://www.example.com/fred.jpg" alt="Photo of Fred Flintstone" /></p>
</div>
The rev
attribute specifies the reverse relationship of the image back to the person. This solidifies that there is a mutual relationship between these objects, and not a one-sided relationship.
So whether it is correct to use rel
or rev
depends on what your subject is. If I had a foaf:Image and with a list of multiple people in the image, the correct markup would be rel="depicts"
.
It's a shame that many examples were removed in future version of the RDFa Primer, but fortunately all previous versions are retained for the future.