Copyright
©
2013
2011
W3C
®
(
MIT
,
ERCIM
,
Keio
,
Beihang
),
All
Rights
Reserved.
W3C
liability
,
trademark
and
document
use
rules
apply.
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
Proposed
Candidate
Recommendation
of
the
API
for
Media
Resources
1.0
specification
for
review
by
W3C
Members
and
other
interested
parties.
specification.
It has been produced by the Media Annotations Working Group , which is part of the W3C Video on the Web Activity . The Working Group expects to advance this specification to Recommendation Status.
W3C
Advisory
Committee
Representatives
are
invited
to
submit
their
formal
review
per
the
instructions
in
the
Call
for
Review
(see
Advisory
Committee
questionnaires
).
The
review
period
ends
on
15
May
2012.
Members
of
the
public
are
also
invited
to
Please
send
review
comments
on
about
this
Proposed
Candidate
Recommendation
to
the
public
mailing
list
public-media-annotation@w3.org
mailing
list
(
public
archive
).
Use
"[PR
"[CR
Comment
API]"
in
the
subject
line
of
your
email.
We
expect
that
sufficient
feedback
to
determine
its
future
will
have
been
received
by
31
December
2011.
This
specification
will
remain
a
Candidate
Recommendation
until
at
least
31
December
2011.
The Media Annotation Working Group will advance this specification to Proposed Recommendation when the following exit criteria have been met:
1. Sufficient reports of implementation experience have been gathered to demonstrate that the API features are implementable and are interpreted in a consistent manner. To do so, the Working Group will insure that all features in the API for Media Resources 1.0 specification have been implemented at least twice in an interoperable way. The following elements are considered features of the API and must be tested by the test suite:
The API is designed for both client- and server side implementations. Depending on whether the API is implemented in a user agent or plugin, or as a web service, different communication patterns are more appropriate. In the client side case, asynchronous access is typically preferred, while synchronous access is more appropriate for a web service. Thus the two version of the interface are not considered distinct features but different modes of access for the different use cases.
2. The implementations have been developed independently.
3.
The
Working
Group
has
adopted
a
public
test
suite
and
has
produced
an
implementation
report
for
this
API
for
Media
Resources
1.0,
showing
that
the
Candidate
Recommendation
exit
criteria
have
been
met
and
exceeded.
1.0.
This
document
The
Implementation
results
are
publicly
released
and
are
intended
solely
to
be
used
as
proof
of
Media
API
1.0
implementability.
It
is
based
upon
only
a
snap
shot
of
the
API
actual
implementation
behaviors
at
one
moment
of
time,
as
these
implementations
may
not
be
immediately
available
to
the
public.
The
interoperability
data
is
not
intended
to
be
used
for
Media
Resources
1.0
Candidate
Recommendation
assessing
or
grading
the
performance
of
22
November
2011.
Feedback
received
during
that
review
resulted
in
clarifications
any
individual
implementation.
Any
feedback
on
implementation
and
minor
changes,
but
no
major
changes.
The
Media
Annotations
Working
Group
believes
that
use
of
this
specification
addresses
all
Candidate
Recommendation
issues.
The
list
of
changes
made
since
would
be
very
welcome.
To
the
Candidate
Recommendation
extent
possible,
please
provide
a
separate
email
message
for
each
distinct
comment.
For convenience, the differences between this CR version and the Second Last Call Working Draft are highlighted in the CR Diff file and listed in the change log in Annexe B .
This W3C Working Draft version of the API for Media Resources 1.0 specification incorporates requests for changes from comments sent during the first and second Last Call Review, as agreed with the commenters (see Disposition of Last Call comments for Ontology for Media Resources 1.0 ) and changes following implementation experiences from the Working Group.
Publication
as
a
Proposed
Candidate
Recommendation
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 .
MediaResource
interface
AsyncMediaResource
interface
SyncMediaResource
interface
MediaAnnotation
interface
MetadataSource
interface
This
specification
defines
an
API
to
access
metadata
information
related
to
media
resources
on
the
Web.
The
overall
purpose
is
to
provide
developers
with
a
convenient
access
to
metadata
information
stored
in
different
metadata
formats.
The
core
properties
,
defined
in
the
Ontology
for
Media
Resources
1.0
specification
[
MEDIA-ONTOLOGY
],
specification,
will
be
used
as
a
pivot
vocabulary
in
this
API.
The
description
of
relations
between
these
core
properties
and
the
metadata
formats
in
scope
are
documented
in
the
Ontology
for
Media
Resources
1.0
specification
[
MEDIA-ONTOLOGY
]
specification
in
order
to
provide
cross-community
data
integration.
This
API
is
described
using
the
interface
definition
language
Web
IDL
[
WEBIDL
].
The
decision
to
use
Web
IDL,
which
offers
bindings
for
ECMAScript
and
Java,
is
can
be
based
on
the
Use
Cases
and
Requirements
for
Ontology
and
API
for
Media
Resources
1.0
[
MEDIA-ANNOT-REQS
].
This
API
defines
defines/exposes
interfaces
that
enables
users/applications
to
consume
metadata
in
an
interoperable
manner.
Interoperability
Here,
interoperability
between
metadata
formats
is
ensured
by
the
use
of
the
Ontology
for
Media
Resources
1.0
specification
[
MEDIA-ONTOLOGY
]
as
pivot
metadata
format.
This
API
offers
operations
to
request
particular
metadata
information
represented
in
a
certain
metadata
format
related
to
media
resources
on
the
Web.
Further
it
specifies
the
actual
representation
of
the
core
properties
and
the
behaviour
of
this
API.
Refers
to
the
formats
in
scope
of
the
Ontology
for
Media
Resources
1.0
specification
[
MEDIA-ONTOLOGY
].
.
Refers
to
the
Formats
out
of
scope
of
the
Ontology
for
Media
Resources
1.0
specification
[
MEDIA-ONTOLOGY
].
.
In
this
document
the
terms
"Ontology",
"Media
Resource",
"Property",
"Mapping"
and
"Property
value
types"
are
to
be
interpreted
as
defined
in
Section
2
of
the
Ontology
for
Media
Resources
1.0
specification
[
MEDIA-ONTOLOGY
].
.
In
addition
to
As
well
as
sections
marked
as
non-normative,
all
authoring
guidelines,
diagrams,
examples,
and
notes
in
this
specification
are
non-normative.
Everything
else
in
this
specification
is
normative.
The
keywords
key
words
must
,
must
not
,
required
,
should
,
should
not
,
recommended
,
may
,
and
optional
in
this
specification
are
to
be
interpreted
as
described
in
[
RFC2119
].
This
section
discusses
different
Before
introducing
the
two
example
usage
scenarios
that
led
to
design
of
this
API,
two
modes
of
operations
must
be
defined:
asynchronous
and
synchronous
mode.
For
this
API
the
API.
asynchronous
mode
is
considered
to
be
used
as
default
where
calls
return
without
waiting
for
the
request
to
finish
its
execution:
a
call-back
function
is
provided
to
be
invoked
when
the
request
terminates.
In
contrast
to
that,
the
synchronous
mode
implicates
an
immediate
answer
to
every
request.
We
consider
two
main
scenarios,
where
this
API
could
be
implemented
and
invoked:
implemented:
in
the
User
agent,
or
agent
as
a
client
accessing
a
Web
Service.
Service
In
both
client-only
and
client-server
cases
of
the
implementation,
the
media
resources
and/or
the
metadata
sources
are
in
many
cases
remote.
The
API
is
by
default
specified
as
an
asynchronous
API,
i.e.,
the
calls
are
not
blocking,
but
results
(or
errors)
are
returned
using
a
callback
mechanism.
In
order
to
better
support
the
Web
Service
case,
a
synchronous
mode
is
also
defined.
The
synchronous
mode
is
optional.
The
two
scenarios
are
shown
in
Figure
1.
Note:
This
specification
only
defines
the
this
API
for
Media
Resources.
Other
components
depicted
in
Figure
1
(e.g.,
access/extraction/storage
of
metadata)
are
not
covered.
In
both
scenarios,
the
this
API
serves
as
a
mediator
between
a
client
application
and
the
actual
metadata
sources.
Interoperability
is
ensured
by
defining
i)
operations
for
accessing
the
metadata
information,
ii)
a
common
object
structure
and
iii)
API
behaviour
(e.g.,
status
codes).
Following
this,
an
implementation
has
to
implement
this
stack
of
components:
An implementation of the API for Media Resources (as defined in this document), which provides the actual GETTER methods for the properties.
An
implementation
of
the
mappings
from
a
specific
source
format
to
the
core
properties.
Here,
the
API
for
Media
Resources
1.0
should
may
use
the
Ontology
for
Media
Resources
1.0
specification
[
MEDIA-ONTOLOGY
],
where
applicable.
specification.
A format specific API to access the metadata. This can be an API for retrieving a metadata document describing a media resource (e.g. an XML parser and a set of XPath statements) or an extractor to read metadata embedded in the media resource (e.g. a library to read EXIF information from JPEG images). In order to define the context in which this API is applied, at least a unidirectional reference from the media resource to the metadata document or vice versa is needed. If this is not the case such a reference needs to be provided by the web application (scenario 1), web service (scenario 2) or media repository (scenario 2).
Note that, this API provides access to metadata information stored in different metadata formats. As such, different instances of the same property can exist.
This API defines a number of interfaces using [ WEBIDL ]. These can be grouped in the following categories:
An
interface
Interfaces
defining
the
actual
retrieval
operations
for
metadata,
called
MediaResource
,
and
provided
in
both
synchronous
and
asynchronous
versions
(see
Section
4.1
,
Section
4.2
and
Section
4.3
)
An
interface
Interfaces
defining
the
data
structure
of
response
objects/metadata
annotations,
called
MediaAnnotation
and
its
specializations
(see
Section
4.4
and
Section
4.5
)
An
interface
interfaces
defining
a
data
structure
for
metadata
sources,
called
MetadataSource
(see
Section
4.6
)
Next,
the
different
interfaces
and
exposed
operations
(in
case
of
the
MediaResource
interfaces
and
its
implementing
interfaces)
are
discussed.
Implementations
of
this
API
must
support
asynchronous
mode
at
least
one
of
operation,
may
support
the
synchronous
one
versions
and
must
support
the
other
interfaces
defined
in
this
document.
Instead
of
exceptions,
We
have
not
specified
exceptions
on
the
operations
or
on
accessing
the
attributes.
Instead,
a
status
code
indicating
the
state
of
processing
(see
Section
4.7
)
is
returned
(in
the
synchronous
API)
or
provided
via
a
callback
function
can
be
accessed
(in
the
asynchronous
API)
in
case
an
error
occurs.
occurs
indicating
the
state
of
processing
(see
Section
4.7
).
Then,
the
interfaces
for
the
return
types,
i.e.,
MediaAnnotation
and
its
specializations,
and
MetadataSource
are
defined.
The IDL fragment in Appendix A of this specification must be interpreted as required for conforming IDL fragments, as described in the “Web IDL” specification. [ WEBIDL ]
MediaResource
interface
The
MediaResource
interface
is
the
core
of
this
API
and
provides
operations
to
access
the
metadata
properties
of
a
specific
media
resource.
Here,
a
clear
separation
between
asynchronous
and
synchronous
mode
of
operation
has
been
achieved
by
defining
two
implementing
interfaces
(derived
from
MediaResource),
interfaces,
the
AsyncMediaResource
and
the
SyncMediaResource
interface.
Objects
of
these
interfaces
will
be
created
by
calling
createMediaResource
of
the
MediaResource
interface.
The
actual
connection
to
a
specified
metadata
source
will
be
created
with
the
execution
of
the
getMediaProperty
operation
of
AsyncMediaResource
or
SyncMediaResource
interface.
The
mediaResource
argument
identifies
the
media
resource,
for
which
the
implementation
of
this
API
should
try
to
find
relevant
metadata
sources.
Optionally,
references
to
metadata
sources
can
be
passed
using
an
array
of
objects,
each
implementing
the
MetadataSource
interface
(see
Section
4.6
).
"idl-def-MediaResource">interface MediaResource {
"idlMethType">short getSupportedModes ();
"idlType" href=
"#idl-def-MediaResource">MediaResource
createMediaResource (DOMString mediaResource, optional MetadataSource
[] metadataSources, optional short mode);
};
createMediaResource
AsyncMediaResource
or
SyncMediaResource
interface.
Further,
it
allows
to
set
the
specific
media
resource
and
metadata
sources
to
which
this
API
is
applied.
Parameter | Type | Nullable | Optional | Description |
---|---|---|---|---|
mediaResource |
DOMString
|
✘ | ✘ | This attribute must set the specific media resource that should be processed by the API. |
metadataSources |
|
✘ | ✔ | This attribute should specify additional metadata sources. |
mode |
short
|
✘ | ✔ |
This
attribute
should
specify
the
desired
mode
of
operation.
1
for
asynchronous
and
2
for
synchronous
mode
should
be
used.
|
MediaResource
getSupportedModes
1
for
asynchronous,
2
for
synchronous
and
3
for
both
modes.
short
Example
for
getSupportedModes
:
ma = new MediaResource(); var mode "sh_symbol">= ma.getSupportedModes(); /** Resulting in: * { "supportedModes" : 3 }*/*/
Example
for
createMediaResource
:
metadataSources = new MetadataSource[2]; metadataSources[0] = new MetadataSource( "sh_string">"http://www.w3.org/2008/WebVideo/Annotations/drafts/metadata_formats/DC_example1.xml","dc"); metadataSources[1] = new MetadataSource( "sh_string">"http://www.w3.org/2008/WebVideo/Annotations/wiki/images/9/93/MAWG-Stockholm-20090626.JPG","exif");mediaResourcemediaResource = new MediaResource();aSyncObject metadataSourcesif "sh_symbol">(mediaResource.getSupportedModes() == 1 || mediaResource.getSupportedModes() == 3) { aSyncObject = mediaResource.createMediaResource( "sh_string">"http://www.w3.org/2008/WebVideo/Annotations/wiki/images/9/93/MAWG-Stockholm-20090626.JPG", metadataSources, 1);syncObject metadataSources }} "sh_keyword">else if (mediaResource.getSupportedModes() == 2 || mediaResource.getSupportedModes() == 3) { syncObject = mediaResource.createMediaResource( "sh_string">"http://www.w3.org/2008/WebVideo/Annotations/wiki/images/9/93/MAWG-Stockholm-20090626.JPG", metadataSources, 2); }
AsyncMediaResource
interface
The
AsyncMediaResource
interface
provides
a
number
of
operations
that
allow
accessing
the
metadata
of
a
media
resource.
This
interface
must
be
implemented.
By
calling
the
getMediaProperty
operation
with
the
argument
"title"
we
can
retrieve
the
title
of
the
corresponding
media
resource.
Next,
we
give
the
Web
IDL
description
of
the
AsyncMediaResource
interface
and
describe
the
different
operations
that
are
part
of
it.
The
mediaResource
argument
identifies
the
media
resource,
for
which
the
implementation
of
this
API
should
try
to
find
relevant
metadata
sources.
Optionally,
references
to
metadata
sources
can
be
passed
using
an
array
of
objects,
each
implementing
the
MetadataSource
interface.
This
interface
holds
an
URI
identifying
the
metadata
source
(metadataSource)
and
the
name
of
the
actual
metadata
format
(sourceFormat).
In
this
section
the
MediaAnnotations
interface
is
used
in
the
interface
definitions.
It
serves
as
a
container
to
hold
general
values
about
properties
enabling
an
iteration
over
a
set
of
different
properties.
Its
definition
explanation
can
be
found
in
Section
4.4
"idl-def-AsyncMediaResource">interface AsyncMediaResource : MediaResource
{
"idlMethType">void getMediaProperty (DOMString[] propertyNames, PropertyCallback
successCallback, ErrorCallback errorCallback, optional DOMString fragment, optional DOMString sourceFormat, optional DOMString language);
"idlMethType">void getOriginalMetadata (DOMString sourceFormat, MetadataCallback
successCallback, ErrorCallback errorCallback);
};
getMediaProperty
MediaAnnotation
interface,
described
in
Section
4.4
.
Depending
on
the
requested
property,
the
returned
objects
implement
a
different
subtypes
(inheriting
from
the
MediaAnnotation
interface).
Title
interface,
requesting
"creator"
results
in
objects
implementing
the
Creator
interface
and
so
on.
These
interfaces
are
described
in
Section
4.5
.
An
example
can
be
found
here
.
Parameter | Type | Nullable | Optional | Description |
---|---|---|---|---|
propertyNames |
DOMString
[]
|
✘ | ✘ | This argument identifies an array containing the properties for which the values need to be retrieved. For an empty array all properties carrying values will be retrieved. Optional arguments allow refining the request. |
successCallback |
|
✘ | ✘ |
This
argument
holds
a
callback
object
for
asynchronous
requests
to
the
property.
The
successCallback
object
implements
the
PropertyCallback
interface
and
holds
a
handleEvent
operation
that
needs
to
be
called
once
all
data
for
the
requested
property
is
gathered.
This
handleEvent
operation
needs
to
be
called
with
a
new
MediaAnnotation
array.
|
errorCallback |
ErrorCallback
|
✘ | ✘ |
This
argument
holds
a
callback
object
for
failure
of
asynchronous
requests
to
the
property.
The
errorCallback
object
implements
the
ErrorCallback
interface
and
holds
a
handleEvent
operation
that
needs
to
be
called
if
an
attempt
fails.
This
handleEvent
operation
needs
to
be
called
with
a
new
DOMString
representing
the
status
code
of
the
error
(see
Section
4.7
for
details).
|
fragment |
DOMString
|
✘ | ✔ | This argument contains a URI identifying the specific media fragment for which the metadata is requested. The URI must conform to the URI for Media Fragment [ MEDIA-FRAGMENTS ] specification. This parameter is optional. |
sourceFormat |
DOMString
|
✘ | ✔ |
This
argument
identifies
a
specific
metadata
format.
It
should
use
the
metadata
format
identifiers
defined
in
the
Ontology
for
Media
Resources
1.0
|
language |
DOMString
|
✘ | ✔ | This argument allows to identify the language of the metadata. Values for the metadata will only be returned if it is available in the specified language. Recommended best practice is to use BCP 47 [ BCP47 ]. This parameter is optional. |
void
getOriginalMetadata
Parameter | Type | Nullable | Optional | Description |
---|---|---|---|---|
sourceFormat |
DOMString
|
✘ | ✘ |
This
argument
identifies
a
specific
metadata
format.
It
should
use
the
metadata
format
identifiers
defined
in
the
Ontology
for
Media
Resources
1.0
|
successCallback |
|
✘ | ✘ |
This
argument
holds
a
callback
object
for
asynchronous
requests
for
the
original
metadata.
The
successCallback
object
implements
the
MetadataCallback
interface
and
holds
a
handleEvent
operation
that
needs
to
be
called
once
all
properties
having
values
are
listed.
This
handleEvent
operation
needs
to
be
called
with
a
new
DOMString
array
holding
the
original
metadata.
|
errorCallback |
ErrorCallback
|
✘ | ✘ |
This
argument
holds
a
callback
object
for
failure
of
asynchronous
requests
for
the
original
metadata.
The
errorCallback
object
implements
the
ErrorCallback
interface
and
holds
a
handleEvent
operation
that
needs
to
be
called
if
an
attempt
fails.
This
handleEvent
operation
needs
to
be
called
with
a
new
DOMString
representing
the
status
code
of
the
error
(see
Section
4.7
for
details).
|
void
PropertyCallback
interface
The
PropertyCallback
interface
holds
a
handleEvent
operation
that
needs
to
be
called
once
all
data
for
the
requested
property
has
been
gathered.
"idl-def-PropertyCallback">interface PropertyCallback {
"idlMethType">void handleEvent (MediaAnnotation
[] mediaAnnotations);
};
handleEvent
Parameter | Type | Nullable | Optional | Description |
---|---|---|---|---|
mediaAnnotations |
|
✘ | ✘ |
This
argument
holds
a
list
of
objects
with
values
according
to
the
requested
property.
These
objects
implement
the
MediaAnnotation
interface,
described
in
Section
4.4
.
Depending
on
the
requested
property,
the
returned
objects
implement
a
different
subtypes
(inheriting
from
the
MediaAnnotation
interface).
|
void
MetadataCallback
interface
The
MetadataCallback
interface
holds
a
handleEvent
operation
that
needs
to
be
called
once
the
requested
metadata
has
been
gathered.
"idl-def-MetadataCallback">interface MetadataCallback {
"idlMethType">void handleEvent (DOMString[] metadata);
};
handleEvent
Parameter | Type | Nullable | Optional | Description |
---|---|---|---|---|
metadata |
DOMString
[]
|
✘ | ✘ |
This
argument
holds
a
list
of
DOMStrings
representing
the
original
metadata.
Note
that,
multiple
metadata
instances
can
exist
(e.g.,
one
Dublin
|
void
Example
for
asynchronous
getMediaProperty
:
aSyncMediaResource = mediaResource.createMediaResource("http://www.imdb.com/title/tt0133152/", new Array(), 1); aSyncMediaResource.getMediaProperty(["title"], successCallback, errorCallback, "", "", ""); function "sh_function">successCallback(MediaAnnotation[] mediaAnnotations) { ... } /** Resulting in: * [ { "Title" : { "sh_comment"> * "propertyName" : "title", "sh_comment"> * "value" : "Planet of the apes", * "language" : en-us", * ... * "statusCode" : 200 * } * }, * { "Title" : { "sh_comment"> * "propertyName" : "title", "sh_comment"> * "value" : "Monkey Planet", * "language" : en-us", * ..., * "statusCode" : 200 * } * }, * { ... * } ] */ function "sh_function">errorCallback(DOMString error) { ... } /** Resulting in:*/"sh_comment"> * { error: { "statusCode" : 415 } } */
Example
for
asynchronous
getOriginalMetadata
:
aSyncMediaResource = mediaResource.createMediaResource( "sh_string">"http://www.w3.org/2008/WebVideo/Annotations/wiki/images/9/93/MAWG-Stockholm-20090626.JPG", "sh_keyword">new Array(), 1); aSyncMediaResource.getOriginalMetadata("dc", successCallback, errorCallback); function "sh_function">successCallback(DOMString[] metadata) { ... } /** Resulting in: * [ { "statusCode" : 200 * },"sh_comment"> * {"originalMetadata" : "<metadata xmlns='http://example.org/myapp/' * "sh_normal"> xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' * "sh_normal"> xsi:schemaLocation='http://example.org/myapp/ http://example.org/myapp/schema.xsd' * "sh_normal"> xmlns:dc='http://purl.org/dc/elements/1.1/'> "sh_comment"> * <dc:title>DC title</dc:title> "sh_comment"> * </metadata>" * } ] */ function "sh_function">errorCallback(DOMString error) { ... } /** Resulting in:*/"sh_comment"> * { error: { "statusCode" : 415 } } */
SyncMediaResource
interface
The
SyncMediaResource
interface
provides
a
number
of
operations
to
access
the
metadata
of
a
media
resource.
This
interface
may
be
implemented.
Next,
we
give
the
Web
IDL
description
of
the
SyncMediaResource
interface
for
synchronous
requests
and
describe
the
different
operations
that
are
part
of
it.
The
MediaResource
defines
a
constructor
that
can
be
called
to
construct
the
object
based
on
an
identifier
of
the
media
resource
and
optionally
some
metadata
sources.
The
mediaResource
argument
identifies
the
media
resource,
for
which
the
implementation
of
this
API
should
try
to
find
relevant
metadata
sources.
Optionally,
references
to
metadata
sources
can
be
passed
using
an
array
of
objects,
each
implementing
the
MetadataSource
interface.
This
interface
holds
two
attributes,
namely
an
URI
identifying
the
metadata
source
(
metadataSource
)
and
the
name
of
the
actual
metadata
format
(
sourceFormat
).
An
example,
how
to
create
this
object
can
be
found
here
.
"idl-def-SyncMediaResource">interface SyncMediaResource : MediaResource
{
"idlType" href=
"#idl-def-MediaAnnotation">MediaAnnotation
[] getMediaProperty (DOMString[] propertyNames, optional DOMString fragment, optional DOMString sourceFormat, optional DOMString language);
"idlMethType">DOMString[] getOriginalMetadata (DOMString sourceFormat);
};
getMediaProperty
MediaAnnotation
interface
(see
Section
4.3
).
Depending
on
the
requested
property,
the
returned
objects
implement
a
different
subtypes
(inheriting
from
the
MediaAnnotation
interface).
Title
interface,
requesting
"creator"
results
in
objects
implementing
the
Creator
interface
and
so
on.
These
subtypes
are
described
in
Section
4.4
.
The
operation
returns
a
MediaAnnotation
array
holding
the
requested
properties.
If
an
error
occurs
during
retrieval,
a
MediaAnnotation
object
with
the
corresponding
status
code
(e.g.,
400,
404
or
415)
will
be
generated
and
inserted
at
the
first
position
of
the
array.
An
example
can
be
found
here
.
In
this
section
the
MediaAnnotations
interface
is
used
in
the
interface
definitions.
It
serves
as
a
container
to
hold
general
values
about
properties
enabling
an
iteration
over
a
set
of
different
properties.
Its
explanation
can
be
found
in
Section
4.4
Parameter | Type | Nullable | Optional | Description |
---|---|---|---|---|
propertyNames |
DOMString
[]
|
✘ | ✘ | This argument holds the requested properties as an array. If the array is empty, each property holding values will be returned. |
fragment |
DOMString
|
✘ | ✔ |
This
argument
contains
a
URI
identifying
the
specific
media
fragment
for
which
the
metadata
is
requested.
The
URI
must
conform
to
the
URI
for
Media
|
sourceFormat |
DOMString
|
✘ | ✔ |
This
argument
identifies
a
specific
metadata
format.
It
should
use
the
metadata
format
identifiers
defined
in
the
Ontology
for
Media
Resources
1.0
|
language |
DOMString
|
✘ | ✔ | This argument allows to identify the language of the metadata. Values for the metadata will only be returned if it is available in the specified language. Recommended best practice is to use BCP 47 [ BCP47 ]. This parameter is optional. |
MediaAnnotation
[]
getOriginalMetadata
DOMString
array
holding
the
status
code
of
the
request
at
the
first
and
the
original
metadata
at
the
second
position.
An
example
can
be
found
here
.
Parameter | Type | Nullable | Optional | Description |
---|---|---|---|---|
sourceFormat |
DOMString
|
✘ | ✘ |
This
argument
identifies
a
specific
metadata
format.
It
should
use
the
metadata
format
identifiers
defined
in
the
Ontology
for
Media
Resources
1.0
|
DOMString
[]
The
examples
in
this
section
use
getMediaProperty()
to
get
an
object
implementing
the
MediaAnnotation
interface.
The
noErrorStatus
function
ensures
that
no
error
is
present
and
the
requested
properties
carry
values.
We
give
some
JavaScript
examples
on
how
to
use
the
synchronous
MediaResource
interface
and
it's
operations.
Example
for
synchronous
getMediaProperty
:
syncMediaResource = mediaResource.createMediaResource("http://www.imdb.com/title/tt0133152/", "sh_keyword">new Array(), 2); title = syncMediaResource.getMediaProperty(["title"], "", "", ""); if "sh_symbol">(noErrorStatus(title[0].statusCode) == true) { ..."sh_cbracket">} /** Resulting in: * [ { "Title" : { "sh_comment"> * "propertyName" : "title", "sh_comment"> * "value" : "Planet of the apes", * "language" : en-us", * ..., * "statusCode" : 200 * } * }, * { "Title" : { "sh_comment"> * "propertyName" : "title", "sh_comment"> * "value" : "Planet der Affen", * "language" : "de-de", * ..., * "statusCode" : 200 * } * }, * { ... * } ]*/*/
Example
for
synchronous
getOriginalMetadata
:
syncMediaResource = mediaResource.createMediaResource("http://www.w3.org/2008/WebVideo/Annotations/wiki/images/9/93/MAWG-Stockholm-20090626.JPG", "sh_keyword">new Array(), 2); dcMetadata = syncMediaResource.getOriginalMetadata("DC"); if "sh_symbol">(noErrorStatus(dcMetadata[0].statusCode) == true) { ... } /** Resulting in: * [ { "statusCode" : 200 * },"sh_comment"> * {"originalMetadata" : "<metadata xmlns='http://example.org/myapp/' * "sh_normal"> xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' * "sh_normal"> xsi:schemaLocation='http://example.org/myapp/ http://example.org/myapp/schema.xsd' * "sh_normal"> xmlns:dc='http://purl.org/dc/elements/1.1/'> "sh_comment"> * <dc:title>DC title</dc:title> "sh_comment"> * </metadata>" * } ]*/*/
MediaAnnotation
interface
MediaAnnotation
interface
is
used
as
the
return
type
of
MediaResource.getMediaProperty
operation.
It
is
a
container
for
holding
to
hold
general
values
about
metadata
properties
enabling
an
iteration
over
a
set
of
different
properties.
Depending
on
the
requested
property,
this
interface
will
be
enlarged
by
more
specific
attributes.
As
several
metadata
properties
are
defined
as
complex
types,
specific
derived
types
of
MediaAnnotation
have
been
defined,
adding
their
specific
attributes.
added
these
properties
with
the
appropriate
types.
However,
MediaAnnotation
can
be
used
as
a
generic
return
type
to
access
a
printable
string
representation
of
the
property
(in
the
value
attribute).
It
also
includes
a
status
code.
In
case
of
general
errors,
the
first
element
of
the
returned
MediaAnnotation
array
contains
the
global
error
code,
otherwise
the
status
can
be
given
for
each
of
the
returned
properties.
The
following
design
considerations
have
been
used
for
specifying
the
derived
interfaces
types
for
each
of
the
metadata
properties:
MediaAnnotation
,
adding
typed
attributes
according
to
the
specification
in
the
ontology
document.
value
with
a
printable
string
representation,
it
is
recommended
to
follow
these
steps:
value
a
string
that
is
found
in
another
URI|string
,
the
interface
shall
have
two
attributes,
one
with
"Link"
and
one
with
"Label"
appended
to
the
attribute
name,
representing
the
URI
and
string
respectively
MediaAnnotation
or
one
of
the
derived
interfaces
for
one
of
the
"idl-def-MediaAnnotation">interface MediaAnnotation {
attribute
"idlAttrType">DOMString propertyName;
attribute
"idlAttrType">DOMString value;
attribute
"idlAttrType">DOMString language;
attribute
"idlAttrType">DOMString sourceFormat;
attribute
"idlAttrType">DOMString fragmentIdentifier;
attribute
"idlAttrType">DOMString mappingType;
attribute
"idlAttrType">short statusCode;
};
fragmentIdentifier
of
type
DOMString
language
of
type
DOMString
mappingType
of
type
DOMString
propertyName
of
type
DOMString
sourceFormat
of
type
DOMString
statusCode
of
type
short
value
of
type
DOMString
The
noErrorStatus
function
ensures
that
no
error
is
present
and
the
requested
properties
carry
values.
The
MediaAnnotation
interface
will
be
never
instantiated
-
only
instances
of
the
derived
interfaces
implementing
subtypes
will
be
created.
These
must
be
filled
at
least
with
the
parameters
specified
in
the
MediaAnnotation
interface
and
may
be
filled
with
the
specific
attributes.
mediaAnnotation = image.getMediaProperty(["title"], "", "", "");if "sh_symbol">(noErrorStatus(mediaAnnotation[0].statusCode) == true) { ... } /** Resulting in: * [ { "Title" : { "sh_comment"> * "propertyName" : "title", "sh_comment"> * "value" : "Gone with the Wind", * "language" : "en-us", "sh_comment"> * "sourceFormat" : "mpeg7", "sh_comment"> * "fragmentIdentifier" : "http://www.example.com/video.ogv#t=10,20", "sh_comment"> * "mappingType" : "Exact match", * "statusCode" : 200 * }* } ]* } ]
This
section
describes
the
different
properties
that
can
be
requested
through
the
MediaResource.getMediaProperty()
operation.
When
invoking
this
operation,
objects
implementing
the
MediaAnnotation
interface
are
returned
that
represent
the
specified
property.
All
properties
are
represented
with
an
interface
inherited
from
the
MediaAnnotation
interface
(following
the
design
guidelines
described
above).
Several
of
the
following
return
type
interfaces
can
hold
the
value
of
the
property
as
both
URI
(i.e.,
a
pointer
to
a
controlled
vocabulary)
or
as
free
text.
The
URI
is
preferred,
and
the
respective
attribute
of
the
MediaAnnotation
interface
(or
specialized
type)
return
value
shall
be
filled
whenever
possible
(i.e.,
when
the
information
is
included
in
or
can
be
constructed
from
the
source
metadata).
In
the
following,
for
each
property,
a
(synchronous)
JavaScript
example
illustrates
the
usage
of
the
property
specific
attributes.
In
any
case,
the
general
genereal
attributes
of
the
MediaAnnotation
interface
could
be
also
requested.
When
the
MediaResource.getMediaProperty
operation
is
invoked
with
"identifier"
as
a
value
of
the
parameter,
an
object
implementing
the
propertyNames
propertyName
Identifier
interface
is
returned
representing
the
identifier
property
(defined
in
the
Ontology
for
Media
Resources
1.0
specification
[
MEDIA-ONTOLOGY
].
specification).
"idl-def-Identifier">interface Identifier : MediaAnnotation
{
attribute
"idlAttrType">DOMString identifierLink;
};
identifierLink
of
type
DOMString
id = image.getMediaProperty(["identifier"]); /** Resulting in: * [ { "Identifier" : { "sh_comment"> * "propertyName" : "identifier", "sh_comment"> * "identifierLink" : "urn:uuid:36a87260-1102-11df-8a39-0800200c9a66", * "statusCode" : 200 * } * } ]*/*/
When
the
MediaResource.getMediaProperty
operation
is
invoked
with
"title"
as
a
value
of
the
parameter,
an
object
implementing
the
propertyNames
propertyName
Title
interface
is
returned
representing
the
title
property
(defined
in
the
Ontology
for
Media
Resources
1.0
specification
[
MEDIA-ONTOLOGY
].
specification).
"idl-def-Title">interface Title : MediaAnnotation
{
attribute
"idlAttrType">DOMString titleLabel;
attribute
"idlAttrType">DOMString typeLink;
attribute
"idlAttrType">DOMString typeLabel;
};
title = song.getMediaProperty(["title"]); /** Resulting in: * [ { "Title" : { "sh_comment"> * "propertyName" : "title", "sh_comment"> * "titleLabel" : "Artificial Horizon" , "sh_comment"> * "typeLink" : "http://www.ebu.ch/metadata/cs/ebu_ObjectTypeCodeCS.xml#21", "sh_comment"> * "typeLabel" : "Album title", * "statusCode" : 200 * } * } ]*/*/
When
the
MediaResource.getMediaProperty
operation
is
invoked
with
"language"
as
a
value
of
the
parameter,
an
object
implementing
the
propertyNames
propertyName
Language
interface
is
returned
representing
the
language
property
(defined
in
the
Ontology
for
Media
Resources
1.0
specification
[
MEDIA-ONTOLOGY
].
specification).
"idl-def-Language">interface Language : MediaAnnotation
{
attribute
"idlAttrType">DOMString languageLink;
attribute
"idlAttrType">DOMString languageLabel;
};
languageLabel
of
type
DOMString
getMediaProperty
operation.
Recommended
best
practice
is
to
use
BCP
47
[
BCP47
].
languageLink
of
type
DOMString
language = video.getMediaProperty(["language"]); /** Resulting in: * [ { "Language" : { "sh_comment"> * "propertyName" : "language", "sh_comment"> * "languageLabel" : "en-us", * "statusCode" : 200 * } * } ]*/*/
When
the
MediaResource.getMediaProperty
operation
is
invoked
with
"locator"
as
a
value
of
the
parameter,
an
object
implementing
the
propertyNames
propertyName
Locator
interface
is
returned
representing
the
locator
property
(defined
inthe
in
the
Ontology
for
Media
Resources
1.0
specification
[
MEDIA-ONTOLOGY
].
specification).
"idl-def-Locator">interface Locator : MediaAnnotation
{
attribute
"idlAttrType">DOMString locatorLink;
};
locatorLink
of
type
DOMString
locator = image.getMediaProperty(["locator"]); /** Resulting in: * [ { "Locator" : { "sh_comment"> * "propertyName" : "locator", "sh_comment"> * "locatorLink" : "http://www.w3.org/2008/WebVideo/Annotations/wiki/images/9/93/MAWG-Stockholm-20090626.JPG", * "statusCode" : 200 * } * } ]*/*/
When
the
MediaResource.getMediaProperty
operation
is
invoked
with
"contributor"
as
a
value
of
the
parameter,
an
object
implementing
the
propertyNames
propertyName
Contributor
interface
is
returned
representing
the
contributor
property
(defined
in
the
Ontology
for
Media
Resources
1.0
specification
[
MEDIA-ONTOLOGY
].
specification).
"idl-def-Contributor">interface Contributor : MediaAnnotation
{
attribute
"idlAttrType">DOMString contributorLink;
attribute
"idlAttrType">DOMString contributorLabel;
attribute
"idlAttrType">DOMString roleLink;
attribute
"idlAttrType">DOMString roleLabel;
};
contributorLabel
of
type
DOMString
contributorLink
of
type
DOMString
roleLabel
of
type
DOMString
roleLink
of
type
DOMString
contributor = video.getMediaProperty(["contributor"]); /** Resulting in: * [ { "Contributor" : { "sh_comment"> * "propertyName" : "contributor", "sh_comment"> * "contributorLink" : "http://en.wikipedia.org/wiki/Tim_Burton", "sh_comment"> * "contributorLabel" : "Tim Burton", "sh_comment"> * "roleLink" : "http://www.imdb.com/name/nm0000318/", "sh_comment"> * "roleLabel" : "director", * "statusCode" : 200 * } * } ]*/*/
When
the
MediaResource.getMediaProperty
operation
is
invoked
with
"creator"
as
a
value
of
the
parameter,
an
object
implementing
the
propertyNames
propertyName
Creator
interface
is
returned
representing
the
creator
property
(defined
in
the
Ontology
for
Media
Resources
1.0
specification
[
MEDIA-ONTOLOGY
].
specification).
"idl-def-Creator">interface Creator : MediaAnnotation
{
attribute
"idlAttrType">DOMString creatorLink;
attribute
"idlAttrType">DOMString creatorLabel;
attribute
"idlAttrType">DOMString roleLink;
attribute
"idlAttrType">DOMString roleLabel;
};
creatorLabel
of
type
DOMString
creatorLink
of
type
DOMString
roleLabel
of
type
DOMString
roleLink
of
type
DOMString
creator = video.getMediaProperty(["creator"]); /** Resulting in: * [ { "Creator" : { "sh_comment"> * "propertyName" : "creator", "sh_comment"> * "creatorLink" : "http://dbpedia.org/resource/William_Shakespeare", "sh_comment"> * "creatorLabel" : "William Shakespeare", "sh_comment"> * "roleLink" : "http://www.ebu.ch/metadata/cs/ebu_RoleCodeCS.xml#22.5", "sh_comment"> * "roleLabel" : "playwright", * "statusCode" : 200 * } * } ]*/*/
When
the
MediaResource.getMediaProperty
operation
is
invoked
with
"date"
as
a
value
of
the
parameter,
an
object
implementing
the
propertyNames
propertyName
Date
interface
is
returned
representing
the
date
property
(defined
in
the
Ontology
for
Media
Resources
1.0
specification
[
MEDIA-ONTOLOGY
]).
specification).
This
property
has
been
renamed
from
"Date"
into
"MADate"
in
order
to
avoid
since
the
appearance
of
naming
conflicts
with
other
objects
named
"Date"
is
possible
in
web
applications.
"idl-def-MADate">interface MADate : MediaAnnotation
{
attribute
"idlAttrType">DOMString date;
attribute
"idlAttrType">DOMString typeLink;
attribute
"idlAttrType">DOMString typeLabel;
};
date
of
type
DOMString
typeLabel
of
type
DOMString
typeLink
of
type
DOMString
maDate = video.getMediaProperty(["date"]); /** Resulting in: * [ { "MADate" : { * "propertyName" : "date", "sh_comment"> * "date": "2009-06-26T15:30:00", "sh_comment"> * "typeLink" : "urn:smpte:ul:06.0E.2B.34.01.01.01.02.07.02.01.10.02.03.00.00", "sh_comment"> * "typeLabel" : "modification date", * "statusCode" : 200 * } * } ]*/*/
When
the
MediaResource.getMediaProperty
operation
is
invoked
with
"location"
as
a
value
of
the
parameter,
an
object
implementing
the
propertyNames
propertyName
Location
interface
is
returned
representing
the
location
property
(defined
inthe
in
the
Ontology
for
Media
Resources
1.0
specification
[
MEDIA-ONTOLOGY
]).
specification).
"idl-def-Location">interface Location : MediaAnnotation
{
attribute
"idlAttrType">DOMString locationLink;
attribute
"idlAttrType">DOMString locationLabel;
attribute
"idlAttrType">double longitude;
attribute
"idlAttrType">double latitude;
attribute
"idlAttrType">double altitude;
attribute
"idlAttrType">DOMString coordinateSystemLabel;
attribute
"idlAttrType">DOMString coordinateSystemLink;
};
altitude
of
type
double
coordiateSystem
coordinateSystemLabel
of
type
DOMString
coordinateSystemLink
of
type
DOMString
latitude
of
type
double
coordiateSystem
locationLabel
of
type
DOMString
locationLink
of
type
DOMString
longitude
of
type
double
coordiateSystem
location = video.getMediaProperty(["location"]); /** Resulting in: * [ { "Location" : { "sh_comment"> * "propertyName" : "location", "sh_comment"> * "locationLink" : "http://en.wikipedia.org/wiki/San_Jose,_California", "sh_comment"> * "locationLabel" : "San Jose", "sh_comment"> * "longitude" : 37.33986481118008, "sh_comment"> * "latitude" : -121.88507080078125, * "altitude" : 0, "sh_comment"> * "coordinateSystemLabel" : "WGS84", "sh_comment"> * "coordinateSystemLink" : "http://www.w3.org/2003/01/geo/wgs84_pos#Point", * "statusCode" : 200 * } * } ]*/*/
When
the
MediaResource.getMediaProperty
operation
is
invoked
with
"description"
as
a
value
of
the
parameter,
an
object
implementing
the
propertyNames
propertyName
Description
interface
is
returned
representing
the
description
property
(defined
in
the
Ontology
for
Media
Resources
1.0
specification
[
MEDIA-ONTOLOGY
]).
specification).
"idl-def-Description">interface Description : MediaAnnotation
{
attribute
"idlAttrType">DOMString descriptionLabel;
};
descriptionLabel
of
type
DOMString
description = image.getMediaProperty(["description"]); /** Resulting in: * [ { "Description" : { "sh_comment"> * "propertyName" : "description", "sh_comment"> * "descriptionLabel" : "Group picture of the W3C MAWG at the F2F meeting in Stockholm.", * "statusCode" : 200 * } * } ]*/*/
When
the
MediaResource.getMediaProperty
operation
is
invoked
with
"keyword"
as
a
value
of
the
parameter,
an
object
implementing
the
propertyNames
propertyName
Keyword
interface
is
returned
representing
the
keyword
property
(defined
in
the
Ontology
for
Media
Resources
1.0
specification
[
MEDIA-ONTOLOGY
]).
specification).
"idl-def-Keyword">interface Keyword : MediaAnnotation
{
attribute
"idlAttrType">DOMString keywordLabel;
attribute
"idlAttrType">DOMString keywordLink;
};
keyword = image.getMediaProperty(["keyword"]); /** Resulting in: * [ { "Keyword" : { "sh_comment"> * "propertyName" : "keyword", "sh_comment"> * "keywordLabel" : "meeting with people from outside the organisation", "sh_comment"> * "keywordLink" : "http://sw.opencyc.org/2008/06/10/concept/en/MeetingWithOrganizationalOutsiders", * "statusCode" : 200 * } * }, * { "Keyword" : { "sh_comment"> * "propertyName" : "keyword", "sh_comment"> * "keywordLabel" : "standardisation", "sh_comment"> * "keywordLink" : "http://purl.org/vocabularies/princeton/wn30/synset-standardization-noun-1", * "statusCode" : 200 * } * } ]*/*/
When
the
MediaResource.getMediaProperty
operation
is
invoked
with
"genre"
as
a
value
of
the
parameter,
an
object
implementing
the
propertyNames
propertyName
Genre
interface
is
returned
representing
the
genre
property
(defined
in
the
Ontology
for
Media
Resources
1.0
specification
[
MEDIA-ONTOLOGY
]).
specification).
"idl-def-Genre">interface Genre : MediaAnnotation
{
attribute
"idlAttrType">DOMString genreLabel;
attribute
"idlAttrType">DOMString genreLink;
};
genre = image.getMediaProperty(["genre"]); /** Resulting in: * [ { "Genre" : { "sh_comment"> * "propertyName" : "genre", * "genreLabel" : "Sports", "sh_comment"> * "genreLink" : "http://www.ebu.ch/metadata/cs/ebu_ContentGenreCS.xml#3.1.1.9" * "statusCode" : 200 * } * } ]*/*/
When
the
MediaResource.getMediaProperty
operation
is
invoked
with
"rating"
as
a
value
of
the
parameter,
an
object
implementing
the
propertyNames
propertyName
Rating
interface
is
returned
representing
the
rating
property
(defined
in
the
Ontology
for
Media
Resources
1.0
specification
[
MEDIA-ONTOLOGY
]).
specification).
"idl-def-Rating">interface Rating : MediaAnnotation
{
attribute
"idlAttrType">double ratingValue;
attribute
"idlAttrType">DOMString ratingSystemLabel;
attribute
"idlAttrType">DOMString ratingSystemLink;
attribute
"idlAttrType">double minimum;
attribute
"idlAttrType">double maximum;
};
maximum
of
type
double
minimum
of
type
double
ratingSystemLabel
of
type
DOMString
ratingSystemLink
of
type
DOMString
ratingValue
of
type
double
rating = image.getMediaProperty(["rating"]); /** Resulting in: * [ { "Rating" : { "sh_comment"> * "propertyName" : "rating", * "ratingValue" : 10.0, "sh_comment"> * "ratingSystemLabel" : "John Doe", "sh_comment"> * "ratingSystemLink" : "http://individuals.example.com/JohnDoe", * "minimum" : 0, "sh_comment"> * "maximum" : 10.0, * "statusCode" : 200 * } * } ]*/*/
When
the
MediaResource.getMediaProperty
operation
is
invoked
with
"relation"
as
a
value
of
the
parameter,
an
object
implementing
the
propertyNames
propertyName
Relation
interface
is
returned
representing
the
relation
property
(defined
in
the
Ontology
for
Media
Resources
1.0
specification
[
MEDIA-ONTOLOGY
]).
specification).
"idl-def-Relation">interface Relation : MediaAnnotation
{
attribute
"idlAttrType">DOMString targetLink;
attribute
"idlAttrType">DOMString targetLabel;
attribute
"idlAttrType">DOMString typeLink;
attribute
"idlAttrType">DOMString typeLabel;
};
targetLabel
of
type
DOMString
targetLink
of
type
DOMString
typeLabel
of
type
DOMString
typeLink
of
type
DOMString
relation = image.getMediaProperty(["relation"]); /** Resulting in: * [ { "Relation" : { "sh_comment"> * "propertyName" : "relation", "sh_comment"> * "targetLink" : "http://www.w3.org/2008/WebVideo/Annotations/wiki/Image:MAWG-Stockholm-20090626_thumb.JPG", "sh_comment"> * "targetLabel" : "Group picture of MAWG in Stockholm", "sh_comment"> * "typeLink" : "http://www.ebu.ch/metadata/cs/ebu_HowRelatedCS.xml#19", "sh_comment"> * "typeLabel" : "thumbnail", * "statusCode" : 200 * } * } ]*/*/
When
the
MediaResource.getMediaProperty
operation
is
invoked
with
"collection"
as
a
value
of
the
parameter,
an
object
implementing
the
propertyNames
propertyName
Collection
interface
is
returned
representing
the
collection
property
(defined
inthe
in
the
Ontology
for
Media
Resources
1.0
specification
[
MEDIA-ONTOLOGY
]).
specification).
"idl-def-Collection">interface Collection : MediaAnnotation
{
attribute
"idlAttrType">DOMString collectionLink;
attribute
"idlAttrType">DOMString collectionLabel;
};
collectionLabel
of
type
DOMString
collectionLink
of
type
DOMString
collection = image.getMediaProperty(["collection"]); /** Resulting in: * [ { "Collection" : { "sh_comment"> * "propertyName" : "collection", "sh_comment"> * "collectionLink" : "http://individuals.example.com/JohnDoe/myWorkPictures/", "sh_comment"> * "collectionLabel" : "My Work Pictures", * "statusCode" : 200 * } * } ]*/*/
When
the
MediaResource.getMediaProperty
operation
is
invoked
with
"copyright"
as
a
value
of
the
parameter,
an
object
implementing
the
propertyNames
propertyName
Copyright
interface
is
returned
representing
the
copyright
property
(defined
in
the
Ontology
for
Media
Resources
1.0
specification
[
MEDIA-ONTOLOGY
]).
specification).
"idl-def-Copyright">interface Copyright : MediaAnnotation
{
attribute
"idlAttrType">DOMString copyrightLabel;
attribute
"idlAttrType">DOMString holderLabel;
attribute
"idlAttrType">DOMString holderLink;
};
copyrightLabel
of
type
DOMString
holderLabel
of
type
DOMString
holderLink
of
type
DOMString
copyright = image.getMediaProperty(["copyright"]); /** Resulting in: * [ { "Copyright" : { "sh_comment"> * "propertyName" : "copyright", "sh_comment"> * "copyrightLabel" : "All images in the collection are copyrighted by John Doe.", "sh_comment"> * "holderLabel" : "John Doe", "sh_comment"> * "holderLink" : "http://individuals.example.com/JohnDoe", * "statusCode" : 200 * } * } ]*/*/
When
the
MediaResource.getMediaProperty
operation
is
invoked
with
"policy"
as
a
value
of
the
parameter,
an
object
implementing
the
propertyNames
propertyName
Policy
interface
is
returned
representing
the
policy
property
(defined
in
the
Ontology
for
Media
Resources
1.0
specification
[
MEDIA-ONTOLOGY
]).
specification).
"idl-def-Policy">interface Policy : MediaAnnotation
{
attribute
"idlAttrType">DOMString statementLink;
attribute
"idlAttrType">DOMString statementLabel;
attribute
"idlAttrType">DOMString typeLink;
attribute
"idlAttrType">DOMString typeLabel;
};
statementLabel
of
type
DOMString
statementLink
of
type
DOMString
typeLabel
of
type
DOMString
typeLink
of
type
DOMString
policy = image.getMediaProperty(["policy"]); /** Resulting in: * [ { "Policy" : { "sh_comment"> * "propertyName" : "policy", "sh_comment"> * "statementLink" : "http://creativecommons.org/licenses/by/2.5/", "sh_comment"> * "statementLabel" : "Attribution 2.5 Generic (CC BY 2.5)", "sh_comment"> * "typeLabel" : "license", * "statusCode" : 200 * } * } ]*/*/
When
the
MediaResource.getMediaProperty
operation
is
invoked
with
"publisher"
as
a
value
of
the
parameter,
an
object
implementing
the
propertyNames
propertyName
Publisher
interface
is
returned
representing
the
publisher
property
(defined
in
the
Ontology
for
Media
Resources
1.0
specification
[
MEDIA-ONTOLOGY
]).
specification).
"idl-def-Publisher">interface Publisher : MediaAnnotation
{
attribute
"idlAttrType">DOMString publisherLink;
attribute
"idlAttrType">DOMString publisherLabel;
};
publisher = image.getMediaProperty(["publisher"]); /** Resulting in: * [ { "Publisher" : { "sh_comment"> * "propertyName" : "publisher", "sh_comment"> * "publisherLabel" : "ACME", "sh_comment"> * "publisherLink" : "http://company.example.com/ACME", * "statusCode" : 200 * } * } ]*/*/
When
the
MediaResource.getMediaProperty
operation
is
invoked
with
"targetAudience"
as
a
value
of
the
parameter,
an
object
implementing
the
propertyNames
propertyName
TargetAudience
interface
is
returned
representing
the
targetAudience
property
(defined
in
the
Ontology
for
Media
Resources
1.0
specification
[
MEDIA-ONTOLOGY
]).
specification).
"idl-def-TargetAudience">interface TargetAudience : MediaAnnotation
{
attribute
"idlAttrType">DOMString audienceLink;
attribute
"idlAttrType">DOMString audienceLabel;
attribute
"idlAttrType">DOMString classificationSystemLink;
attribute
"idlAttrType">DOMString classificationSystemLabel;
};
audienceLabel
of
type
DOMString
audienceLink
of
type
DOMString
classificationSystemLabel
of
type
DOMString
classificationSystemLink
of
type
DOMString
targetAudience = image.getMediaProperty(["targetAudience"]); /** Resulting in: * [ { "TargetAudience" : { "sh_comment"> * "propertyName" : "targetAudience", "sh_comment"> * "audienceLink" : "http://www.mpaa.org/ratings/what-each-rating-means#NC-17", "sh_comment"> * "audienceLabel" : "No One 17 and Under Admitted", "sh_comment"> * "classificationSystemLink" : "http://www.mpaa.org/ratings", "sh_comment"> * "classificationSystemLabel" : "MPAA", * "statusCode" : 200 * } * } ]*/*/
When
the
MediaResource.getMediaProperty
operation
is
invoked
with
"fragment"
as
a
value
of
the
parameter,
an
object
implementing
the
propertyNames
propertyName
Fragment
interface
is
returned
representing
the
fragment
property
(defined
in
the
Ontology
for
Media
Resources
1.0
specification
[
MEDIA-ONTOLOGY
]).
specification).
"idl-def-Fragment">interface Fragment : MediaAnnotation
{
attribute
"idlAttrType">DOMString identifier;
attribute
"idlAttrType">DOMString roleLink;
attribute
"idlAttrType">DOMString roleLabel;
};
identifier
of
type
DOMString
roleLabel
of
type
DOMString
getMediaProperty
operation.
roleLink
of
type
DOMString
getMediaProperty
operation.
fragment = movie.getMediaProperty(["fragment"]); /** Resulting in: * [ { "Fragment" : { "sh_comment"> * "propertyName" : "fragment", "sh_comment"> * "identifier" : "http://www.example.com/video.ogv#t=10,20", "sh_comment"> * "roleLabel" : "chapter", * "statusCode" : 200 * } * } ]*/*/
When
the
MediaResource.getMediaProperty
operation
is
invoked
with
"namedFragment"
as
a
value
of
the
parameter,
an
object
implementing
the
propertyNames
propertyName
NamedFragment
interface
is
returned
representing
the
namedFragment
property
(defined
in
the
Ontology
for
Media
Resources
1.0
specification
[
MEDIA-ONTOLOGY
]).
specification).
"idl-def-NamedFragment">interface NamedFragment : MediaAnnotation
{
attribute
"idlAttrType">DOMString identifier;
attribute
"idlAttrType">DOMString label;
};
namedFragment = movie.getMediaProperty(["namedFragment"]); /** Resulting in: * [ { "NamedFragment" : { "sh_comment"> * "propertyName" : "namedFragment", "sh_comment"> * "identifier" : "http://www.example.com/video.ogv#t=30,35", * "label" : "kissScene", * "statusCode" : 200 * } * } ]*/*/
When
the
MediaResource.getMediaProperty
operation
is
invoked
with
"frameSize"
as
a
value
of
the
parameter,
an
object
implementing
the
propertyNames
propertyName
FrameSize
interface
is
returned
representing
the
frameSize
property
(defined
in
the
Ontology
for
Media
Resources
1.0
specification
[
MEDIA-ONTOLOGY
]).
specification).
"idl-def-FrameSize">interface FrameSize : MediaAnnotation
{
attribute
"idlAttrType">double width;
attribute
"idlAttrType">double height;
attribute
"idlAttrType">DOMString unit;
};
height
of
type
double
unit
of
type
DOMString
width
of
type
double
frameSize = image.getMediaProperty(["frameSize"]); /** Resulting in: * [ { "FrameSize" : { "sh_comment"> * "propertyName" : "framesize", * "width" : 3072, * "height" : 2304, "sh_comment"> * "unit" : "pixels", * "statusCode" : 200 * } * } ]*/*/
When
the
MediaResource.getMediaProperty
operation
is
invoked
with
"compression"
as
a
value
of
the
parameter,
an
object
implementing
the
propertyNames
propertyName
Compression
interface
is
returned
representing
the
compression
property
(defined
in
the
Ontology
for
Media
Resources
1.0
specification
[
MEDIA-ONTOLOGY
]).
specification).
"idl-def-FrameSize2">interface FrameSize : MediaAnnotation
{
attribute
"idlAttrType">DOMString compressionLink;
attribute
"idlAttrType">DOMString compressionLabel;
};
compression = video.getMediaProperty(["compression"]); /** Resulting in: * [ { "Compression" : { "sh_comment"> * "propertyName" : "compression", "sh_comment"> * "compressionLabel" : "H.264/AVC", "sh_comment"> * "compressionLink" : "urn:example-org:codingnames2010#ITU-H264", * "statusCode" : 200 * } * } ]*/*/
When
the
MediaResource.getMediaProperty
operation
is
invoked
with
"duration"
as
a
value
of
the
parameter,
an
object
implementing
the
propertyNames
propertyName
Duration
interface
is
returned
representing
the
duration
property
(defined
in
the
Ontology
for
Media
Resources
1.0
specification
[
MEDIA-ONTOLOGY
]).
specification).
"idl-def-Duration">interface Duration : MediaAnnotation
{
attribute
"idlAttrType">double duration;
};
duration
of
type
double
duration = video.getMediaProperty(["duration"]); /** Resulting in: * [ { "Duration" : { "sh_comment"> * "propertyName" : "duration", "sh_comment"> * "duration" : 3600, * "statusCode" : 200 * } * } ]*/*/
When
the
MediaResource.getMediaProperty
operation
is
invoked
with
"format"
as
a
value
of
the
parameter,
an
object
implementing
the
propertyNames
propertyName
Format
interface
is
returned
representing
the
format
property
(defined
in
the
Ontology
for
Media
Resources
1.0
specification
[
MEDIA-ONTOLOGY
]).
specification).
"idl-def-Format">interface Format : MediaAnnotation
{
attribute
"idlAttrType">DOMString formatLink;
attribute
"idlAttrType">DOMString formatLabel;
};
format = image.getMediaProperty(["format"]); /** Resulting in: * [ { "Format" : { "sh_comment"> * "propertyName" : "format", "sh_comment"> * "formatLabel" : "image/jpeg", "sh_comment"> * "formatLink" : "http://dbpedia.org/resource/JPEG", * "statusCode" : 200 * } * } ]*/*/
When
the
MediaResource.getMediaProperty
operation
is
invoked
with
"samplingRate"
as
a
value
of
the
parameter,
an
object
implementing
the
propertyNames
propertyName
SamplingRate
interface
is
returned
representing
the
samplingRate
property
(defined
in
the
Ontology
for
Media
Resources
1.0
specification
[
MEDIA-ONTOLOGY
]).
specification).
"idl-def-SamplingRate">interface SamplingRate : MediaAnnotation
{
attribute
"idlAttrType">double samplingRate;
};
samplingRate
of
type
double
samplingrate = audio.getMediaProperty(["samplingRate"]); /** Resulting in: * [ { "SamplingRate" : { "sh_comment"> * "propertyName" : "samplingRate", "sh_comment"> * "samplingRate" : 44100, * "statusCode" : 200 * } * } ]*/*/
When
the
MediaResource.getMediaProperty
operation
is
invoked
with
"frameRate"
as
a
value
of
the
parameter,
an
object
implementing
the
propertyNames
propertyName
FrameRate
interface
is
returned
representing
the
frameRate
property
(defined
inthe
in
the
Ontology
for
Media
Resources
1.0
specification
[
MEDIA-ONTOLOGY
]).
specification).
"idl-def-FrameRate">interface FrameRate : MediaAnnotation
{
attribute
"idlAttrType">double frameRate;
};
frameRate
of
type
double
framerate = video.getMediaProperty(["frameRate"]); /** Resulting in: * [ { "FrameRate" : { "sh_comment"> * "propertyName" : "frameRate", "sh_comment"> * "frameRate" : 30, * "statusCode" : 200 * } * } ]*/*/
When
the
MediaResource.getMediaProperty
operation
is
invoked
with
"averageBitRate"
as
a
value
of
the
parameter,
an
object
implementing
the
propertyNames
propertyName
AverageBitRate
interface
is
returned
representing
the
averageBitRate
property
(defined
in
the
Ontology
for
Media
Resources
1.0
specification
[
MEDIA-ONTOLOGY
]).
specification).
"idl-def-AverageBitRate">interface AverageBitRate : MediaAnnotation
{
attribute
"idlAttrType">double averageBitRate;
};
averageBitRate
of
type
double
bitrate = video.getMediaProperty(["averageBitRate"]); /** Resulting in: * [ { "AverageBitRate" : { "sh_comment"> * "propertyName" : "averageBitRate", "sh_comment"> * "averageBitRate" : 45.06, * "statusCode" : 200 * } * } ]*/*/
When
the
MediaResource.getMediaProperty
operation
is
invoked
with
"numTracks"
as
a
value
of
the
parameter,
an
object
implementing
the
propertyNames
propertyName
NumTracks
interface
is
returned
representing
the
numTracks
property
(defined
in
the
Ontology
for
Media
Resources
1.0
specification
[
MEDIA-ONTOLOGY
]).
specification).
"idl-def-NumTracks">interface NumTracks : MediaAnnotation
{
attribute
"idlAttrType">short number;
attribute
"idlAttrType">DOMString typeString;
};
numTracks = video.getMediaProperty(["numTracks"]); /** Resulting in: * [ { "NumTracks" : { "sh_comment"> * "propertyName" : "numTracks", * "number" : 2, "sh_comment"> * "typeString" : "audio", * "statusCode" : 200 * } * } ]*/*/
MetadataSource
interface
MetadataSource
interface
is
used
to
identify
other
metadata
sources.
"idl-def-MetadataSource">interface MetadataSource {
attribute
"idlAttrType">DOMString metadataSource;
attribute
"idlAttrType">DOMString sourceFormat;
};
metadataSource
of
type
DOMString
sourceFormat
of
type
DOMString
metadataSource = new MetadataSource ( "http://www.w3.org/2008/WebVideo/Annotations/drafts/metadata_formats/DC_example1.xml" , "dc" );metadataSources = new MetadataSource("http://www.w3.org/2008/WebVideo/Annotations/drafts/metadata_formats/DC_example1.xml","dc");
This section introduces a set of status codes for the defined API to indicate the system behavior. As described in section 4.4 , the status code is returned as one of the attributes of the MediaAnnotation object returned by a method call to the API. These status codes are used on the API level, and applied to either client side or server side implementations.
Later versions of this document may include additional status codes.
Numerical Code | Textual Description | Example |
---|---|---|
200 | OK | property delivered correctly |
204 | No Content | property retrieved without content |
206 | Partial Content | only a subset of the available data stored in the result set |
400 | Bad Request | syntactical error |
404 | Not Found | the queries resource is not found |
415 | Unsupported Media Type | get duration call on an image data store |
462 | Property not defined in Source Format | location is not defined in MediaRSS |
500 | Internal Server Error | internal library (e.g., extractor) crashes |
562 | Property not supported | a subset of properties implemented |
This
part
illustrates
some
examples
how
to
use
this
API
using
JavaScript
in
actual
implementations.
Moreover,
in
these
examples
it
is
assumed
that
the
implementation
of
this
API
knows
where
to
find
the
metadata
that
corresponds
to
a
specific
media
resource
(if
necessary
the
location
of
the
metadata
can
be
configured
by
the
use
of
the
MetadataSource
interface).
The
implementation
should
provide
the
mappings
of
different
metadata
formats
to
the
core
properties
of
the
Ontology
for
Media
Resources
1.0
specification
[
MEDIA-ONTOLOGY
]).
specification.
"sh_comment">//search the video array for the one with title "Apocalypse now" for "sh_symbol">(var i = 0; i < mediaResourceVideoArray.length; i++) {titles"sh_comment">//request for the titles of the video, the variable "titles" "sh_comment">//will be filled with an array of MediaAnnotation objects. titles = mediaResourceVideoArray[i].getMediaProperty(["title"], "", "", "");"sh_comment">//check if the request is finished correctly if "sh_symbol">(noErrorStatus(titles[0].statusCode) == true) {for "sh_symbol">(var j = 0; j < titles.length; j++) {"sh_comment">//check if the title matches if "sh_symbol">(titles[j].titleLabel == "Apocalypse Now") {tempResults"sh_comment">//request for the director of the video, the variable "results" "sh_comment">//will be filled with an array of MediaAnnotation objects. tempResults = mediaResourceVideoArray[i].getMediaProperty(["contributor"], "", "", "");resultfor "sh_symbol">(var k = 0; k < tempResults.length; k++) { if "sh_symbol">(tempResults[i].roleLabel == "director") { result = tempResults[i]; "sh_keyword">break; } } } } } } /** Resulting in: * [ { "Contributor" : { "sh_comment"> * "propertyName" : "contributor", "sh_comment"> * "value" : "Francis Ford Coppola", * ..., * "statusCode" = 200 * } * } ]*/*/
"sh_comment">//get the id of the second song using the fragments property tracks = albumMediaResource.getMediaProperty(["fragment"], "", "", ""); trackIdentifier = tracks[1].identifier;mediaResource syncMediaResource"sh_comment">//use this identifier to get the mediaResource object that represents the track mediaResource = new MediaResource(); if "sh_symbol">(mediaResource.getSupportedModes() == 2 || mediaResource.getSupportedModes() == 3) { syncMediaResource = mediaResource.createMediaResource(trackIdentifier, new Array(), 2); } //get the title of the tracktitletitle = syncMediaResource.getMediaProperty(["title"], "", "", ""); /** Resulting in: * [ { "Title" : { "sh_comment"> * "propertyName" : "title", "sh_comment"> * "value" : "I Still Haven't Found What I'm Looking For", * ..., "sh_comment"> * "statusCode" = 200 * } * } ]*/*/
genre = movie.getMediaProperty(["genre"], "", "", "en-us"); /** Resulting in: * [ { "Genre" : { "sh_comment"> * "propertyName" : "genre", * "value" : "Action", * ..., * "statusCode" = 200 * } * }, * { "Genre" : { "sh_comment"> * "propertyName" : "genre", * "value" : "Drama", * ..., * "statusCode" = 200 * } * }, * { ... * } ]*/*/
This
part
illustrates
how
this
API
could
be
implemented
using
web
services.
Note
that
that,
Web
IDL
currently
does
not
provide
bindings
for
web
services.
The
given
examples
correspond
to
the
examples
given
in
Section
4.5
for
each
property.
Request: http://example.com/my-media-resource/?getOriginalMetadata=DC
Response (JSON format):
[ "sh_cbracket">{ "statusCode" : "200" }, { "sh_string">"originalMetadata" : "<?xml version='1.0'?><metadata "sh_string"> xmlns='http://example.org/myapp/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' "sh_string"> xsi:schemaLocation='http://example.org/myapp/ http://example.org/myapp/schema.xsd' "sh_string"> xmlns:dc='http://purl.org/dc/elements/1.1/'><dc:title>DC title</dc:title></metadata>"} ]
The following examples illustrate how to request values for the different properties.
Request: http://example.com/my-media-resource/?ma-query=identifier
Response (JSON format):
[ "sh_cbracket">{ "Identifier" : { "propertyName" "sh_symbol">: "identifier", "sh_string">"identifierLink" : "urn:uuid:36a87260-1102-11df-8a39-0800200c9a66", "statusCode" "sh_symbol">: 200 }} ]} ]
Request: http://example.com/my-media-resource/?ma-query=title
Response (JSON format):
[ "sh_cbracket">{ "Title" : { "propertyName" "sh_symbol">: "title", "value" "sh_symbol">: "Artificial Horizon", "typeLink" "sh_symbol">: "http://www.ebu.ch/metadata/cs/ebu_ObjectTypeCodeCS.xml#21", "typeLabel" "sh_symbol">: "Album title", "statusCode" "sh_symbol">: 200 }} ]} ]
Request: http://example.com/my-media-resource/?ma-query=language
Response (JSON format):
[ "sh_cbracket">{ "Language" : { "propertyName" "sh_symbol">: "language", "languageLabel" "sh_symbol">: "en-us", "statusCode" "sh_symbol">: 200 }} ]} ]
Request: http://example.com/my-media-resource/?ma-query=locator
Response (JSON format):
[ "sh_cbracket">{ "Locator" : { "propertyName" "sh_symbol">: "locator", "locatorLink" "sh_symbol">: "http://www.w3.org/2008/WebVideo/Annotations/wiki/images/9/93/MAWG-Stockholm-20090626.JPG", "statusCode" "sh_symbol">: 200 }} ]} ]
Request: http://example.com/my-media-resource/?ma-query=contributor
Response (JSON format):
[ "sh_cbracket">{ "Contributor" : { "propertyName" "sh_symbol">: "contributor", "sh_string">"contributorLink" : "http://en.wikipedia.org/wiki/Tim_Burton", "sh_string">"contributorLabel" : "Tim Burton", "roleLink" "sh_symbol">: "http://www.imdb.com/name/nm0000318/", "roleLabel" "sh_symbol">: "director", "statusCode" "sh_symbol">: 200 }} ]} ]
Request: http://example.com/my-media-resource/?ma-query=creator
Response (JSON format):
[ "sh_cbracket">{ "Creator" : { "propertyName" "sh_symbol">: "creator", "creatorLink" "sh_symbol">: "http://dbpedia.org/resource/William_Shakespeare", "creatorLabel" "sh_symbol">: "William Shakespeare", "roleLink" "sh_symbol">: "http://www.ebu.ch/metadata/cs/ebu_RoleCodeCS.xml#22.5", "roleLabel" "sh_symbol">: "playwright", "statusCode" "sh_symbol">: 200 }} ]} ]
Request: http://example.com/my-media-resource/?ma-query=date
Response (JSON format):
[ "sh_cbracket">{ "MADate" : { "propertyName" "sh_symbol">: "date", "date" "sh_symbol">: "2009-06-26T15:30:00", "typeLink" "sh_symbol">: "urn:smpte:ul:06.0E.2B.34.01.01.01.02.07.02.01.10.02.03.00.00", "typeLabel" "sh_symbol">: "modification date", "statusCode" "sh_symbol">: 200 }} ]} ]
Request: http://example.com/my-media-resource/?ma-query=location
Response (JSON format):
[ "sh_cbracket">{ "Location" : { "propertyName" "sh_symbol">: "location", "locationLink" "sh_symbol">: "http://en.wikipedia.org/wiki/San_Jose,_California", "locationLabel" "sh_symbol">: "San Jose", "longitude" "sh_symbol">: 37.33986481118008, "latitude" "sh_symbol">: -121.88507080078125, "altitude" "sh_symbol">: 0, "sh_string">"coordinateSystemLabel" : "WGS84", "sh_string">"coordinateSystemLink" : "http://www.w3.org/2003/01/geo/wgs84_pos#Point", "statusCode" "sh_symbol">: 200 }} ]} ]
Request: http://example.com/my-media-resource/?ma-query=description
Response (JSON format):
[ "sh_cbracket">{ "Description" : { "propertyName" "sh_symbol">: "description", "sh_string">"descriptionLabel" : "Group picture of the W3C MAWG at the F2F meeting in Stockholm.", "statusCode" "sh_symbol">: 200 }} ]} ]
Request: http://example.com/my-media-resource/?ma-query=keyword
Response (JSON format):
[ "sh_cbracket">{ "Keyword" : { "propertyName" "sh_symbol">: "keyword", "keywordLabel" "sh_symbol">: "meeting with people from outside the organisation", "keywordLink" "sh_symbol">: "http://sw.opencyc.org/2008/06/10/concept/en/MeetingWithOrganizationalOutsiders", "statusCode" "sh_symbol">: 200 } },{ "sh_string">"Keyword" : { "propertyName" "sh_symbol">: "keyword", "keywordLabel" "sh_symbol">: "standardisation", "keywordLink" "sh_symbol">: "http://purl.org/vocabularies/princeton/wn30/synset-standardization-noun-1", "statusCode" "sh_symbol">: 200 }} ]} ]
Request: http://example.com/my-media-resource/?ma-query=genre
Response (JSON format):
[ "sh_cbracket">{ "Genre" : { "propertyName" "sh_symbol">: "genre", "genreLabel" "sh_symbol">: "Sports", "genreLink" "sh_symbol">: "http://www.ebu.ch/metadata/cs/ebu_ContentGenreCS.xml#3.1.1.9", "statusCode" "sh_symbol">: 200 }} ]} ]
Request: http://example.com/my-media-resource/?ma-query=rating
Response (JSON format):
[ "sh_cbracket">{ "Rating" : { "propertyName" "sh_symbol">: "rating", "ratingValue" "sh_symbol">: 10.0, "sh_string">"ratingSystemLabel" : "John Doe", "sh_string">"ratingSystemLink" : "http://individuals.example.com/JohnDoe", "minimum" "sh_symbol">: 0, "maximum" "sh_symbol">: 10.0, "statusCode" "sh_symbol">: 200 }} ]} ]
Request: http://example.com/my-media-resource/?ma-query=relation
Response (JSON format):
[ "sh_cbracket">{ "Relation" : { "propertyName" "sh_symbol">: "relation", "targetLink" "sh_symbol">: "http://www.w3.org/2008/WebVideo/Annotations/wiki/Image:MAWG-Stockholm-20090626_thumb.JPG", "targetLabel" "sh_symbol">: "Group picture of MAWG in Stockholm", "typeLink" "sh_symbol">: "http://www.ebu.ch/metadata/cs/ebu_HowRelatedCS.xml#19", "typeLabel" "sh_symbol">: "thumbnail", "statusCode" "sh_symbol">: 200 }} ]} ]
Request: http://example.com/my-media-resource/?ma-query=collection
Response (JSON format):
[ "sh_cbracket">{ "Collection" : { "propertyName" "sh_symbol">: "collection", "sh_string">"collectionLink" : "http://individuals.example.com/JohnDoe/myWorkPictures/", "sh_string">"collectionLabel" : "My Work Pictures", "statusCode" "sh_symbol">: 200 }} ]} ]
Request: http://example.com/my-media-resource/?ma-query=copyright
Response (JSON format):
[ "sh_cbracket">{ "Copyright" : { "propertyName" "sh_symbol">: "copyright", "sh_string">"copyrightLabel" : "All images in the collection are copyrighted by John Doe.", "holderLabel" "sh_symbol">: "John Doe", "holderLink" "sh_symbol">: "http://individuals.example.com/JohnDoe", "statusCode" "sh_symbol">: 200 }} ]} ]
Request: http://example.com/my-media-resource/?ma-query=policy
Response (JSON format):
[ "sh_cbracket">{ "Policy" : { "propertyName" "sh_symbol">: "policy", "statementLink" "sh_symbol">: "http://creativecommons.org/licenses/by/2.5/", "sh_string">"statementLabel" : "Attribution 2.5 Generic (CC BY 2.5)", "typeLabel" "sh_symbol">: "license", "statusCode" "sh_symbol">: 200 }} ]} ]
Request: http://example.com/my-media-resource/?ma-query=publisher
Response (JSON format):
[ "sh_cbracket">{ "Publisher" : { "propertyName" "sh_symbol">: "publisher", "sh_string">"publisherLabel" : "ACME", "publisherLink" "sh_symbol">: "http://company.example.com/ACME", "statusCode" "sh_symbol">: 200 }} ]} ]
Request: http://example.com/my-media-resource/?ma-query=targetAudience
Response (JSON format):
[ "sh_cbracket">{ "TargetAudience" : { "propertyName" "sh_symbol">: "targetAudience", "audienceLink" "sh_symbol">: "http://www.mpaa.org/ratings/what-each-rating-means#NC-17", "audienceLabel" "sh_symbol">: "No One 17 and Under Admitted", "sh_string">"classificationSystemLink" : "http://www.mpaa.org/ratings", "sh_string">"classificationSystemLabel" : "MPAA", "statusCode" "sh_symbol">: 200 }} ]} ]
Request: http://example.com/my-media-resource/?ma-query=fragment
Response (JSON format):
[ "sh_cbracket">{ "Fragment" : { "propertyName" "sh_symbol">: "fragment", "identifier" "sh_symbol">: "http://www.example.com/video.ogv#t=10,20", "roleLabel" "sh_symbol">: "chapter", "statusCode" "sh_symbol">: 200 }} ]} ]
Request: http://example.com/my-media-resource/?ma-query=namedFragment
Response (JSON format):
[ "sh_cbracket">{ "NamedFragment" : { "propertyName" "sh_symbol">: "namedFragment", "label" "sh_symbol">: "kissScene", "identifier" "sh_symbol">: "http://www.example.com/video.ogv#t=30,35", "statusCode" "sh_symbol">: 200 }} ]} ]
Request: http://example.com/my-media-resource/?ma-query=frameSize
Response (JSON format):
[ "sh_cbracket">{ "FrameSize" : { "propertyName" "sh_symbol">: "framesize", "width" "sh_symbol">: 3072, "height" "sh_symbol">: 2304, "unit" "sh_symbol">: "pixels", "statusCode" "sh_symbol">: 200 }} ]} ]
Request: http://example.com/my-media-resource/?ma-query=compression
Response (JSON format):
[ "sh_cbracket">{ "Compression" : { "propertyName" "sh_symbol">: "compression", "sh_string">"compressionLabel" : "H.264/AVC", "sh_string">"urn:example-org:codingnames2010#ITU-H264", "statusCode" "sh_symbol">: 200 }} ]} ]
Request: http://example.com/my-media-resource/?ma-query=duration
Response (JSON format):
[ "sh_cbracket">{ "Duration" : { "propertyName" "sh_symbol">: "duration", "duration" "sh_symbol">: 3600, "statusCode" "sh_symbol">: 200 }} ]} ]
Request: http://example.com/my-media-resource/?ma-query=format
Response (JSON format):
[ "sh_cbracket">{ "Format" : { "propertyName" "sh_symbol">: "format", "formatLabel" "sh_symbol">: "image/jpeg", "formatLink" "sh_symbol">: "http://dbpedia.org/resource/JPEG", "statusCode" "sh_symbol">: 200 }} ]} ]
Request: http://example.com/my-media-resource/?ma-query=samplingRate
Response (JSON format):
[ "sh_cbracket">{ "SamplingRate" : { "propertyName" "sh_symbol">: "samplingRate", "samplingRate" "sh_symbol">: 44100, "statusCode" "sh_symbol">: 200 }} ]} ]
Request: http://example.com/my-media-resource/?ma-query=frameRate
Response (JSON format):
[ "sh_cbracket">{ "FrameRate" : { "propertyName" "sh_symbol">: "frameRate", "frameRate" "sh_symbol">: 30, "statusCode" "sh_symbol">: 200 }} ]} ]
Request: http://example.com/my-media-resource/?ma-query=averageBitRate
Response (JSON format):
[ "sh_cbracket">{ "AverageBitRate" : { "propertyName" "sh_symbol">: "averageBitRate", "sh_string">"averageBitRate" : 45.06, "statusCode" "sh_symbol">: 200 }} ]} ]
Request: http://example.com/my-media-resource/?ma-query=numTracks
Response (JSON format):
[ "sh_cbracket">{ "NumTracks" : { "propertyName" "sh_symbol">: "numTracks", "number" "sh_symbol">: 2, "typeString" "sh_symbol">: "audio", "statusCode" "sh_symbol">: 200 }} ]} ]
This specification defines a API to access metadata information related to media resources on the Web. These APIs will provide means for requesting metadata information, which can already be accessed in one or different formats, either as separate document or embedded in media resources. As such, this API introduces no additional security issue.
One should nevertheless note that some metadata could be used to access personal information about someone without declaration of agreement. For example, temporal and geographic information about a media resource could indirectly provide information about its creator.
There are related activities and technical documents in W3C working on this topics, such as Policy Requirements [ POLICY-REQS ] in DAP WG, ODRL 1.1 [ ODRL11 ], P3P 1.1 [ P3P11 ] and PLING Wiki [ PLING-WIKI ].
Follow this link to download the WebIDL description as IDL file.
module mawg {interface PropertyCallback { void handleEvent (MediaAnnotation[] mediaAnnotations); };interface MediaResource { short getSupportedModes(); MediaResource createMediaResource(in DOMString mediaResource, in optional MetadataSource[] metadataSources, in optional short mode); };interface MetadataCallback { void handleEvent (DOMString[] metadata); };interface AsyncMediaResource : MediaResource { void getMediaProperty(in DOMString[] propertyNames, in PropertyCallback successCallback, in ErrorCallback errorCallback, in optional DOMString fragment, in optional DOMString sourceFormat, in optional DOMString language ); void getOriginalMetadata (in DOMString sourceFormat, in MetadataCallback successCallback, in ErrorCallback errorCallback); };interface ErrorCallback { void handleEvent (DOMString errorStatus); };interface PropertyCallback { void handleEvent (in MediaAnnotation[] mediaAnnotations); };interface SyncMediaResource : MediaResource { MediaAnnotation[] getMediaProperty(DOMString[] propertyNames, optional DOMString fragment, optional DOMString sourceFormat, optional DOMString language); DOMString[] getOriginalMetadata (DOMString sourceFormat); };interface MetadataCallback { void handleEvent (in DOMString[] metadata); };interface MetadataSource { attribute DOMString metadataSource; attribute DOMString sourceFormat; };interface ErrorCallback { void handleEvent (in DOMString errorStatus); }; interface SyncMediaResource : MediaResource { MediaAnnotation[] getMediaProperty(in DOMString[] propertyNames, in optional DOMString fragment, in optional DOMString sourceFormat, in optional DOMString language); DOMString[] getOriginalMetadata (in DOMString sourceFormat); }; interface MetadataSource { attribute DOMString metadataSource; attribute DOMString sourceFormat; }; interface MediaAnnotation { attribute DOMString propertyName; attribute DOMString value; attribute DOMString language; attribute DOMString sourceFormat; attribute DOMString fragmentIdentifier; attribute DOMString mappingType; attribute short statusCode; };interface MediaAnnotation { attribute DOMString propertyName; attribute DOMString value; attribute DOMString language; attribute DOMString sourceFormat; attribute DOMString fragmentIdentifier; attribute DOMString mappingType; attribute short statusCode; };interface Identifier : MediaAnnotation { attribute DOMString identifierLink; };interface Identifier : MediaAnnotation { attribute DOMString identifierLink; };interface Title : MediaAnnotation { attribute DOMString titleLabel; attribute DOMString typeLink; attribute DOMString typeLabel; };interface Title : MediaAnnotation { attribute DOMString titleLabel; attribute DOMString typeLink; attribute DOMString typeLabel; };interface Language : MediaAnnotation { attribute DOMString languageLink; attribute DOMString languageLabel; };interface Language : MediaAnnotation { attribute DOMString languageLink; attribute DOMString languageLabel; };interface Locator : MediaAnnotation { attribute DOMString locatorLink; };interface Locator : MediaAnnotation { attribute DOMString locatorLink; };interface Contributor : MediaAnnotation { attribute DOMString contributorLink; attribute DOMString contributorLabel; attribute DOMString roleLink; attribute DOMString roleLabel; };interface Contributor : MediaAnnotation { attribute DOMString contributorLink; attribute DOMString contributorLabel; attribute DOMString roleLink; attribute DOMString roleLabel; };interface Creator : MediaAnnotation { attribute DOMString creatorLink; attribute DOMString creatorLabel; attribute DOMString roleLink; attribute DOMString roleLabel; };interface Creator : MediaAnnotation { attribute DOMString creatorLink; attribute DOMString creatorLabel; attribute DOMString roleLink; attribute DOMString roleLabel; };interface MADate : MediaAnnotation { attribute DOMString date; attribute DOMString typeLink; attribute DOMString typeLabel; };interface MADate : MediaAnnotation { attribute DOMString date; attribute DOMString typeLink; attribute DOMString typeLabel; };interface Location : MediaAnnotation { attribute DOMString locationLink; attribute DOMString locationLabel; attribute double longitude; attribute double latitude; attribute double altitude; attribute DOMString coordinateSystemLabel; attribute DOMString coordinateSystemLink; };interface Location : MediaAnnotation { attribute DOMString locationLink; attribute DOMString locationLabel; attribute double longitude; attribute double latitude; attribute double altitude; attribute DOMString coordinateSystemLabel; attribute DOMString coordinateSystemLink; };interface Description : MediaAnnotation { attribute DOMString descriptionLabel; };interface Description : MediaAnnotation { attribute DOMString descriptionLabel; };interface Keyword : MediaAnnotation { attribute DOMString keywordLink; attribute DOMString keywordLabel; };interface Keyword : MediaAnnotation { attribute DOMString keywordLink; attribute DOMString keywordLabel; };interface Genre : MediaAnnotation { attribute DOMString genreLink; attribute DOMString genreLabel; };interface Genre : MediaAnnotation { attribute DOMString genreLink; attribute DOMString genreLabel; };interface Rating : MediaAnnotation { attribute double ratingValue; attribute DOMString ratingSystemLink; attribute DOMString ratingSystemLabel; attribute double min; attribute double max; };interface Rating : MediaAnnotation { attribute double ratingValue; attribute DOMString ratingSystemLink; attribute DOMString ratingSystemLabel; attribute double min; attribute double max; };interface Relation : MediaAnnotation { attribute DOMString targetLink; attribute DOMString targetLabel; attribute DOMString typeLink; attribute DOMString typeLabel; };interface Relation : MediaAnnotation { attribute DOMString targetLink; attribute DOMString targetLabel; attribute DOMString typeLink; attribute DOMString typeLabel; };interface Collection : MediaAnnotation { attribute DOMString collectionLink; attribute DOMString collectionLabel; };interface Collection : MediaAnnotation { attribute DOMString collectionLink; attribute DOMString collectionLabel; };interface Copyright : MediaAnnotation { attribute DOMString copyrightLabel; attribute DOMString holderLink; attribute DOMString holderLabel; };interface Copyright : MediaAnnotation { attribute DOMString copyrightLabel; attribute DOMString holderLink; attribute DOMString holderLabel; };interface Policy : MediaAnnotation { attribute DOMString statementLink; attribute DOMString statementLabel; attribute DOMString typeLink; attribute DOMString typeLabel; };interface Policy : MediaAnnotation { attribute DOMString statementLink; attribute DOMString statementLabel; attribute DOMString typeLink; attribute DOMString typeLabel; };interface Publisher : MediaAnnotation { attribute DOMString publisherLink; attribute DOMString publisherLabel; };interface Publisher : MediaAnnotation { attribute DOMString publisherLink; attribute DOMString publisherLabel; };interface TargetAudience : MediaAnnotation { attribute DOMString audienceLink; attribute DOMString audienceLabel; attribute DOMString classificationSystemLink; attribute DOMString classificationSystemLabel; };interface TargetAudience : MediaAnnotation { attribute DOMString audienceLink; attribute DOMString audienceLabel; attribute DOMString classificationSystemLink; attribute DOMString classificationSystemLabel; };interface Fragment : MediaAnnotation { attribute DOMString identifier; attribute DOMString roleLink; attribute DOMString roleLabel; };interface Fragment : MediaAnnotation { attribute DOMString identifier; attribute DOMString roleLink; attribute DOMString roleLabel; };interface NamedFragment : MediaAnnotation { attribute DOMString identifier; attribute DOMString label; };interface NamedFragment : MediaAnnotation { attribute DOMString identifier; attribute DOMString label; };interface FrameSize : MediaAnnotation { attribute double width; attribute double height; attribute DOMString unit; };interface FrameSize : MediaAnnotation { attribute double width; attribute double height; attribute DOMString unit; };interface Compression : MediaAnnotation { attribute DOMString compressionLink; attribute DOMString compressionLabel; };interface Compression : MediaAnnotation { attribute DOMString compressionLink; attribute DOMString compressionLabel; };interface Duration : MediaAnnotation { attribute double duration; };interface Duration : MediaAnnotation { attribute double duration; };interface Format : MediaAnnotation { attribute DOMString formatLink; attribute DOMString formatLabel; };interface Format : MediaAnnotation { attribute DOMString formatLink; attribute DOMString formatLabel; };interface SamplingRate : MediaAnnotation { attribute double samplingRate; };interface SamplingRate : MediaAnnotation { attribute double samplingRate; };interface FrameRate : MediaAnnotation { attribute double frameRate; };interface FrameRate : MediaAnnotation { attribute double frameRate; };interface AverageBitRate : MediaAnnotation { attribute double averageBitRate; };interface AverageBitRate : MediaAnnotation { attribute double averageBitRate;interface NumTracks : MediaAnnotation { attribute short number; attribute DOMString typeString; }; };interface NumTracks : MediaAnnotation { attribute short number; attribute DOMString typeString; };
Note:
The
following
subsections
lists
all
significant
changes
applied
to
the
API
for
Media
Resources
1.0
specification
received
in
CR.
--
editorial
changes
---
Updated
References
Added
Media
Ontology
Rec
Normative
ref
and
linked
all
references
to
it.
Corrected
wrong
error
code
(200
instead
of
415
in
section
4.2.3
Examples
in
Javascript
Multiples
editing
mis
wording.
Added
section
6.
Implementation-Notes
Note:
The
following
subsections
lists
all
significant
changes
applied
to
the
API
for
Media
Resources
1.0
specification
received
in
LC.
-- General changes ---
---[LC 2406] 2001-09-10 ---
---[LC 2410] 2001-09-10 ---
---[LC 2419] 2001-09-10 ---
---[LC 2394] 2001-09-10 ---
The following subsection lists all significant changes applied to the API for Media Resources 1.0 specification. These have been decided during the 10th Face-to-face meeting hosted by Apple in Silicon Valley, Ca, USA.
The following subsection lists all significant changes applied to the API for Media Resources 1.0 specification. These have been decided during the 12th Face-to-face meeting hosted by JOANNEUM, Graz, Austria.
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 (JOANNEUM RESEARCH), Tobias Bürger ((public) Invited expert), Eric Carlson (Apple, Inc.), Pierre-Antoine Champin (Université de Lyon), Ashish Chawla ((public) Invited expert), Jaime Delgado (Universitat Politècnica de Catalunya), Jean-Pierre Evain ((public) Invited expert), Martin Höffernig (JOANNEUM RESEARCH), Philip Jägenstedt (Opera Software), Ralf Klamma ((public) Invited expert), WonSuk Lee (Samsung Electronics Co., Ltd.), 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), Victor Rodríguez (Universitat Politècnica de Catalunya), Felix Sasaki (Potsdam University of Applied Sciences), David Singer (Apple, Inc.), Florian Stegmaier ((public) Invited expert), John Strassner ((public) Invited expert), Joakim Söderberg (ERICSSON), Mari Carmen Suárez-Figueroa ((public) Invited expert) 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.