previous next contents elements attributes properties index

19 July, 2001

# 21 Metadata

### Contents

## 21.1 Introduction

Metadata is information about a document.

In the computing industry, there are ongoing standardization efforts towards metadata with the goal of promoting industry interoperability and efficiency. Content creators should track these developments and include appropriate metadata in their SVG content which conforms to these various metadata standards as they emerge.

The W3C has ongoing metadata activities which provide general metadata guidelines. One of the W3C's metadata activities is the definition of Resource Description Framework (RDF), a W3C Recommendation for specifying metadata. The specifications for RDF can be found at:

- Resource Description Framework Model and Syntax Specification
- Resource Description Framework (RDF) Schema Specification

Another activity relevant to most applications of metadata is the Dublin Core, which is a set of generally applicable core metadata properties (e.g., Title, Creator/Author, Subject, Description, etc.).

Individual industries or individual content creators are free to define their own metadata schema but are encouraged to follow existing metadata standards and use standard metadata schema wherever possible to promote interchange and interoperability. If a particular standard metadata schema does not meet your needs, then it is usually better to define an additional metadata schema in an existing framework such as RDF and to use custom metadata schema in combination with standard metadata schema, rather than totally ignore the standard schema.

## 21.2 The 'metadata' element

Metadata which is included with SVG content should be specified within 'metadata' elements. The contents of the 'metadata' should be elements from other XML namespaces, with these elements from these namespaces expressed in a manner conforming with the "Namespaces in XML" Recommendation [XML-NS].

Authors should provide a 'metadata' child element to the outermost 'svg' element within a stand-alone SVG document. The 'metadata' child element to an 'svg' element serves the purposes of identifying document-level metadata.

The DTD definitions of many of SVG's elements (particularly, container and text elements) place no restriction on the placement or number of the 'metadata' sub-elements. This flexibility is only present so that there will be a consistent content model for container elements, because some container elements in SVG allow for mixed content, and because the mixed content rules for XML [XML-MIXED] do not permit the desired restrictions. Representations of future versions of the SVG language might use more expressive representations than DTDs which allow for more restrictive mixed content rules. It is strongly recommended that at most one 'metadata' element appear as a child of any particular element, and that this element appear before any other child elements (except possibly 'desc' or 'title' elements) or character data content. If metadata-processing user agents need to choose among multiple 'metadata' elements for processing (e.g., to decide which string to use for a tooltip), the user agent shall choose the first one.

    <!ENTITY % metadataExt "" >
    <!ELEMENT metadata (#PCDATA %metadataExt;)* >
    <!ATTLIST metadata
      %stdAttrs; >

Attribute definitions:

Attributes defined elsewhere:
  %stdAttrs;.

## 21.3 An example

Here is an example of how metadata can be included in an SVG document. The example uses the Dublin Core version 1.1 schema:

    <?xml version="1.0" standalone="yes"?>
    <svg width="4in" height="3in"
        xmlns = 'http://www.w3.org/2000/svg'>
        <desc xmlns:myfoo="http://example.org/myfoo">
          <myfoo:title>This is a financial report</myfoo:title>
          <myfoo:descr>The global description uses markup from the
            <myfoo:emph>myfoo</myfoo:emph> namespace.</myfoo:descr>
          <myfoo:scene><myfoo:what>widget $growth</myfoo:what>
          <myfoo:contains>$three $graph-bar</myfoo:contains>
            <myfoo:when>1998 $through 2000</myfoo:when> </myfoo:scene>
       </desc>
        <metadata>
          <rdf:RDF
               xmlns:rdf = "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
               xmlns:rdfs = "http://www.w3.org/2000/01/rdf-schema#"
               xmlns:dc = "http://purl.org/dc/elements/1.1/" >
            <rdf:Description about="http://example.org/myfoo"
                 dc:title="MyFoo Financial Report"
                 dc:description="$three $bar $thousands $dollars $from 1998 $through 2000"
                 dc:publisher="Example Organization"
                 dc:date="2000-04-11"
                 dc:format="image/svg+xml"
                 dc:language="en" >
              <dc:creator>
                <rdf:Bag>
                  <rdf:li>Irving Bird</rdf:li>
                  <rdf:li>Mary Lambert</rdf:li>
                </rdf:Bag>
              </dc:creator>
            </rdf:Description>
          </rdf:RDF>
        </metadata>
    </svg>

## 21.4 DOM interfaces

The following interfaces are defined below: SVGMetadataElement.

### Interface SVGMetadataElement

The SVGMetadataElement interface corresponds to the 'metadata' element.

IDL Definition

      interface SVGMetadataElement : SVGElement {};

previous next contents elements attributes properties index