Support non-image files in Knora API v2

Knora is designed to support storing different types of files in Sipi, and support for a few different file types was implemented in Knora API v1. For API v2, the interaction between Knora and Sipi was redesigned to make it simpler and more robust, to clearly separate Knora’s and Sipi’s responsibilities, and to facilitate deployment in Docker:

  • The content of the file is handled only by Sipi, and Knora sees only the file metadata, which Sipi provides.
  • When uploading a file, the client submits it directly to Sipi, which then does validation or image conversion. Any errors at this stage are handled in Sipi rather than in Knora. Only after Sipi accepts the file can the client use the file’s ID in an update request to Knora.
  • Knora and Sipi don’t need to share a filesystem; this makes deployment in Docker easier.

This design was implemented in Knora PR 1011, but only for image files. Support for other file types has begun in Knora PR 1206, but is waiting for some additional implementation in Sipi (see Sipi issue 283). As noted in Knora issue 1202, our friends in Lausanne especially need support for PDF and text files.

Once that’s done, Knora API v1 can be changed to handle image uploads in the same way; work in progress is in Knora PR 1233.

We would like to provide additional features for PDF files:

  • PDF/A validation (see Sipi issue 285)
  • IIIF-like functionality (or perhaps an extension to IIIF) for referring to a particular page in a PDF document, and perhaps also returning it in some other format.
2 Likes

Knora PR 1206 has been merged, adding support for PDF files to Knora API v2.

If you have existing non-image files in Sipi’s server directory, you will need to move them manually into Sipi’s images directory.

Support for text files is waiting for Sipi issue 309.

Thanks for keeping us informed!

Do you plan a frontend - module like the following one for uploading files and being able to access them in a folder structure?
https://www.primefaces.org/primeng/#/tree

Because I plan sth like it as well, maybe we can create this frontend - module together?

Thanks and best regards,
Jan