W3C home > Mailing lists > Public > public-media-annotation@w3.org > February 2011

Representation of Media Ontology

From: Bailer, Werner <werner.bailer@joanneum.at>
Date: Wed, 16 Feb 2011 23:35:03 +0100
To: "public-media-annotation@w3.org" <public-media-annotation@w3.org>
Message-ID: <CD9846F872C7874BB4E0FDF2A61EF09F965B789375@RZJC1EX.jr1.local>
Dear all,

Following the discussion on redefining the attributes of some properties we have concluded that it makes sense to define a normative object representation (preferably using JSON), similar to a normative RDF implementation. Below is a proposal of how this representation could look like, which would of course be part of the API specification (i.e. the return types).

Feedback on this proposal is welcome.

Another mail with a summary of changes to be done in the API document will follow.

Best regards,
Werner



Generic return type:

- there is a generic value attribute (see description below)
- statusCode has been added following the proposal from Pierre-Antoine following up Florian's mail on API issues

[NoInterfaceObject]
interface MediaAnnotation {
    attribute DOMString propertyName;
    attribute DOMString value;
    attribute DOMString language;
    attribute DOMString sourceFormat;
    attribute DOMString fragmentIdentifier;
    attribute DOMString mappingType;
 attribute int  statusCode;
};

Approach for mapping to ontology to objects:

- for all properties, an interface is derived from MediaAnnotation, adding typed attributes according to the specification in the ontology document
- the API MUST fill "value" with a printable string representation, it is recommended to follow these steps
  - use a name/label if present
  - create a string from the values of the set of attributes (e.g. numeric values)
  - for a URI:
    - if a URI identifies a value known by the API, use the appropriate label
    - dereference a URI to obtain a label, if possible
    - return the URI
- this approach possibly duplicates in "value" a string that is found in another attribute. This is considered an acceptable amount of redundancy for the benefit of having a generic value field for all properties that can be used regardless of the specific property and data type of the attributes.
- if an attribute has type "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
- for consistency, this approach is also followed if the property has only a single attribute
- this approach allows for user extensions by deriving from MediaAnnotation or one of the derived interfaces for one of the properties

Derived return types:

Note: as there is no URI data type in WebIDL, URIs will be listed as DOMString, the documentation of the interface must specify the expected type

[NoInterfaceObject]
interface Identifier : MediaAnnotation {
    attribute DOMString identifierLink;
};

[NoInterfaceObject]
interface Title : MediaAnnotation {
    attribute DOMString titleLabel;
 attribute DOMString typeLink;
 attribute DOMString typeLabel;
};

[NoInterfaceObject]
interface Title : MediaAnnotation {
  attribute DOMString titleLabel; 
 attribute DOMString typeLink;
 attribute DOMString typeLabel;
};

[NoInterfaceObject]
interface Language : MediaAnnotation {
    attribute DOMString languageLink;
 attribute DOMString languageLabel;
};

[NoInterfaceObject]
interface Locator : MediaAnnotation {
    attribute DOMString locatorLink;
};

[NoInterfaceObject]
interface Contributor : MediaAnnotation {
    attribute DOMString contributorLink;
    attribute DOMString contributorLabel;
    attribute DOMString roleLink;
    attribute DOMString roleLabel;
};

[NoInterfaceObject]
interface Creator : MediaAnnotation {
    attribute DOMString creatorLink;
    attribute DOMString creatorLabel;
    attribute DOMString roleLink;
    attribute DOMString roleLabel;
};

[NoInterfaceObject]
interface Date : MediaAnnotation {
    attribute DOMString date; 
    attribute DOMString typeLink;
    attribute DOMString typeLabel;
};

[NoInterfaceObject]
interface Location : MediaAnnotation {
    attribute DOMString locationLink;
    attribute DOMString locationLabel;
    attribute double    longitude;
    attribute double    latitude;
    attribute double    altitude;
    attribute DOMString coordinateSystemLabel;
    attribute DOMString coordinateSystemLink;
};

[NoInterfaceObject]
interface Description : MediaAnnotation {
    attribute DOMString descriptionLabel;
};

[NoInterfaceObject]
interface Keyword : MediaAnnotation {
    attribute DOMString keywordLink;
    attribute DOMString keywordLabel;
};

[NoInterfaceObject]
interface Genre : MediaAnnotation {
    attribute DOMString genreLink;
    attribute DOMString genreLabel;
};

[NoInterfaceObject]
interface Rating : MediaAnnotation {
    attribute double ratingValue;
    attribute DOMString ratingSystemLink;
 attribute DOMString ratingSystemLabel;
    attribute double    min;
    attribute double    max; 
};

[NoInterfaceObject]
interface Relation : MediaAnnotation {
    attribute DOMString targetLink;
    attribute DOMString targetLabel;
 attribute DOMString typeLink;
    attribute DOMString typeLabel;
};

[NoInterfaceObject]
interface Collection : MediaAnnotation {
    attribute DOMString collectionLink;
 attribute DOMString collectionLabel;
};

[NoInterfaceObject]
interface Copyright : MediaAnnotation {
    attribute DOMString copyrightLabel;
 attribute DOMString holderLink;
 attribute DOMString holderLabel;
};

[NoInterfaceObject]
interface Policy : MediaAnnotation {
 attribute DOMString statementLink;
 attribute DOMString statementLabel;
 attribute DOMString typeLink;
 attribute DOMString typeLabel;
};

[NoInterfaceObject]
interface Publisher : MediaAnnotation {
 attribute DOMString publisherLink;
 attribute DOMString publisherLabel;
};

[NoInterfaceObject]
interface TargetAudience : MediaAnnotation {
 attribute DOMString audienceLink;
 attribute DOMString audienceLabel;
 attribute DOMString classificationSystemLink;
 attribute DOMString classificationSystemLabel;
};

[NoInterfaceObject]
interface Fragment : MediaAnnotation {
 attribute DOMString identifier;
 attribute DOMString roleLink;
 attribute DOMString roleLabel;
};

[NoInterfaceObject]
interface NamedFragment : MediaAnnotation {
 attribute DOMString identifier;
 attribute DOMString label;
};

[NoInterfaceObject]
interface FrameSize : MediaAnnotation {
    attribute double width;
    attribute double height;
    attribute DOMString unit;
};

[NoInterfaceObject]
interface Compression : MediaAnnotation {
 attribute DOMString compressionLink;
 attribute DOMString compressionLabel;
};

[NoInterfaceObject]
interface Duration : MediaAnnotation {
    attribute double duration;
};

[NoInterfaceObject]
interface Format : MediaAnnotation {
 attribute DOMString formatLink;
 attribute DOMString formatLabel;
};

[NoInterfaceObject]
interface SamplingRate : MediaAnnotation {
    attribute double samplingRate;
};

[NoInterfaceObject]
interface FrameRate : MediaAnnotation {
    attribute double frameRate;
}; 

[NoInterfaceObject]
interface AverageBitRate : MediaAnnotation {
    attribute double averageBitRate;
};

[NoInterfaceObject]
interface NumTracks : MediaAnnotation {
    attribute int  number;
 attribute DOMString typeString;
};
Received on Wednesday, 16 February 2011 22:40:05 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 16 February 2011 22:40:08 GMT