Skip to content

Commit 7ebf588

Browse files
authored
feat(xmlupload): support Baseclass MovingImageRepresentation (#185)
* add MovingImageRepresentation in resource.py * add test data for MovingImageRepresentation
1 parent f4898da commit 7ebf588

3 files changed

Lines changed: 13 additions & 0 deletions

File tree

‎knora/dsplib/models/resource.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,9 @@ def toJsonLdObj(self, action: Actions) -> Any:
253253
elif self.baseclass == 'ArchiveRepresentation':
254254
bitstream_attributes["@type"] = "knora-api:ArchiveFileValue"
255255
tmp["knora-api:hasArchiveFileValue"] = bitstream_attributes
256+
elif self.baseclass == 'MovingImageRepresentation':
257+
bitstream_attributes["@type"] = "knora-api:MovingImageFileValue"
258+
tmp["knora-api:hasMovingImageFileValue"] = bitstream_attributes
256259
else:
257260
raise BaseError(f"Baseclass '{self.baseclass}' not yet supported!")
258261

‎testdata/bitstreams/Dummy.mp4‎

464 KB
Binary file not shown.

‎testdata/test-data.xml‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,16 @@
240240
</text-prop>
241241
</resource>
242242

243+
<resource label="Moviething"
244+
restype=":MovieThing"
245+
id="video_0"
246+
permissions="res-default">
247+
<bitstream>testdata/bitstreams/Dummy.mp4</bitstream>
248+
<text-prop name=":hasText">
249+
<text encoding="utf8" permissions="prop-default">Dummy video with music</text>
250+
</text-prop>
251+
</resource>
252+
243253
<resource label="TestThing2Child1" restype=":TestThing2Child1" id="obj_0012">
244254
<text-prop name=":hasTextChild1">
245255
<text encoding="utf8">Some text</text>

0 commit comments

Comments
 (0)