Skip to content

Commit

Permalink
Programmes: add publication start date time
Browse files Browse the repository at this point in the history
  • Loading branch information
ehrhart committed May 27, 2021
1 parent 75b14a8 commit 7e09beb
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
21 changes: 20 additions & 1 deletion config/routes/programmes.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ module.exports = {
},
producerSummary: '?producerSummary',
keyword: '?keyword',
contributor: '?contributor',
publicationStartDateTime: '?publicationStartDateTime',
}
],
$where: [
Expand Down Expand Up @@ -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': [
Expand Down
4 changes: 3 additions & 1 deletion locales/en/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
"language": "Language",
"publisher": "Publisher",
"annotation": "Annotations",
"keyword": "Keywords"
"keyword": "Keywords",
"contributor": "Contributors",
"publicationStartDateTime": "Publication date"
},
"routes": {
"channels": "Channels",
Expand Down
4 changes: 3 additions & 1 deletion locales/fr/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 7e09beb

Please sign in to comment.