Does this attribute simply enhance semantics?


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 Feb 6 '14 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 Feb 6 '14 at 10:51
  • @Andrew: And: Classes like FOAF’s Image could also be reused by other vocabularies, in totally different contexts. The only that thing matters is the definition, where it only says: It’s an image, and this class is a subclass of Document. – unor Feb 6 '14 at 10:54
  • 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 Mar 12 '15 at 18:23
  • 1
    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")? – user56reinstatemonica8 Apr 15 '15 at 12:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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