From 9ebde56ccdb15a8d98882fc9a7832632ca0499d7 Mon Sep 17 00:00:00 2001 From: Thibault Ehrhart Date: Wed, 26 May 2021 23:09:02 +0200 Subject: [PATCH] Add annotations and captions to query --- config/routes/programmes.js | 41 +++++++++++++++++++++++++++++++++++++ locales/en/project.json | 3 ++- locales/fr/project.json | 3 ++- 3 files changed, 45 insertions(+), 2 deletions(-) diff --git a/config/routes/programmes.js b/config/routes/programmes.js index 2fb62cd..d66f0d9 100644 --- a/config/routes/programmes.js +++ b/config/routes/programmes.js @@ -22,6 +22,19 @@ module.exports = { language: '?languageLabel', publisher: '?publisher', mediaLocator: '?mediaLocator', + annotation: { + '@id': '?annotation', + 'type': '?annotationType', + 'body': '?annotationBody', + 'start': '?annotationStart', + 'end': '?annotationEnd', + }, + caption: { + '@id': '?caption', + 'text': '?captionText', + 'start': '?captionStart', + 'end': '?captionEnd', + }, } ], $where: [ @@ -63,6 +76,34 @@ module.exports = { { OPTIONAL { ?id ebucore:isInstantiatedBy/ebucore:locator ?mediaLocator } } + UNION + { + OPTIONAL { + ?id ebucore:hasRelatedTextLine ?subtitle . + OPTIONAL { ?subtitle ebucore:textLineContent ?subtitleText . } + OPTIONAL { ?subtitle ebucore:textLineStartTime ?subtitleStart . } + OPTIONAL { ?subtitle ebucore:textLineEndTime ?subtitleEnd . } + OPTIONAL { ?subtitle ebucore:textLineLanguage/rdfs:label ?subtitleLang . FILTER(LANG(?subtitleLang) = "") } + OPTIONAL { + ?annotation a ebucore:TextAnnotation . + ?annotation ebucore:hasAnnotationTarget ?subtitle . + ?annotation ebucore:annotationType ?annotationType . + ?annotation ebucore:hasAnnotationBody ?annotationBody . + ?annotation ebucore:characterStartIndex ?annotationStart . + ?annotation ebucore:characterEndIndex ?annotationEnd . + } + } + } + UNION + { + OPTIONAL { + ?caption a ebucore:Shot . + ?caption ebucore:isPartOf ?id . + ?caption ebucore:hasRelatedTextLine ?captionText . + ?caption ebucore:start ?captionStart . + ?caption ebucore:end ?captionEnd . + } + } ` ], $langTag: 'hide', diff --git a/locales/en/project.json b/locales/en/project.json index 04ad29c..0534939 100644 --- a/locales/en/project.json +++ b/locales/en/project.json @@ -14,7 +14,8 @@ "theme": "Theme", "description": "Description", "language": "Language", - "publisher": "Publisher" + "publisher": "Publisher", + "annotation": "Annotations" }, "routes": { "channels": "Channels", diff --git a/locales/fr/project.json b/locales/fr/project.json index 1f4c92d..fd8ea37 100644 --- a/locales/fr/project.json +++ b/locales/fr/project.json @@ -14,7 +14,8 @@ "theme": "Thème", "description": "Description", "language": "Langue", - "publisher": "Éditeur" + "publisher": "Éditeur", + "annotation": "Annotations" }, "routes": { "channels": "Chaînes",