Closed skarampatakis closed 1 year ago
The controller of course shouldn't be aware of particular formats. The proper way to handle this would probably be to check if the original filename is acceptable (i.e. not containing problematic characters like "/" or such). If it is acceptable, it could be incorporated into the temp file name (at least the extension) and if not, the upload should be rejected. For the validation, de.tudarmstadt.ukp.inception.documents.DocumentService.isValidDocumentName(String)
should work.
@skarampatakis please try https://github.com/inception-project/inception/releases/tag/inception-29.0-rc-1
That was really quick! Tested it and it works like a charm. Thanks a lot @reckart
Describe the bug
Hi, I am trying to import some annotations in NIF format, turtle serialization, using the annotations endpoint.
The call I m using is the following:
The endpoint's response is the following:
On the console the error is:
To Reproduce
As explained above
Expected behavior
The annotations should be added on the document and be visible on the UI.
Screenshots
No response
Environment
Version and build ID: 29.0-SNAPSHOT Operating system: Linux Browser: Chrome
Additional context
I took a look on the code and it seems that the filename is changed before importing the CAS into something like upload-xxx.bin which then fails the NifReader as the .bin extension is not recognized as a registered RDF serialization.
I did a quick fix and it seems to work for my case, but I m not sure about any other implications this change might have.
I changed the following in line 993 of the AeroRemoteApiController.java class: