Metadata setting structure
The following code snippet shows an example of the MetadataConfiguration
setting.
{
"from": {
"extension": "extension",
"filesize": {
"file": "metadata",
"path": ["$['File:FileSize']"]
},
"filename": {
"file": "metadata",
"path": ["$['File:FileName']"]
},
"width": {
"file": "metadata",
"path": [
"$['Composite:ImageWidth']",
"$['File:ImageWidth']",
"$['EXIF:ImageWidth']",
"$['QuickTime:ImageWidth']",
"$['MPEG:ImageWidth']",
"$['PNG:ImageWidth']",
"$['GIF:ImageWidth']",
"$['Photoshop:ImageWidth']",
"$['RIFF:ImageWidth']",
"$['ASF:ImageWidth']"
]
}
},
"to": {
"properties": {
"MainFile": {
"bag": "properties",
"properties": {
"extension": "extension",
"filesize": {
"value": "filesize",
"conversion": "FileSize"
},
"filesizebytes": "filesize",
"filename": "filename",
"width": "width"
}
}
},
"related": [
{
"relation": "MasterFile",
"role": "Child",
"properties": {
"FileSize": {
"value": "filesize",
"conversion": "FileSize"
},
"FileProperties": {
"bag": "properties",
"properties": {
"extension": "extension",
"width": "width"
}
}
}
}
]
}
}
The ImportMetadataConfiguration
JSON configuration contains two sections:
-
from
- Metadata to extract from the uploaded file. -
to
- Asset properties where the metadata is to be mapped.
From section
The from
section of the example contains three types of metadata property declarations. The following table explains them:
|
Description |
---|---|
RequestResponse
|
Note No |
RequestResponse
|
Note The |
RequestResponse
|
Note When the |
To section
The to
section maps metadata properties defined in the from
section to the asset properties.
When you upload a file, it is associated with an asset entity using the MasterFile relation. The to
section in the metadata configuration starts with the file entity properties and continues with the asset entity properties using the related
attribute.
The following diagram illustrates the structure of the to
section:

The to
section contains two parts, properties
and related
.
properties
is a list of mappings between the from
section and the file entity properties. A mapping can be complex, containing sub-properties organized in bags; or simple, containing simple single-valued properties.
A complex mapping is a property that references a member of the entity definition, such as MainFile
. It includes the following properties:
-
bag
- name of the bag in which the properties are stored, such asproperties
. -
properties
- list of simple properties to be stored in the bag.
A simple mapping is a property that references a member of the entity definition, such as filesize
. It includes the following properties:
-
value
- value assigned to the property. For example,filesize
that references a property of thefrom
section. -
conversion
- conversion to apply on the value. For example,FileSize
.
Both value
and conversion
are optional, so you can provide a simple key-value mapping instead, such as width:width
.
related
is an array of mappings between the from
section and the properties of related entities such as Asset
.
A related mapping is a property that describes the relation to a related entity, such as MasterFile
. It includes the following properties:
-
role
- role of the file entity in the relation. For example, in theMasterFile
relation, File is a child of Asset. Valid values areparent
orchild
. -
properties
- an array of complex or simple property mappings to the related entity.
Conversions values
Metadata configuration supports the following values for the conversion
property:
-
Duration
- Rounds the duration value with a factor of 1000. -
FileSize
- Rounds the file size using two decimal places and a factor of 0.000001. -
ArrayToString
- Concatenates the elements of the array to create a single, comma-separated string.