W3C

API for Media Resource 1.0

W3C Working Draft 20 October 2009

This version:
http://www.w3.org/TR/2009/WD-mediaont-api-1.0-20091020
Latest version:
http://www.w3.org/TR/mediaont-api-1.0
Editors:
WonSuk Lee, Electronics and Telecommunications Research Institute (ETRI)
Florian Stegmaier, University of Passau
Chris Poppe, Ghent University

Abstract

This specification defines a client-side API to access metadata information related to media resources on the Web. The overall purpose of the API is to provide developers with a convenient access to metadata information stored in different metadata formats. The API will be introduced in an abstract manner using the interface definition language Web IDL. Thereby, the Media Ontology Core Properties will be used as a pivot vocabulary in the API.

Status of this Document

This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at http://www.w3.org/TR/.

This is the First Public Working Draft of the API for Media Resource 1.0 specification. It has been produced by the Media Annotations Working Group, which is part of the W3C Video on the Web Activity.

Please send comments about this document to public-media-annotation@w3.org mailing list (public archive).

Publication as a Working Draft does not imply endorsement by the W3C Membership. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.

This document was produced by a group operating under the 5 February 2004 W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.

Table of Contents

1 Introduction
    1.1 Formats in scope
    1.2 Formats out of scope
    1.3 Terminology
2 API Description
    2.1 Design consideration
    2.2 API for Descriptive Properties
        2.2.1 Identification Properties
            2.2.1.1 Identifier
            2.2.1.2 Title
            2.2.1.3 Language
            2.2.1.4 Locator
        2.2.2 Creation Properties
            2.2.2.1 Contributors
            2.2.2.2 Creators
            2.2.2.3 CreateDate
            2.2.2.4 Location
        2.2.3 Content Properties
            2.2.3.1 Description
            2.2.3.2 Keyword
            2.2.3.3 Genre
            2.2.3.4 Rating
        2.2.4 Relational Properties
            2.2.4.1 Relation
            2.2.4.2 Collection
        2.2.5 Rights Properties
            2.2.5.1 Copyright
            2.2.5.2 License
        2.2.6 Distribution Properties
            2.2.6.1 Publisher
            2.2.6.2 TargetAudience
        2.2.7 Fragments Properties
            2.2.7.1 Fragments
            2.2.7.2 NamedFragments
    2.3 API for Technical Properties
        2.3.1 FrameSize
        2.3.2 Compression
        2.3.3 Duration
        2.3.4 Format
        2.3.5 Samplingrate
        2.3.6 Framerate
        2.3.7 Bitrate
        2.3.8 NumTracks
    2.4 API for Iterating operation
3 Examples of how to use the API

Appendices

A Web IDL description for API
B References(Normative)
C References(Non-Normative)
D Acknowledgements (Non-Normative)


1 Introduction

This section is informative.

Editorial note 
This part will be elaborated in the perspectives of reason why we want to provide an API and an explanation on who should use/implement it.

This specification defines a client-side API to access metadata information related to media resources on the Web. The overall purpose of the API is to provide developers with a convenient access to metadata information stored in different metadata formats. Thereby, the Media Ontology Core Properties will be used as a pivot vocabulary in the API. The description of relations between these core properties and the metadata formats in scope (1.1 Formats in scope) are stored in the Media Ontology in order to provide cross-community data integration. The API will be introduced in an abstract manner using the interface definition language Web IDL. The decision to use Web IDL, which offers bindings for ECMAScript and Java, can be based on the Use Cases and Requirements for Ontology and API for Media Object 1.0. This document clearly states that the focus for this API lies on multimedia services on the Web.

The API serves as a mediator between a developer and the underlying Ontology for Media Resource 1.0 with the goal to support interoperability between metadata formats. It offers GET and SET operations to retrieve and to store particular metadata informations represented in a certain metadata format related to media ressources on the Web.

The initial version of this document contains only a limited description of API. In addtion, there are many open issues including definitions of return types. Nevertheless it is being published with the aspiration to gather wide feedback on the yet available API design.

2 API Description

Editorial note 
This part will be elaborated with a precise description of the actual methods in the API, (so these are the methods that can be found in the Strawman API design and note), described using Web IDL. This section needs to define and explain all aspects of those methods (parameters and return values).
Editorial note 
There are many open issues about SET interfaces, so these issues will be covered later.

2.1 Design consideration

This part defines the interface for accessing the metadata. The API has been described using Web IDL. All properties are treated as attributes and have been grouped in the MediaResource interface within the mawg module. Currently, only read access is defined (all attributes are defined as readonly). Exceptions have been defined using Web IDL's exception constructs. Certain properties have complex structures so the return type consists of one or more object types. For these objects, different interfaces have been defined which are part of the returnValues module. Note that, all of these interfaces inherit from the Unstructured interface. This interface has an attribute unstructeredValue using DOMString. If it is not clear how a certain value for a property should be structured, this attribute allows to describe the value in plain text. The following fragment shows the entire API described in Web IDL. The different properties have been grouped in categories and the semantics of each property and return type will be discussed in the next sections.

2.2 API for Descriptive Properties

This part defines part of the interface for accessing the descriptive metadata that describes a work for purposes of discovery and identification, such as creators, title, language and extra. The properties have been grouped in different categories.

2.2.1 Identification Properties

2.2.1.3 Language
Web IDL syntax:
Description:

The language property specifies a language used in the entity, Recommended best practice is to use BCP 47 [BCP 47].

Return type:

A DOMString that represents the language as a plain string.

Exceptions:

The NoValue exception is thrown if no value is available.

Example:

N/A

2.2.2 Creation Properties

2.2.3 Content Properties

2.2.5 Rights Properties

2.2.7 Fragments Properties

2.3 API for Technical Properties

This part defines the interfaces for accessing the technical metadata that describe information for dealing with the creation or storage encoding processes or formats of the resource.

2.4 API for Iterating operation

Editorial note 
This part will be covered later in the perspectives of what kind API for iterating operation is helpful to application developers .

3 Examples of how to use the API

Editorial note 
This part will illustrate how to use the API in the actual (working) implementations

A Web IDL description for API

module mawg {
	exception WrongMethod{
		const DOMString errorMessage = ”Property undefined for this media type.”
	};

	exception NoValue{
		const DOMString errorMessage = ”No value available for this property.”
	};

	interface MediaResource {

		// Identification
		readonly attribute DOMString identifier getraises (NoValue);
		readonly attribute DOMString title getraises (NoValue);
		readonly attribute DOMString language getraises (NoValue);
		readonly attribute DOMString locator getraises (NoValue);

		// Creation
		readonly attribute object[] contributors getraises (NoValue);
		readonly attribute DOMString[] creators getraises (NoValue);
		readonly attribute object createDate getraises (NoValue);
		readonly attribute object location getraises (NoValue);

		//Content Description
		readonly attribute DOMString description getraises (NoValue);
		readonly attribute DOMString[] keyword getraises (NoValue);
		readonly attribute DOMString genre getraises (NoValue);
		readonly attribute object rating getraises (NoValue);

		// Relational 
		readonly attribute object[] relation getraises (NoValue);
		readonly attribute DOMString collection getraises (NoValue);

		// Rights
		readonly attribute object[] copyright getraises (NoValue);
		readonly attribute object license getraises (NoValue);

		 // Distribution
		readonly attribute DOMString publisher getraises (NoValue);
		readonly attribute object targetAudience getraises (NoValue);

		// Fragments
		readonly attribute object[] fragments getraises (NoValue);
		readonly attribute object[] namedFragments getraises (NoValue);

		// Technical Properties
		readonly attribute object frameSize getraises (NoValue);
		readonly attribute DOMString compression getraises (NoValue);
		readonly attribute unsigned long duration getraises (NoValue);
		readonly attribute DOMString format getraises (NoValue);
		readonly attribute unsigned long samplingrate getraises (NoValue);
		readonly attribute float framerate getraises (NoValue);
		readonly attribute float bitrate getraises (NoValue);
		readonly attribute unsigned short numTracks getraises (NoValue);
	};

	
	module returnValues {
		interface Unstructured {
			attribute DOMString unstructuredValue;
		};

		interface Contributors: Unstructured {
			attribute DOMString id;
			attribute DOMString role;
		};

		interface Date: Unstructured {
			// to be defined … 
		};
		interface Location: Unstructured {
			// to be defined what the Location is … 
		};

		interface Rating: Unstructured {
	                attribute DOMString issuer;
			attribute short value;
			attribute short minimum;
			attribute short maximum;
			attribute DOMString context;
		};

		interface Relation: Unstructured {
			attribute DOMString id;
			attribute DOMString relationship;
		};
		
		interface Copyright: Unstructured {
			attribute DOMString statement;
			attribute DOMString[] holder;
		};

		interface License: Unstructured {
			attribute DOMString statement;
			attribute DOMString organization;
		};

		interface TargetAudience: Unstructured {
			attribute DOMString issuer;
			attribute DOMString classification;
		};

		interface Fragment: Unstructured {
			  attribute DOMString role;
			  attribute DOMString identifier;
		};
		
		interface NamedFragment: Unstructured {
			  attribute DOMString name;	
			  attribute DOMString identifier;
		};
		
		interface FrameSize: Unstructured {
			  attribute unsigned long width;
			  attribute unsigned long height;
		};
	};
};

	  

B References(Normative)

[Ontology for Media Resource 1.0]
Ontology for Media Resource 1.0, WonSuk Lee, Tobias Bürger, Felix Sasaki, Véronique Malaisé, Florian Stegmaier and Joakim Söderberg. W3C Working Draft, 18 June 2009. Available at http://www.w3.org/TR/mediaont-10/ .

C References(Non-Normative)

[BCP 47]
BCP 47 (Matching of Language Tags, Tags for Identifying Languages), A. Phillips and M. Davis, Editors. Available at http://www.rfc-editor.org/rfc/bcp/bcp47.txt.
[Web IDL]
Web IDL, Cameron McCormack, Editor. W3C Working Draft, 19 December 2008. Available at http://www.w3.org/TR/WebIDL/ .

D Acknowledgements (Non-Normative)

This document is the work of the W3C Media Annotations Working Group.

Members of the Working Group are (at the time of writing, and by alphabetical order): Werner Bailer (K-Space), Tobias Bürger (University of Innsbruck), Eric Carlson (Apple, Inc.), Pierre-Antoine Champin ((public) Invited expert), Jaime Delgado (Universitat Politècnica de Catalunya), Jean-Pierre EVAIN ((public) Invited expert), Ralf Klamma ((public) Invited expert), WonSuk Lee (Electronics and Telecommunications Research Institute (ETRI)), Véronique Malaisé (Vrije Universiteit), Erik Mannens (IBBT), Hui Miao (Samsung Electronics Co., Ltd.), Thierry Michel (W3C/ERCIM), Frank Nack (University of Amsterdam), Soohong Daniel Park (Samsung Electronics Co., Ltd.), Silvia Pfeiffer (W3C Invited Experts), Chris Poppe (IBBT), Víctor Rodríguez (Universitat Politècnica de Catalunya), Felix Sasaki (Potsdam University of Applied Sciences), David Singer (Apple, Inc.), Joakim Söderberg (ERICSSON), Thai Wey Then (Apple, Inc.), Ruben Tous (Universitat Politècnica de Catalunya), Raphaël Troncy (Eurecom), Vassilis Tzouvaras (K-Space), Davy Van Deursen (IBBT).

The people who have contributed to discussions on public-media-annotation@w3.org are also gratefully acknowledged.