Skip to content

Commit

Permalink
Add annotations and captions to query
Browse files Browse the repository at this point in the history
  • Loading branch information
ehrhart committed May 26, 2021
1 parent 7d7382d commit 9ebde56
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 2 deletions.
41 changes: 41 additions & 0 deletions config/routes/programmes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down Expand Up @@ -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',
Expand Down
3 changes: 2 additions & 1 deletion locales/en/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"theme": "Theme",
"description": "Description",
"language": "Language",
"publisher": "Publisher"
"publisher": "Publisher",
"annotation": "Annotations"
},
"routes": {
"channels": "Channels",
Expand Down
3 changes: 2 additions & 1 deletion locales/fr/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"theme": "Thème",
"description": "Description",
"language": "Langue",
"publisher": "Éditeur"
"publisher": "Éditeur",
"annotation": "Annotations"
},
"routes": {
"channels": "Chaînes",
Expand Down

0 comments on commit 9ebde56

Please sign in to comment.