Differences
This shows you the differences between two versions of the page.
metamod:faq [2008-10-21 12:43:52] egils |
metamod:faq [2022-05-31 09:29:32] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Frequently Asked Questions ====== | ||
- | ===== How should metadata in the database be mapped to a DIF XML? ===== | ||
- | The metadata structure is configurable, | ||
- | |||
- | The METAMODPMH module contain a translation from the database to DIF XML. For the time being, this translation is imlemented in a PHP script oaidp-config.php. This script contains an array which defines the translation: | ||
- | |||
- | < | ||
- | $key_conversion = array( | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | '', | ||
- | '', | ||
- | '', | ||
- | '', | ||
- | '', | ||
- | '', | ||
- | '', | ||
- | '', | ||
- | '', | ||
- | '', | ||
- | '', | ||
- | ' | ||
- | ' | ||
- | '', | ||
- | '', | ||
- | ' | ||
- | '', | ||
- | ); | ||
- | </ | ||
- | |||
- | In this array, triples of three consecutive elements (starting with elements 0, 1 and 2 on the first line) constitute the translation of one metadata item in the database to one XML element in the DIF. | ||
- | |||
- | Each triple comprise the following components: | ||
- | |||
- | - Name of metadata type in the database (or an empty string) | ||
- | - Sequence of element names used in the DIF | ||
- | - Constant value | ||
- | |||
- | If these three components has, for example, the following contenet: | ||
- | |||
- | ' | ||
- | |||
- | and "METNO Norwegian Meteorological Institute" | ||
- | |||
- | < | ||
- | <DIF ...> | ||
- | ... | ||
- | < | ||
- | < | ||
- | </ | ||
- | ... | ||
- | </ | ||
- | </ | ||
- | |||
- | This is the general rule, but some special rules apply: | ||
- | |||
- | - If an ' | ||
- | - If the third component in the triple (the constant value) is non-empty, it is used as the value in the DIF XML. The first component will then usually be empty. | ||
- | - A number may follow the metadata type name. This indicate a spacial conversion of the metadata value in the database. This conversion is implemented in the get_exception.php routine. | ||
- | - If several consecutive triples have the same metadata type name, they will appear as consecutive elements in the DIF XML. When this is the case, different conversions of the metatdata value will take place (indicated by a number as explained above). | ||
- | - Several metadata values for the same metadata type and dataset, produce several DIF XML elements. | ||
- | - An asterix (*) prepending an element name in the sequence of element names designates the start of a new DIF XML element at this level. |