Skip to main content
Skip table of contents

Metadata schema [VC 21.3 GEN]

A metadata schema can be used to enforce a particular data model in the metadata. A such restriction can say that the field group “goal” should contain exactly one field “goal_time” and one or more references to the group “player”.

See Defining a metadata schema and Alternate way of creating a schema for an example on how to create a metadata schema.

Managing the metadata schema

Retrieve the schema

GET /metadata-schema

Retrieves the full metadata schema.

Produces:
Role:

_metadata_schema_read

Example

NONE
GET /metadata-schema
HTML/XML
<MetadataSchemaDocument xmlns="http://xml.vidispine.com/schema/vidispine">
  <group min="0" max="-1" name="organization">
    <group reference="false" min="1" max="-1" name="employee"/>
    <group reference="false" min="0" max="-1" name="project"/>
    <field reference="false" min="1" max="1" name="example_name"/>
  </group>
  <group min="0" max="0" name="project">
    <group reference="true" min="1" max="-1" name="employee"/>
    <field reference="false" min="1" max="1" name="example_name"/>
    <field reference="false" min="1" max="1" name="example_location"/>
  </group>
  <group min="0" max="0" name="employee">
    <field reference="false" min="1" max="1" name="example_name"/>
    <field reference="false" min="0" max="1" name="example_title"/>
  </group>
</MetadataSchemaDocument>

Update the schema

PUT /metadata-schema

Updates the schema with the given document.

Accepts:
Role:

_metadata_schema_write

Example

NONE
PUT /metadata-schema
Content-Type: application/xml

<MetadataSchemaDocument xmlns="http://xml.vidispine.com/schema/vidispine">
    <!-- The organization is optional and can exist [0,n] outside of groups -->
    <group name="organization" min="0" max="-1">
        <!-- An organization has one or more employees -->
        <group name="employee" min="1" max="-1" reference="false"/>
        <!-- An organization has one or more projects -->
        <group name="project" min="0" max="-1" reference="false"/>
        <!-- An organization has exactly one name -->
        <field name="example_name" min="1" max="1" reference="false"/>
    </group>

    <!-- A project cannot exist outside of a group -->
    <group name="project" min="0" max="0">
        <!-- A project has at least one employee, which has to be referenced -->
        <group name="employee" min="1" max="-1" reference="true"/>
        <!-- A project has exactly one name -->
        <field name="example_name" min="1" max="1" reference="false"/>
        <!-- A project has exactly one location element (it still can have more than one value) -->
        <field name="example_location" min="1" max="1" reference="false"/>
    </group>

    <!-- An employee cannot exist outside of a group -->
    <group name="employee" min="0" max="0">
        <!-- An employee has exactly one name -->
        <field name="example_name" min="1" max="1" reference="false"/>
        <!-- An employee might have a title -->
        <field name="example_title" min="0" max="1" reference="false"/>
    </group>
</MetadataSchemaDocument>

Delete the schema

DELETE /metadata-schema

Clears the schema, causing no validation to be made.

Role:

_metadata_schema_write

Example

NONE
DELETE /metadata-schema
NONE
200 OK

Groups in the schema

Retrieve a group from the schema

GET /metadata-schema/(group-name)

Retrieves the schema for a particular group.

Produces:
Role:

_metadata_schema_read

Example

NONE
GET /metadata-schema/project
HTML/XML
<MetadataSchemaGroupDocument xmlns="http://xml.vidispine.com/schema/vidispine" min="0" max="0" name="project">
  <group reference="true" min="1" max="-1" name="employee"/>
  <field reference="false" min="1" max="1" name="example_name"/>
  <field reference="false" min="1" max="1" name="example_location"/>
</MetadataSchemaGroupDocument>

Update a group in the schema

PUT /metadata-schema/(group-name)

Updates the specified group in the schema

Accepts:
Role:

_metadata_schema_write

Example

NONE
PUT /metadata-schema/employee
NONE
200 OK

Remove a group from the schema

DELETE /metadata-schema/(group-name)

Removes the group from the schema.

Role:

_metadata_schema_write

Example

NONE
DELETE /metadata-schema/employee
NONE
200 OK
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.