Meta data

From Apache OpenOffice Wiki
Jump to: navigation, search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

OpenDocument and Metadata Primer

  • Flat XML?

Sample adding dc:creator metadata to a frame

MetaData DC Creator Mr X.jpg

Sample FlatXML

<office:document xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
                 xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
                 xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0">

 <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
          xmlns:dc="http://purl.org/dc/elements/1.1/">
  <rdf:Description rdf:nodeID="graphics01"> 
   <dc:creator>Mr. X</dc:creator>
  </rdf:Description>
 </rdf:RDF>

 <office:body>
  <office:text>
   <text:p>This
      <draw:frame>
        <draw:image rdf:nodeID="graphics01">
         <office:binary-data>...</office:binary-data>
        </draw:image>
      </draw:frame>
      has metadata.</text:p>
  </office:text>
 </office:body>

</office:document>

Sample (external RDF stream)

<office:office:document-content>
 <office:body>
  <office:text>
   <text:p>
   This <draw:frame><draw:image xml:id="graphics01" xlink:href="Pictures/samplepic.png"/></draw:frame> has metadata. 
   </text:p>
  </office:text>
 </office:body>
</office:office:document-content>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
         xmlns:dc="http://purl.org/dc/elements/1.1/">
<rdf:Description rdf:about="content.xml#graphics01"> 
   <dc:creator>Mr. X</dc:creator>
</rdf:Description>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
         xmlns:dc="http://purl.org/dc/elements/1.1/">
<rdf:Description rdf:about="Pictures/samplepic.png"> 
   <dc:creator>Mr. X</dc:creator>
</rdf:Description>

Sample (RDFa)

(not possible)

Personal tools