Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
metamod:xml-format [2008-10-29 13:40:02]
egils
metamod:xml-format [2022-05-31 09:29:32] (current)
Line 1: Line 1:
 ====== XML format for dataset descriptions ====== ====== XML format for dataset descriptions ======
  
-See also [[minutes2008_10_23]]+The following describes the internal metadata description of metamod. It evolved from [[minutes2008_10_23]] 
 + 
 +For each dataset we will need two XML files: 
 + 
 + 
 +===== Dataset XMD File ===== 
 + 
 +In addition to an XML file containing the metadata (in one of several possible formats), we will need an XML file that describes identification etc. for the dataset.  
 + 
 +Such XML files will be given an ".xmd" extention, and have a format like this:
  
 <code> <code>
Line 7: Line 16:
    <info status="..."                        // Value: active/deleted     <info status="..."                        // Value: active/deleted 
          ownertag="..."          ownertag="..."
-         creationdate="..."                  // YYYY-MM-DDZHH:TT +         creationDate="..."                  // YYYY-MM-DDTHH:TT:SSZ 
-         drpath="..." />                     // Unique identification +         datestamp="..."                     // YYYY-MM-DDTHH:TT:SSZ 
-   (EMBEDDED PART - see below)+         metadataFormat="..."                // Example: DIF, MM2 
 +         name="..." />                       // Unique identification 
 +   <quadtree> 
 +      ... 
 +   </quadtree> 
 </dataset> </dataset>
 </code> </code>
  
-The EMBEDDED PART has varying content depending on the source of the metadata. If the metadata are produced by the UPLOAD module or the QUEST module, an internal (METAMOD specific) format is used:+The important consequence of this XMD-file is that several metadata formats can be supported by METAMOD as long as translations (XSLT) and proper interpretation of the XMD metdataFormat tag is implemented in the version of METAMOD being operated. 
 + 
 +==== Documents ==== 
 + 
 +  * {{:metamod:exampledataset.xmd}} 
 +  * {{:metamod:dataset.xsd|Schema}} 
 +  * {{:metamod:dataset.xsl|Stylesheet}} 
 + 
 +==== Restrictions ==== 
 + 
 +  * 2009-02-17: The name field must match one or two / characters, one / meaning parent (''APPLICATION/DIRECTORY''), two / meaning file (''APPLICATION/DIRECTORY/FILE''). See  [[two_levels]] 
 + 
 +===== Metadata XML File ===== 
 + 
 +The XML files containing metadata are of varying formatsThey will all be given an ".xml" extention. 
 + 
 +One of these formats are defined by METAMOD2, and is only used as an internal format within the METAMOD2 system. 
 +This format (MM2) is for metadata produced by the UPLOAD module or the QUEST module:
  
 <code> <code>
-   <metamod xmlns="" ...>                          // Ref. to XML namespace etc. (if needed) +   <MM2 xmlns="" ...>                              // Ref. to XML namespace etc. (if needed)
-         <datacollection_period from="..." to="..." /> +
-         <quadtree> +
-            ... +
-         </quadtree>+
          <metadata name="...">value</metadata>     // To be repeated. One element          <metadata name="...">value</metadata>     // To be repeated. One element
                                                    // for each name,value pair.                                                    // for each name,value pair.
-   </metamod>+   </MM2>
 </code> </code>
  
-If the source of the metadata is based on some known XML format (like DIF), this format is used in the EMBEDDED PART:+===== Metadata names with special meaning ===== 
 + 
 +Metamod is generally ignorant of metadata-names, and most names can be configured. But some names have a special meaning and cannot be changed: 
 + 
 +  * **area**: geographic area either as detailed area //Fram Strait// or as gcmd-list //Continent > Europe > Northern Europe > Scandanavia > Norway//  
 +  * **bounding_box** for the extraction of quadtree-nodes for geographic search 
 +  * **datacollection_period_from** 
 +  * **datacollection_period_to** 
 +  * **datacollection_period** -- deprecated since metamod 2.1 
 +  * **topic**: used in quest as gcmd-list without '> HIDDEN', see **variable** and [[https://metamod.bugs.met.no/show_bug.cgi?id=13|bug#13]] 
 +  * **variable**: parameter, either as CF-1.0 standard_name //sea_surface_temperature// or as gcmd-list with '> HIDDEN' //Agriculture > Agricultural Chemicals > Fertilizers > HIDDEN//, see also [[https://metamod.bugs.met.no/show_bug.cgi?id=13|bug#13]] 
 + 
 + 
 +For translation to and from other metadata, please see the metadata-names in the [[faq]] entry on DIF-mapping. A extensive list of currently configured names can be found under: [[https://svn.met.no/viewvc/metamod/trunk/app/example/staticdata/searchdata.xml|searchdata.xml]] 
 + 
 + 
 + 
 + 
 +==== Documents ==== 
 + 
 +  * {{:metamod:examplemm2.xml}} 
 +  * {{:metamod:mm2.xsd|Schema}} 
 +  * {{:metamod:mm2.xsl|Stylesheet}} 
 + 
 + 
 +===== Hints on coding ===== 
 + 
 +Both metadata files should always be written as an atomic operation. To support this
 +//flock// should be used for reading and writing to the file-system. //flock// should first lock the .xmd file, then the .xml file. Then, both files should be written. Afterwards, unlock first the .xml file, then the .xmd file. **Not using this order might lead to a deadlock.** 
  
-<code> 
-   <DIF xmlns="" ...> 
-      ... 
-   </DIF> 
-</code> 
  • metamod/xml-format.1225287602.txt.gz
  • Last modified: 2022-05-31 09:23:19
  • (external edit)