From 7e09beb15bc1310bbc16a5fcb58985641a3beb03 Mon Sep 17 00:00:00 2001 From: Thibault Ehrhart Date: Thu, 27 May 2021 10:48:14 +0200 Subject: [PATCH] Programmes: add publication start date time --- config/routes/programmes.js | 21 ++++++++++++++++++++- locales/en/project.json | 4 +++- locales/fr/project.json | 4 +++- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/config/routes/programmes.js b/config/routes/programmes.js index 0efcb6c..862941b 100644 --- a/config/routes/programmes.js +++ b/config/routes/programmes.js @@ -37,6 +37,8 @@ module.exports = { }, producerSummary: '?producerSummary', keyword: '?keyword', + contributor: '?contributor', + publicationStartDateTime: '?publicationStartDateTime', } ], $where: [ @@ -118,18 +120,35 @@ module.exports = { ?id ebucore:hasKeyword/rdfs:label ?keyword . } } + UNION + { + OPTIONAL { + ?id ebucore:hasContributor/ebucore:agentName ?contributor . + } + } + UNION + { + OPTIONAL { + ?id ebucore:hasPublicationHistory/ebucore:hasPublicationEvent/ebucore:publicationStartDateTime ?publicationStartDateTime . + } + } ` ], $langTag: 'hide', }, mediaFunc: (props) => props.mediaLocator ? `https://explorer.memad.eu/api/limecraft/video?locator=${encodeURIComponent(props.mediaLocator)}` : null, - excludedMetadata: ['mediaLocator'], + excludedMetadata: ['mediaLocator', 'producerSummary', 'annotation', 'caption'], }, labelProp: 'http://www.ebu.ch/metadata/ontologies/ebucore/ebucore#title', imageFunc: (props) => props.mediaLocator ? `https://explorer.memad.eu/api/limecraft/thumbnail?locator=${encodeURIComponent(props.mediaLocator)}` : null, baseWhere: [ 'GRAPH ?g { ?id a ebucore:TVProgramme }', ], + metadata: { + publicationStartDateTime: (value) => { + return new Date(value).toLocaleDateString(); + }, + }, query: { '@context': 'http://schema.org/', '@graph': [ diff --git a/locales/en/project.json b/locales/en/project.json index 71d324e..2e5129d 100644 --- a/locales/en/project.json +++ b/locales/en/project.json @@ -16,7 +16,9 @@ "language": "Language", "publisher": "Publisher", "annotation": "Annotations", - "keyword": "Keywords" + "keyword": "Keywords", + "contributor": "Contributors", + "publicationStartDateTime": "Publication date" }, "routes": { "channels": "Channels", diff --git a/locales/fr/project.json b/locales/fr/project.json index 97d875b..f4e5d45 100644 --- a/locales/fr/project.json +++ b/locales/fr/project.json @@ -16,7 +16,9 @@ "language": "Langue", "publisher": "Éditeur", "annotation": "Annotations", - "keyword": "Mots-clés" + "keyword": "Mots-clés", + "contributor": "Contributeurs", + "publicationStartDateTime": "Date de publication" }, "routes": { "channels": "Chaînes",