diff --git a/docs/dsp-tools-create.md b/docs/dsp-tools-create.md index 9fa6ce596..4ebab9be1 100644 --- a/docs/dsp-tools-create.md +++ b/docs/dsp-tools-create.md @@ -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) diff --git a/knora/dsplib/models/resource.py b/knora/dsplib/models/resource.py index 62b7cb483..59edd67c6 100644 --- a/knora/dsplib/models/resource.py +++ b/knora/dsplib/models/resource.py @@ -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(): diff --git a/knora/dsplib/schemas/ontology.json b/knora/dsplib/schemas/ontology.json index a13890ec8..5fe7eb707 100644 --- a/knora/dsplib/schemas/ontology.json +++ b/knora/dsplib/schemas/ontology.json @@ -56,6 +56,7 @@ "DDDRepresentation", "DocumentRepresentation", "MovingImageRepresentation", + "ArchiveRepresentation", "Annotation", "LinkObj", "Region" diff --git a/knora/dsplib/schemas/resources-only.json b/knora/dsplib/schemas/resources-only.json index 96f7bff9b..c0840a77e 100644 --- a/knora/dsplib/schemas/resources-only.json +++ b/knora/dsplib/schemas/resources-only.json @@ -44,6 +44,7 @@ "DDDRepresentation", "DocumentRepresentation", "MovingImageRepresentation", + "ArchiveRepresentation", "Annotation", "LinkObj", "Region" diff --git a/knora/knora.py b/knora/knora.py index eaa1ebed7..9679100ed 100755 --- a/knora/knora.py +++ b/knora/knora.py @@ -34,6 +34,7 @@ - :DDDRepresentation - :DocumentRepresentation - :MovingImageRepresentation + - :ArchiveRepresentation - :Annotation -> :hasComment, :isAnnotationOf, :isAnnotationOfValue - :LinkObj -> :hasComment, :hasLinkTo, :hasLinkToValue - :LinkValue [reification node] diff --git a/testdata/test-onto.json b/testdata/test-onto.json index 35601a8f2..36f2e17eb 100644 --- a/testdata/test-onto.json +++ b/testdata/test-onto.json @@ -104,8 +104,7 @@ "groups": [ ":testgroup" ], - "projects": [ - ] + "projects": [] } ], "ontologies": [ @@ -475,7 +474,7 @@ }, { "name": "ZipThing", - "super": "DocumentRepresentation", + "super": "ArchiveRepresentation", "labels": { "en": "A ZIP Thing" },