- From: Sebastian Schaffert <sebastian.schaffert@salzburgresearch.at>
- Date: Tue, 31 Jan 2012 14:24:53 +0100
- To: Florian Stegmaier <stegmai@dimis.fim.uni-passau.de>
- Cc: public-media-annotation@w3.org
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)
2. Keywords (ma-ont:keyword)
XPath: /atom:entry/media:group/media:keywords
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.
An alternative offered by the YouTube Atom API would be /atom:entry/atom:category[@scheme='http://gdata.youtube.com/schemas/2007/keywords.cat']/@term
3. Category (ma-ont:genre)
XPath: /atom:entry/media:group/media:category
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;
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
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
--
| Dr. Sebastian Schaffert sebastian.schaffert@salzburgresearch.at
| Salzburg Research Forschungsgesellschaft http://www.salzburgresearch.at
| Head of Knowledge and Media Technologies Group +43 662 2288 423
| Jakob-Haringer Strasse 5/II
| A-5020 Salzburg
Received on Tuesday, 31 January 2012 13:25:31 UTC