Overview
The datamodel:asset-model resource represents the data model of an asset or asset type.
Properties
The datamodel:asset-model resource has the following properties:
attributes |
The information about the available attributes of the asset. |
---|---|
time-based |
The information about time-based meta data of the asset. |
layout |
The information about different layouts for the meta data of the asset. |
Link Relations
The datamodel:asset-model resource has no link relations.
Description
The datamodel:asset-model resource represents the data model of an asset or asset type.
This includes information about the available attributes and layout information for use in Graphical User Interfaces.
Property |
Description |
---|---|
attributes |
Definition of common and custom attributes that the asset can have. |
time-based |
Definition of the layers of time-based annotation that the asset can have. |
layout |
Definitions of recommended Metadata layouts. Sub properties:
|
Example:
{
"attributes": {
"common": [
// description of common attributes
],
"custom": [
// description of custom attributes
]
},
"time-based": [
// description of the layers of the time-based annotation
],
"layout": {
"attributeGroupLayout": [ ],
"simpleTimeBasedLayout": [ ],
"virtualLayersLayout": [ ]
}
}
attributes
The property attributes contains information about the attributes used for an asset or an asset type. It contains two sub properties:
-
common: description of the common attributes. The values of the common attributes are returned in the property common of aa:asset
-
custom: description of additional, custom attributes that are valid for this specific asset. The values of the custom attributes are returned in the aa:attributes sub resource of aa:asset.
Both sub properties contain an array of attribute descriptions. The structure is similar to the attribute description in datamodel:aggregated-model, but with the following differences:
-
appliesTo: is not present, because we are in the context of an aa:asset
-
flags contains the flags for this specific asset (or asset type) and for the calling user. Example: an attribute may come without "readonly" flag in datamodel:aggregated-model because the attribute can be edited for some asset, but here it is "readonly", because the user is not allowed to edit the attribute for this specific asset.
An attribute definition has the following properties:
Property |
Description |
---|---|
id |
Identifier of the attribute. For common attributes, it is the same as the property name used in the common representation, e.g. "startTC", "name", or "description". |
type |
Defines the type of the attribute. The structure is similar to the structure in datamodel:system-model for details. |
flags |
(Optional) An array of flags for the attribute. Currently, the following flags have a defined meaning:
Other flags may be added in the future. |
description |
(Optional) A description of the attribute. This is only used for human users of the API. |
labels |
(Optional) Contains a mapping of culture codes to localized labels. Example:
Typically, the client asks for the labels for the language of the user using a query parameter like, for example, lang=fr-CA (for Canadian French). In this case, the service cares about a proper fallback mechanism (e.g. using the label for "fr", if no specific label for "fr-CA" is available). If the client doesn’t request a specific culture, it should implement a similar language fallback mechanism to find the correct label. |
tooltips |
(Optional) Defines localized tool tips for the attribute. The structure is similar to the one for labels. |
subattributes |
(Optional) An array of sub-attributes of the attribute, e.g. to represent a MVC-attribute in MediaCentral Asset Management. The structure of subattributes' elements is equivalent to those of attributes. |
Example for an attribute description:
{
"id": "name",
"description": "display name",
"labels": {
"en": "Name",
"de": "Name"
},
"tooltips": {
"en": "Name",
"de": "Name"
},
"type": {
"baseType": "string",
"maxLength": 256,
"multiValue": false
},
"flags": [
"indexed", "readonly"
],
"subattributes": [
{
"id": "subattribute1 name",
"labels": {
"en": "subattribute1 en label"
},
"tooltips": {
"en": "subattribute1 en tooltip"
},
"type": {
"baseType": "string",
"maxLength": 256
}
}, {
"id": "subattribute2 name",
"labels": {
"en": "subattribute2 en label"
},
"tooltips": {
"en": "subattribute2 en tooltip"
},
"type": {
"baseType": "string"
}
}
]
}
time-based
The property time-based defines the details of the time-based annotation capabilities for the asset.
The information in this property is not about the actual segments of the assets. To get that information you must follow the aa:time-based link in the aa:asset resource. This property returns information about the available attributes, their types and how to deal with them.
The property time-based contains an array of layer definitions. Each layer is defined with the following properties:
Property |
Description |
---|---|
id |
Identifier of the layer. This is the same identifier that is returned when querying the actual segments of the asset. |
description |
A human-readable description for the layer. |
labels |
Localized display labels for the layer. The structure is the same as for the labels of attributes. |
tooltips |
Localized tooltips for the layer. The structure is the same as for the tooltips of attributes. |
ranged |
A boolean value. If true, the segments can span multiple frames. If false, segments are always assigned to a single frame ("marker").
|
gaps |
A boolean value. If true, then there can be gaps between segments, meaning: time ranges without segments. If false, then there must be a continuous sequence of segments and no time range without at least one segment assigned to it.
|
overlap |
A boolean value. If true, then segments can overlap other segments. If false, then segments can’t overlap other segments.
|
flags |
A list of flags that define certain aspects of the layer. Currently, the following flags are supported:
|
attributes |
An array defining the attributes that are available for the layer. The definition of the attributes for the layer uses the same structure as for the attributes for the asset. See attributes for details. |
Example for a layer of time-based annotation:
{
"attributes": { … },
"time-based": [
{
"id": "EDITORIAL_CONTENT",
"description": "Editorial content",
"labels": {
"en": "Editorial content",
"de": "Inhalt"
},
"tooltips": { … },
"ranged":true,
"gaps":true,
"overlap":false,
"flags": [
"indexed",
"readonly"
],
"attributes": [
{
"id": "comment",
"description": "Comment for the segment",
"labels": {
"en": "Comment"
},
"tooltips": { … },
"type": {
"baseType": "string"
},
"flags": [
"readonly"
]
},
{
"id": "reporter",
"labels": {
"en": "Reporter"
},
"type": {
"baseType": "string"
}
}
]
}
],
"layout": { … }
}
layout
The property layout contains a map of Meta data layouts. The key is the type of layout. The value depends on the layout type. Currently, the following layout types are defined:
-
attributeGroupLayout: a layout based on groups of attributes. See Attribute group layout for details.
-
simpleTimeBasedLayout: a simple layout for time-based annotation. See Simple time-based layout for details.
-
virtualLayersLayout: allow to express combinations of layers having specific semantics. See Virtual layers layout for details.
Attribute group layout
Properties
The attributeGroupLayout property defines a layout is based on groups of attributes. It consists of an array of groups.
For each group, you have the following properties:
Property |
Description |
|
---|---|---|
id |
The ID of the attribute group |
|
labels |
The localized labels for the attribute group. The structure is the same as for attributes. |
|
tooltips |
The localized tooltips for the attribute group. |
|
items |
An array of items to be shown in the attribute group. Each item is an attribute as defined in the attributes property. |
An item has the following properties:
Property | Description | |
---|---|---|
id |
The ID of the attribute |
|
common |
(optional) true if the attribute is a common attribute, false, null or missing if the attribute is a custom attribute. |
|
flags |
(optional) May contain a list of flags defining how to display the attribute. Currently, the following flags are supported:
|
|
options |
(optional) May contain a map of options defining how to display the attribute. Currently, the following options are supported:
|
|
subitems |
(optional) Array of sub-items of the item, e.g. to represent the layout of MVC-attributes in MediaCentral Asset Management. The structure of subitems' elements is equivalent to those of items. |
Restrictions
The option restrictions may contain additional restrictions that a UI should impose when displaying an attribute. Currently, the restrictions option is only used for multi-value attributes and only present if there are restrictions. The value is a JSON object that may contain the following properties:
Property |
Description |
---|---|
noCreateRows |
(optional, boolean) Only for MC | AM multi-value attributes: if present and value is true, the user shall not be able to create new rows. |
noCreateRowsExpression |
(optional) Only for MC | AM multi-value attributes: if present and not null, the value is an expression (see expressions for details). If the expression evaluates to true, the user shall not be able to create new rows. An expression is only given if noCreateRows is not given or false. |
noDeleteRows |
(optional, boolean) Only for MC | AM multi-value attributes: if present and value is true, the user shall not be able to delete rows. |
noDeleteRowsExpression |
(optional) Only for MC | AM multi-value attributes: if present and not null, the value is an expression (see expressions for details). If the expression evaluates to true, the user shall not be able to delete rows. An expression is only given if noDeleteRows is not given or false. |
noMoveRows |
(optional, boolean) Only for MC | AM multi-value attributes: if present and value is true, the user shall not be able to delete rows. |
noMoveRowsExpression |
(optional) Only for MC | AM multi-value attributes: if present and not null, the value is an expression (see expressions for details). If the expression evaluates to true, the user shall not be able to move rows. An expression is only given if noMoveRows is not given or false. |
Example
Example for an attribute group layout "VIDEO" with two groups "Video" and "MPI", with two attributes each
{
"attributes": { },
"time-based": [ ],
"layout": {
"attributeGroupLayout": [
{
"id": "VIDEO",
"labels": {
"en": "Video"
},
"items": [
{
"id": "name",
"common": true
},
{
"id": "ORIGINAL_FILENAME",
"flags": [ "multiline" ],
"options": {
"defaultValue": "-- unknown file name --"
}
},
{
"id": "ORIGINAL_EXTENSION"
}
]
},
{
"id": "XTRA_15_MPI",
"labels": {
"en": "MPI"
},
"items": [
{
"id": "MPI_EXTERNAL_ID"
},
{
"id": "PAM_MASTERCLIP_TAPE"
}
]
}
]
}
}
Simple time-based layout
The simpleTimeBasedLayout property defines a simple layout that can be used to display and edit layers of time-based annotation.
The value of simpleTimeBasedLayout is an array, containing one object for each layer (in the example for the layer with ID EDITORIAL_CONTENT) in the sequence in which the layers should be displayed. For each layer the following properties are available:
Property |
Description |
|
---|---|---|
id |
The ID of the layer. |
|
items |
An array of items to be shown for this layer. Each item is an attribute as defined in the attributes property of this layer of time-based annotation. |
Each item has the following properties:
Property |
Description |
|
---|---|---|
id |
The ID of the attribute. |
|
flags |
(optional) Flags may specify how to show the attribute. Currently the following flags are supported:
|
|
options |
(optional) May contain a map of options defining how to display the attribute. Currently, the following options are supported:
|
Example for an simple time-based layout for layer "EDITORIAL_CONTENT" with two attributes
{
"attributes": { },
"time-based": [ ],
"layout": {
"simpleTimeBasedLayout": [
{
"id": "EDITORIAL_CONTENT",
"items": [
{
"id": "comment",
"flags": [
"multiline"
]
},
{
"id": "reporter"
}
]
}
]
}
}
Virtual layers layout
The idea of the property virtualLayersLayout is to express combinations of layers having specific semantics.
The value of virtualLayersLayout is an array, containing one object for each virtual layer. For each virtual layer the following properties are available:
Property |
Description |
---|---|
id |
The ID of the virtual layer having specific semantics. |
layerids |
An array of other layer IDs (taken from those specified in the simpleTimeBasedLayout property), whose combination defines the virtual layer. |
MediaCentral Production Management: Provides two virtual layers: "markers" and "restrictions".
Example for a virtual layer layout for MediaCentral Production Management
{
"attributes": { … },
"time-based": [ … ],
"layout": {
"virtualLayersLayout": [
{
"id":"markers",
"layerids":[
"V1",
"V2",
"V3",
"A1",
"A2",
"A3",
"A4"
]
},
{
"id":"restrictions",
"layerids":[
"restrictions"
]
}
]
}
}
Expressions
Expressions are used as values of the options readOnlyExpressionRule and visibilityExpressionRule. An expression is a recursive JSON structure. It consists of an arbitrary combination of AND and OR clauses, combined with attribute terms.
Example for a read-only expression
{
"or": [
{
"and": [
{
"attribute": "ASPECT_RATIO",
"op": "isSet"
},
{
"attribute": "SHOW_TITLE",
"op": "equals",
"value": "heute journal"
}
]
},
{
"and": [
{
"attribute": "ASPECT_RATIO",
"op": "isSet"
},
{
"attribute": "BROADCASTER",
"op": "equals",
"value": "ZDF"
}
]
}
]
}
The following expressions are supported:
Expression type |
Description |
---|---|
AND clause |
True, if all sub expressions evaluate to true:
|
OR clause |
True, if at least one of the sub expressions evaluates to true:
|
Attribute term without arguments |
Test the value of a given attribute. Valid ops:
|
Attribute term with one argument |
Test the value of a given attribute against a given value. Valid ops:
The value property always contains a string. Example for an integer attribute:
If an attribute has no value or if the value property of the expression is null, it must be treated like an empty string. Examples:
MediaCentral | Asset Management:
|
Attribute term with a list of arguments |
Test the value of a given attribute against list of given values. Valid ops:
Again, the values property always contains JSON strings. And if an attribute has no value or if the value property of the expression is null, it must be treated like an empty string. For MediaCentral | Asset Management, the same rules for the values apply as for attribute terms with one argument (see above). |
Complete Example
Example for an MC|AM asset
{
"_links": {
"self": {
"href": "https://host/…"
}
},
"attributes": {
"common": [
{
"id": "name",
"labels": {
"en": "Main Title"
},
"type": {
"baseType": "string",
"maxLength":256
},
"options": {
"mandatory":true
}
},
{
"id": "modified",
"labels": {
"en": "Modified"
},
"type": {
"baseType": "datetime"
}
}
],
"custom": [
{
"id": "ORIGINAL_FILENAME",
"labels": {
"en": "Original Filename (changed)"
},
"type": {
"baseType": "string",
"maxLength":256
}
},
{
"id": "ORIGINAL_EXTENSION",
"labels": {
"en": "Original Extension"
},
"type": {
"baseType": "string",
"maxLength":256
},
"options": {
"readonly":true
}
}
]
},
"time-based": [
{
"id": "EDITORIAL_CONTENT",
"description": "Editorial content",
"labels": {
"en": "Editorial content",
"de": "Inhalt"
},
"tooltips": { … },
"ranged":true,
"gaps":true,
"overlap":false,
"flags": [
"indexed",
"readonly"
],
"attributes": [
{
"id": "comment",
"description": "Comment for the segment",
"labels": {
"en": "Comment"
},
"tooltips": { … },
"type": {
"baseType": "string"
},
"flags": [
"readonly"
]
},
{
"id": "reporter",
"labels": {
"en": "Reporter"
},
"type": {
"baseType": "string"
}
}
]
}
],
"layout": {
"attributeGroupLayout": [
{
"id": "VIDEO",
"labels": {
"en": "Video"
},
"items": [
{
"id": "name",
"common":true
},
{
"id": "ORIGINAL_FILENAME",
"flags": [
"multiline"
],
"options": {
"defaultValue": "-- unknown file name --"
}
},
{
"id": "ORIGINAL_EXTENSION"
}
]
},
{
"id": "XTRA_15_MPI",
"labels": {
"en": "MPI"
},
"items": [
{
"id": "MPI_EXTERNAL_ID"
},
{
"id": "PAM_MASTERCLIP_TAPE"
}
]
}
],
"simpleTimeBasedLayout": [
{
"id": "EDITORIAL_CONTENT",
"items": [
{
"id": "comment",
"flags": [
"multiline"
]
},
{
"id": "reporter"
}
]
}
],
"virtualLayersLayout": [
{
"id":"markers",
"layerids":[
"V1",
"V2"
]
},
{
"id":"blubb",
"layerids":[
"x", "y", "z"
]
}
]
}
}