Skip to content
Permalink
Browse files
feat: update DSP-Tools to support ArchiveRepresentation (DEV-259) (#128)
  • Loading branch information
BalduinLandolt committed Nov 29, 2021
1 parent 0dc724c commit 85a40c203d0fa7afc7f7bb122aac0860c304acf4
Showing with 12 additions and 3 deletions.
  1. +1 −0 docs/dsp-tools-create.md
  2. +6 −0 knora/dsplib/models/resource.py
  3. +1 −0 knora/dsplib/schemas/ontology.json
  4. +1 −0 knora/dsplib/schemas/resources-only.json
  5. +1 −0 knora/knora.py
  6. +2 −3 testdata/test-onto.json
@@ -1078,6 +1078,7 @@ The following predefined resources are provided by DSP:
- `DDDRepresentation`: An object representing a 3-D representation (not yet implemented)
- `DocumentRepresentation`: An object representing an opaque document (e.g. a PDF)
- `MovingImageRepresentation`: An object representing a moving image (video, film)
- `ArchiveRepresentation`: An object representing a archive file (e.g. Zip)
- `Annotation`: A predefined annotation object. It has automatically the following predefined properties defined:
- `hasComment` (1-n)
- `isAnnotationOf` (1)
@@ -45,6 +45,7 @@ class ResourceInstance(Model):
'AudioRepresentation',
'DocumentRepresentation',
'MovingImageRepresentation',
'ArchiveRepresentation',
'DDDRepresentation',
'TextRepresentation'}
knora_properties: Set[str] = {
@@ -228,6 +229,11 @@ def toJsonLdObj(self, action: Actions) -> Any:
"@type": "knora-api:AudioFileValue",
"knora-api:fileValueHasFilename": self._bitstream
}
elif self.baseclass == 'ArchiveRepresentation':
tmp["knora-api:hasArchiveFileValue"] = {
"@type": "knora-api:ArchiveFileValue",
"knora-api:fileValueHasFilename": self._bitstream
}
else:
raise BaseError(f'Baseclass "{self.baseclass}" not yet supported!')
for propname, valtype in self._values.items():
@@ -56,6 +56,7 @@
"DDDRepresentation",
"DocumentRepresentation",
"MovingImageRepresentation",
"ArchiveRepresentation",
"Annotation",
"LinkObj",
"Region"
@@ -44,6 +44,7 @@
"DDDRepresentation",
"DocumentRepresentation",
"MovingImageRepresentation",
"ArchiveRepresentation",
"Annotation",
"LinkObj",
"Region"
@@ -34,6 +34,7 @@
- :DDDRepresentation
- :DocumentRepresentation
- :MovingImageRepresentation
- :ArchiveRepresentation
- :Annotation -> :hasComment, :isAnnotationOf, :isAnnotationOfValue
- :LinkObj -> :hasComment, :hasLinkTo, :hasLinkToValue
- :LinkValue [reification node]
@@ -104,8 +104,7 @@
"groups": [
":testgroup"
],
"projects": [
]
"projects": []
}
],
"ontologies": [
@@ -475,7 +474,7 @@
},
{
"name": "ZipThing",
"super": "DocumentRepresentation",
"super": "ArchiveRepresentation",
"labels": {
"en": "A ZIP Thing"
},

0 comments on commit 85a40c2

Please sign in to comment.