ProfileSpec

From RDFa Working Group Wiki
Jump to: navigation, search

RDFa Profiles are optional external documents that define collections of terms and/or prefix mappings, as well as default vocabularies. RDFa Profiles are referenced via @profile, and can be used by document authors to simplify the task of adding semantic markup. These documents must be defined in an approved RDFa Host Language (currently XHTML+RDFa [XHTML-RDFA]). When the protocol used for accessing the profile document supports delivery in multiple alternative formats, then the profile document may also be defined in other RDF serializations in addition to HTML+RDFa. When an RDFa document includes @profile, the value of the attribute is evaluated in order as follows.

  1. Attempt to retrieve the content of the URI. If the retrieval fails, the handling of the @profile attribute fails (and, according to section 7.5, current element and its children must not place any triples in the default graph)
  2. Otherwise, parse the retrieved content as an RDFa document or, if another RDF serialization has been used, using the parsing rules of that serialization. The extracted triples yield a profile graph associated with that URI.
  3. For every extracted triple in the profile graph that uses the rdfa:prefix predicate with a literal as an object and a URI reference as a subject, create a mapping from the object literal of the triple to the string representation of the subject. If another triple using the rdfa:prefix predicate is present in the profile graph with the same subject, disregard this mapping. Otherwise, add or update this mapping in the local list of URI mappings after transforming the object component to lower-case.
  4. For every extracted triple in the profile graph that uses the rdfa:term predicate with a literal as an object and a URI reference as a subject, create a mapping from the object literal of the triple to the string representation of the subject. If another triple using the rdfa:term predicate is present in the profile graph with the same subject, disregard this mapping. Otherwise, add or update this mapping in the local term mappings.
  5. If there is one and only one triple in the profile graph that uses the rdfa:vocabulary predicate with a URI reference as a subject, use the string representation of the subject as a default, 'no prefix' mapping (see section 6). Note, however, that if the element also has a @vocab attribute, this takes precedence over the value extracted from the profile graph.

Once all the URIs in the @profile value have been processed, continue with the normal processing of the current element.

Note: To avoid latency and recursive nesting problems, profile document authors SHOULD NOT use the @profile mechanism inside profile documents.