W3C home > Mailing lists > Public > public-media-annotation@w3.org > January 2012

Re: YouTube mapping table

From: Pierre-Antoine Champin <pierre-antoine.champin@liris.cnrs.fr>
Date: Tue, 31 Jan 2012 19:51:48 +0100
Message-ID: <4F283844.2060309@liris.cnrs.fr>
To: Sebastian Schaffert <sebastian.schaffert@salzburgresearch.at>
CC: Florian Stegmaier <stegmai@dimis.fim.uni-passau.de>, "public-media-annotation@w3.org" <public-media-annotation@w3.org>
On 01/31/2012 02:24 PM, Sebastian Schaffert wrote:
> Dear all,
> 
> while implementing a YouTube-Media Ontology mapper, I encountered the following additional problems:
> 
> 1. ATOM Protocol
> 
> YouTube nowadays uses the ATOM protocol as default, not RSS (still available as secondary protocol though)

As Florian mentionned in his reply, I'm affraid it's too late to make
such a heavy change, but it is a shame if RSS is already deprecated... :-/

It does not prevent you from doing a mapping for Atom, though. Is the
mapping between the previously provided RSS and the currently provided
Atom well documented by Google?

> 2. Keywords (ma-ont:keyword)
> 
> XPath: /atom:entry/media:group/media:keywords

not if we stick to RSS

> YouTube will return a single value with a comma-separated list of keywords; in Media Ontology, this should be split into at least the individual keywords. 

yes, and this is very clearly documented by Google, so I propose we
change the 4th column of the mapping table to:

  keyword: all values obtained by splitting the original value against
           commas (',')

but see below...

> An alternative offered by the YouTube Atom API would be /atom:entry/atom:category[@scheme='http://gdata.youtube.com/schemas/2007/keywords.cat']/@term

is there any RSS counterpart to that?
would that be


rss/channel/item/media:group/media:category[@scheme='http://gdata.youtube.com/schemas/2007/keywords.cat']

?

In that case, the 4th column of the mapping table should be:

  keyword:
    from media:keyword: string all values obtained by splitting the
original
      value against commas (',')
    from media:category: value (but see below about URIs)


> 3. Category (ma-ont:genre)
> 
> XPath: /atom:entry/media:group/media:category

again, not if we stick to RSS.

BTW, shouldn't that be restricted to
[@scheme='http://gdata.youtube.com/schemas/2007/moviegenres.cat'] ?
Other category scheme do not seem to define genres...

in RSS, that would be:


rss/channel/item/media:group/media:category[@scheme='http://gdata.youtube.com/schemas/2007/moviegenres.cat']

?

> YouTube returns the category as a string, but the reference defines that this string should be mapped to the YouTube Schema URI, i.e. 
> 
> if /atom:entry/media:group/media:category = Music, then the mapping should be to http://gdata.youtube.com/schemas/2007#Music; 

I would rather go for

  concat (@scheme, "#", value)  (with URI as Datatype)

(for RDD; in Atom, you would replace value by @term)

so that

  <media:category
scheme='http://gdata.youtube.com/schemas/2007/moviegenres.cat'>Sports</media:category>

would give you the following genre

  http://gdata.youtube.com/schemas/2007/moviegenres.cat#Sports

But I think it is a very good idea.

> reference: http://code.google.com/intl/de-DE/apis/youtube/2.0/reference.html#youtube_data_api_tag_category
> 
> 
> 4. Copyright (ma-ont:copyright)
> 
> XPath: /atom:entry/media:group/media:license
> 
> the YouTube API returns copyright information as media:license element. This could be mapped to the ma-ont:copyright property with a bit of transformation, because YouTube only offers two values, "cc" for creative commons and "youtube" for their own license.
>
> reference: http://code.google.com/intl/de-DE/apis/youtube/2.0/reference.html#youtube_data_api_tag_media:license

I think it should rather be a ma-ont:policy
see
http://www.w3.org/TR/2011/PR-mediaont-10-20111129/#policy-property-examples

More precisely, I would put in the mapping table

| policy | exact | rss/channel/item/media:group/media:license |
  policy.terms to @href (URI)
  policy.type to <http://www.w3.org/1999/xhtml/vocab/#license>

  pa

> 
> 
> 
> Here is my complete mapping implementation:
>     private static Map<String,ValueMapper> mediaOntMappings = new HashMap<String, ValueMapper>();
>     static {
>         mediaOntMappings.put("http://www.w3.org/ns/ma-ont#identifier", new XPathLiteralMapper("/atom:entry/atom:id"));
>         mediaOntMappings.put("http://www.w3.org/ns/ma-ont#title",      new XPathLiteralMapper("/atom:entry/atom:title"));
>         mediaOntMappings.put("http://www.w3.org/ns/ma-ont#locator",    new XPathURIMapper("/atom:entry/media:group/media:content/@url")); // URI
>         mediaOntMappings.put("http://www.w3.org/ns/ma-ont#creator",    new XPathURIMapper("/atom:entry/atom:author/@uri"));               // URI
>         mediaOntMappings.put("http://www.w3.org/ns/ma-ont#date",       new XPathLiteralMapper("/atom:entry/atom:published","dateTime"));
>         mediaOntMappings.put("http://www.w3.org/ns/ma-ont#location",   new XPathLiteralMapper("/atom:entry/georss:where/gml:Point/gml:pos"));
>         mediaOntMappings.put("http://www.w3.org/ns/ma-ont#description",new XPathLiteralMapper("/atom:entry/media:group/media:description"));
>         mediaOntMappings.put("http://www.w3.org/ns/ma-ont#keyword",    new XPathLiteralMapper("/atom:entry/atom:category[@scheme='http://gdata.youtube.com/schemas/2007/keywords.cat']/@term"));
>         mediaOntMappings.put("http://www.w3.org/ns/ma-ont#genre",      new YoutubeCategoryMapper("/atom:entry/media:group/media:category"));       // URI, should  be mapped to YouTube schemas (http://gdata.youtube.com/schemas/2007#)
>         mediaOntMappings.put("http://www.w3.org/ns/ma-ont#rating",     new XPathLiteralMapper("/atom:entry/gd:rating/@average","float"));          // Float
>         mediaOntMappings.put("http://www.w3.org/ns/ma-ont#copyright",  new XPathURIMapper("/atom:entry/media:group/media:license/@href"));         // URI of license terms
>         mediaOntMappings.put("http://www.w3.org/ns/ma-ont#publisher",  new XPathURIMapper("/atom:entry/atom:author/@uri"));               // URI
>         mediaOntMappings.put("http://www.w3.org/ns/ma-ont#compression",new XPathLiteralMapper("/atom:entry/media:group/media:content/@type"));
>         mediaOntMappings.put("http://www.w3.org/ns/ma-ont#duration",   new XPathLiteralMapper("/atom:entry/media:group/media:content/@duration","integer"));
>         mediaOntMappings.put("http://www.w3.org/ns/ma-ont#format",     new XPathLiteralMapper("/atom:entry/media:group/media:content/@type"));
>         mediaOntMappings.put("http://xmlns.com/foaf/0.1/thumbnail",    new XPathURIMapper("/atom:entry/media:group/media:thumbnail/@url"));
>         mediaOntMappings.put("http://rdfs.org/sioc/ns#num_views",      new XPathLiteralMapper("/atom:entry/yt:statistics/@viewCount","integer"));
>     }
> 
> I will publish the source code as part of our Linked Media Framework as soon as our servers are running again :)
> 
> 
> 
> Am 31.01.2012 um 12:55 schrieb Florian Stegmaier:
> 
>> Dear Thierry, all,
>>
>> our colleagues at Salzburg Research are using our ontology (and soon the API) in their Linked Media Framework. I have put Sebastian into CC. He has just send me the pointer, that there is a mapping for ma:creator. In our mapping table there is N/A.
>>
>> Please refer to [1] and mapping would be as follows:
>>
>> "/atom:entry/atom:author/@uri" -> "http://www.w3.org/ns/ma-ont#creator"
>>
>> We should discuss this in todays telecon. He will finalize his work on YouTube today and will provide me his mappings as well.
>>
>> Cheers.
>>
>> [1] http://gdata.youtube.com/feeds/api/videos/EM4vblG6BVQ
>> _____________________________
>> Dipl. Inf. Florian Stegmaier
>> Chair of Distributed Information Systems
>> University of Passau
>> Innstr. 43
>> 94032 Passau
>>
>> Room 248 ITZ
>>
>> Tel.: +49 851 509 3063
>> Fax: +49 851 509 3062
>>
>> stegmai@dimis.fim.uni-passau.de
>> https://www.dimis.fim.uni-passau.de/iris/
>> http://twitter.com/fstegmai
>> _____________________________
>>
>>
>>
>> _____________________________
>> Dipl. Inf. Florian Stegmaier
>> Chair of Distributed Information Systems
>> University of Passau
>> Innstr. 43
>> 94032 Passau
>>
>> Room 248 ITZ
>>
>> Tel.: +49 851 509 3063
>> Fax: +49 851 509 3062
>>
>> stegmai@dimis.fim.uni-passau.de
>> https://www.dimis.fim.uni-passau.de/iris/
>> http://twitter.com/fstegmai
>> _____________________________
>>
> 
> Sebastian
Received on Tuesday, 31 January 2012 18:52:25 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 31 January 2012 18:52:26 GMT