Does this attribute simply enhance semantics?


1 Answer 1


Yes, it’s about semantics of your content. That way, your page/content is part of the Semantic Web.


The typeof attribute is defined by RDFa.
RDFa is a syntax to embed RDF in markup languages like HTML.

The value foaf:Image (most likely) refers to the Friend of a Friend vocabulary/ontology. The namespace foaf: typically stands for the URI of that vocabulary (http://xmlns.com/foaf/0.1/), so the value is actually the URI http://xmlns.com/foaf/0.1/Image.

http://xmlns.com/foaf/0.1/Image is a class. It’s (= what it means) documented here: http://xmlns.com/foaf/spec/#term_Image.

  • So would I be right in thinking this attribute should only be used on images of people? The Friend of a Friend ontology seems very focused on people.
    – Andrew
    Commented Feb 6, 2014 at 4:23
  • 1
    @Andrew: While FOAF’s main focus might be describing persons, it’s not their only use case. If the Image is used as object in a triple with the img property, then yes, the subject would be Person (see "Range" and "Domain" in the definition of the property). But if it would be used with the depiction property, the subject could be a Thing aka. "universal class of all things" (= anything).
    – unor
    Commented Feb 6, 2014 at 10:51
  • 1
    @JamesWilson: With "matters" I meant: when using the class foaf:Image, no matter in which context, you should follow its definition. -- Without specifying a property (like foaf:img or foaf:depiction), it simply means: "This is an foaf:Image." So such markup is not incorrect nor incomplete (well, it depends on what you want to convey).
    – unor
    Commented Mar 12, 2015 at 18:23
  • 2
    Aren't all <img>s images, by definition? I'm struggling to see what value applying typeof="foaf:image" to all <img> tags adds to the semantic web. Can you give a practical example of an application (real or hypothetical) that usefully processes images tagged typeof="foaf:image" and can't work with images without it (or which usefully discriminates between images with and without typeof="foaf:image")? Commented Apr 15, 2015 at 12:22
  • 1
    @user568458: Specifying that something is a foaf:Image allows you to specify data about this something: it sets the scope for any properties (i.e., property attributes) that are descendants of the element with the foaf:Image type (which doesn’t have to be an actual img element, or even a digital image at all). And if you give this image a URI (via the about or resource attribute) you allow other sources to make statements about this image. -- Apart from that, consumers that parse RDF(a) are not necessarily also looking at the HTML, so they wouldn’t notice an "untyped" img.
    – unor
    Commented Apr 15, 2015 at 14:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.