views:

103

answers:

2

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?

+1  A: 

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.

Scott
A: 

Scott - the answer is that depicts and depiction are inverse properties of each other, as you found out, it is defined like this in the FOAF spec:

<rdf:Property rdf:about="http://xmlns.com/foaf/0.1/depicts" rdfs:comment="A thing depicted in this representation.">
[...]
<owl:inverseOf rdf:resource="http://xmlns.com/foaf/0.1/depiction"/&gt;

This means that if you have proper inference in your store, it doesn't matter which one you use, they should both appear.

FOAF uses a few things like that, primaryTopic/isTopicOf, topic/page, maker/made, etc. FOAF also makes use of inverseFunctionalProperties, i.e. properties where a certain value is tied uniquely to a single person. The usual example is mbox, if you find two FOAF Person entities with the same email address, you can infer that they are actually the same person, since they are uniqiuely identified by their email address.

gromgull
Thanks for your response. This seems to be a very niche topic. I'm curious to see how you would mark up my example.
Scott