inception-project / inception

INCEpTION provides a semantic annotation platform offering intelligent annotation assistance and knowledge management.
https://inception-project.github.io
Apache License 2.0
593 stars 151 forks source link

Importing annotations with NIF format, raises error on remote api endpoint #4137

Closed skarampatakis closed 1 year ago

skarampatakis commented 1 year ago

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:

curl --location --request POST 'http://localhost:8080/api/aero/v1/projects/0/documents/0/annotations/admin?format=nif' \
--header 'Authorization: Basic YWRtaW46YWRtaW4=' \
--form 'content=@"nif-test-import.ttl"'

The endpoint's response is the following:

{
    "messages": [
        {
            "level": "ERROR",
            "message": "Internal server error: Failed to determine the RDF syntax (.lang or .base required)"
        }
    ]
}

On the console the error is:

2023-08-01 13:52:57 ERROR [SYSTEM] AeroRemoteApiController - Failed to determine the RDF syntax (.lang or .base required)
org.apache.jena.riot.RiotException: Failed to determine the RDF syntax (.lang or .base required)
    at org.apache.jena.riot.RDFParser.parseNotUri(RDFParser.java:397) ~[jena-arq-4.6.1.jar:4.6.1]
    at org.apache.jena.riot.RDFParser.parse(RDFParser.java:356) ~[jena-arq-4.6.1.jar:4.6.1]
    at org.apache.jena.riot.RDFParserBuilder.parse(RDFParserBuilder.java:568) ~[jena-arq-4.6.1.jar:4.6.1]
    at org.apache.jena.riot.RDFDataMgr.parseFromInputStream(RDFDataMgr.java:718) ~[jena-arq-4.6.1.jar:4.6.1]
    at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:253) ~[jena-arq-4.6.1.jar:4.6.1]
    at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:220) ~[jena-arq-4.6.1.jar:4.6.1]
    at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:206) ~[jena-arq-4.6.1.jar:4.6.1]
    at org.dkpro.core.io.nif.NifReader.step(NifReader.java:183) ~[classes/:?]
    at org.dkpro.core.io.nif.NifReader.initialize(NifReader.java:112) ~[classes/:?]
    at org.apache.uima.fit.component.CasCollectionReader_ImplBase.initialize(CasCollectionReader_ImplBase.java:41) ~[uimafit-core-3.4.0.jar:?]
    at org.apache.uima.collection.CollectionReader_ImplBase.initialize(CollectionReader_ImplBase.java:64) ~[uimaj-core-3.4.1.jar:?]
    at org.apache.uima.impl.CollectionReaderFactory_impl.produceResource(CollectionReaderFactory_impl.java:93) ~[uimaj-core-3.4.1.jar:?]
    at org.apache.uima.impl.CompositeResourceFactory_impl.produceResource(CompositeResourceFactory_impl.java:64) ~[uimaj-core-3.4.1.jar:?]
    at org.apache.uima.UIMAFramework.produceResource(UIMAFramework.java:284) ~[uimaj-core-3.4.1.jar:?]
    at org.apache.uima.UIMAFramework.produceResource(UIMAFramework.java:334) ~[uimaj-core-3.4.1.jar:?]
    at org.apache.uima.UIMAFramework.produceCollectionReader(UIMAFramework.java:805) ~[uimaj-core-3.4.1.jar:?]
    at org.apache.uima.fit.factory.CollectionReaderFactory.createReader(CollectionReaderFactory.java:423) ~[uimafit-core-3.4.0.jar:?]
    at de.tudarmstadt.ukp.clarin.webanno.api.format.FormatSupport.read(FormatSupport.java:191) ~[classes/:?]
    at de.tudarmstadt.ukp.inception.export.DocumentImportExportServiceImpl.importCasFromFile(DocumentImportExportServiceImpl.java:316) ~[classes/:?]
    at de.tudarmstadt.ukp.inception.export.DocumentImportExportServiceImpl$$FastClassBySpringCGLIB$$6bf689d0.invoke(<generated>) ~[classes/:?]
    at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.3.29.jar:5.3.29]
    at org.springframework.aop.framework.CglibAopProxy.invokeMethod(CglibAopProxy.java:386) ~[spring-aop-5.3.29.jar:5.3.29]
    at org.springframework.aop.framework.CglibAopProxy.access$000(CglibAopProxy.java:85) ~[spring-aop-5.3.29.jar:5.3.29]
    at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:704) ~[spring-aop-5.3.29.jar:5.3.29]
    at de.tudarmstadt.ukp.inception.export.DocumentImportExportServiceImpl$$EnhancerBySpringCGLIB$$b762694f.importCasFromFile(<generated>) ~[classes/:?]
    at de.tudarmstadt.ukp.clarin.webanno.webapp.remoteapi.aero.AeroRemoteApiController.createCompatibleCas(AeroRemoteApiController.java:996) ~[classes/:?]
    at de.tudarmstadt.ukp.clarin.webanno.webapp.remoteapi.aero.AeroRemoteApiController.annotationsCreate(AeroRemoteApiController.java:740) ~[classes/:?]
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
    at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
    at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) ~[spring-web-5.3.29.jar:5.3.29]
    at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150) ~[spring-web-5.3.29.jar:5.3.29]
    at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117) ~[spring-webmvc-5.3.29.jar:5.3.29]
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895) ~[spring-webmvc-5.3.29.jar:5.3.29]
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808) ~[spring-webmvc-5.3.29.jar:5.3.29]
    at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.3.29.jar:5.3.29]
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1072) [spring-webmvc-5.3.29.jar:5.3.29]
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:965) [spring-webmvc-5.3.29.jar:5.3.29]
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) [spring-webmvc-5.3.29.jar:5.3.29]
    at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909) [spring-webmvc-5.3.29.jar:5.3.29]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:665) [javax.servlet-api-4.0.1.jar:4.0.1]
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) [spring-webmvc-5.3.29.jar:5.3.29]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:750) [javax.servlet-api-4.0.1.jar:4.0.1]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:209) [tomcat-embed-core-9.0.78.jar:9.0.78]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) [tomcat-embed-core-9.0.78.jar:9.0.78]
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51) [tomcat-embed-websocket-9.0.78.jar:9.0.78]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) [tomcat-embed-core-9.0.78.jar:9.0.78]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) [tomcat-embed-core-9.0.78.jar:9.0.78]
    at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:179) [wicket-core-9.14.0.jar:9.14.0]
    at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:307) [wicket-core-9.14.0.jar:9.14.0]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) [tomcat-embed-core-9.0.78.jar:9.0.78]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) [tomcat-embed-core-9.0.78.jar:9.0.78]
    at org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:186) [spring-orm-5.3.29.jar:5.3.29]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) [spring-web-5.3.29.jar:5.3.29]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) [tomcat-embed-core-9.0.78.jar:9.0.78]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) [tomcat-embed-core-9.0.78.jar:9.0.78]
    at de.tudarmstadt.ukp.clarin.webanno.support.logging.LoggingFilter.doFilter(LoggingFilter.java:58) [classes/:?]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) [tomcat-embed-core-9.0.78.jar:9.0.78]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) [tomcat-embed-core-9.0.78.jar:9.0.78]
    at de.tudarmstadt.ukp.inception.app.config.InceptionServletContextInitializer$1.doFilterInternal(InceptionServletContextInitializer.java:96) [classes/:?]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) [spring-web-5.3.29.jar:5.3.29]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) [tomcat-embed-core-9.0.78.jar:9.0.78]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) [tomcat-embed-core-9.0.78.jar:9.0.78]
    at de.tudarmstadt.ukp.inception.annotation.storage.OpenCasStorageSessionForRequestFilter.doFilter(OpenCasStorageSessionForRequestFilter.java:50) [classes/:?]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) [tomcat-embed-core-9.0.78.jar:9.0.78]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) [tomcat-embed-core-9.0.78.jar:9.0.78]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:352) [spring-security-web-5.8.5.jar:5.8.5]
    at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:117) [spring-security-web-5.8.5.jar:5.8.5]
    at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83) [spring-security-web-5.8.5.jar:5.8.5]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:361) [spring-security-web-5.8.5.jar:5.8.5]
    at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:126) [spring-security-web-5.8.5.jar:5.8.5]
    at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:120) [spring-security-web-5.8.5.jar:5.8.5]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:361) [spring-security-web-5.8.5.jar:5.8.5]
    at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:131) [spring-security-web-5.8.5.jar:5.8.5]
    at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:85) [spring-security-web-5.8.5.jar:5.8.5]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:361) [spring-security-web-5.8.5.jar:5.8.5]
    at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:100) [spring-security-web-5.8.5.jar:5.8.5]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:361) [spring-security-web-5.8.5.jar:5.8.5]
    at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:164) [spring-security-web-5.8.5.jar:5.8.5]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:361) [spring-security-web-5.8.5.jar:5.8.5]
    at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63) [spring-security-web-5.8.5.jar:5.8.5]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:361) [spring-security-web-5.8.5.jar:5.8.5]
    at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilterInternal(BasicAuthenticationFilter.java:200) [spring-security-web-5.8.5.jar:5.8.5]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) [spring-web-5.3.29.jar:5.3.29]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:361) [spring-security-web-5.8.5.jar:5.8.5]
    at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:107) [spring-security-web-5.8.5.jar:5.8.5]
    at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:93) [spring-security-web-5.8.5.jar:5.8.5]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:361) [spring-security-web-5.8.5.jar:5.8.5]
    at org.springframework.web.filter.CorsFilter.doFilterInternal(CorsFilter.java:91) [spring-web-5.3.29.jar:5.3.29]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) [spring-web-5.3.29.jar:5.3.29]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:361) [spring-security-web-5.8.5.jar:5.8.5]
    at org.springframework.security.web.header.HeaderWriterFilter.doHeadersAfter(HeaderWriterFilter.java:90) [spring-security-web-5.8.5.jar:5.8.5]
    at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:75) [spring-security-web-5.8.5.jar:5.8.5]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) [spring-web-5.3.29.jar:5.3.29]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:361) [spring-security-web-5.8.5.jar:5.8.5]
    at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:117) [spring-security-web-5.8.5.jar:5.8.5]
    at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87) [spring-security-web-5.8.5.jar:5.8.5]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:361) [spring-security-web-5.8.5.jar:5.8.5]
    at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:62) [spring-security-web-5.8.5.jar:5.8.5]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) [spring-web-5.3.29.jar:5.3.29]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:361) [spring-security-web-5.8.5.jar:5.8.5]
    at org.springframework.security.web.session.DisableEncodeUrlFilter.doFilterInternal(DisableEncodeUrlFilter.java:42) [spring-security-web-5.8.5.jar:5.8.5]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) [spring-web-5.3.29.jar:5.3.29]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:361) [spring-security-web-5.8.5.jar:5.8.5]
    at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:225) [spring-security-web-5.8.5.jar:5.8.5]
    at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:190) [spring-security-web-5.8.5.jar:5.8.5]
    at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:354) [spring-web-5.3.29.jar:5.3.29]
    at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:267) [spring-web-5.3.29.jar:5.3.29]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) [tomcat-embed-core-9.0.78.jar:9.0.78]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) [tomcat-embed-core-9.0.78.jar:9.0.78]
    at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) [spring-web-5.3.29.jar:5.3.29]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) [spring-web-5.3.29.jar:5.3.29]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) [tomcat-embed-core-9.0.78.jar:9.0.78]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) [tomcat-embed-core-9.0.78.jar:9.0.78]
    at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) [spring-web-5.3.29.jar:5.3.29]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) [spring-web-5.3.29.jar:5.3.29]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) [tomcat-embed-core-9.0.78.jar:9.0.78]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) [tomcat-embed-core-9.0.78.jar:9.0.78]
    at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:96) [spring-boot-actuator-2.7.14.jar:2.7.14]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) [spring-web-5.3.29.jar:5.3.29]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) [tomcat-embed-core-9.0.78.jar:9.0.78]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) [tomcat-embed-core-9.0.78.jar:9.0.78]
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) [spring-web-5.3.29.jar:5.3.29]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) [spring-web-5.3.29.jar:5.3.29]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) [tomcat-embed-core-9.0.78.jar:9.0.78]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) [tomcat-embed-core-9.0.78.jar:9.0.78]
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:167) [tomcat-embed-core-9.0.78.jar:9.0.78]
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90) [tomcat-embed-core-9.0.78.jar:9.0.78]
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:481) [tomcat-embed-core-9.0.78.jar:9.0.78]
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:130) [tomcat-embed-core-9.0.78.jar:9.0.78]
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93) [tomcat-embed-core-9.0.78.jar:9.0.78]
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) [tomcat-embed-core-9.0.78.jar:9.0.78]
    at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:768) [tomcat-embed-core-9.0.78.jar:9.0.78]
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) [tomcat-embed-core-9.0.78.jar:9.0.78]
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:390) [tomcat-embed-core-9.0.78.jar:9.0.78]
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) [tomcat-embed-core-9.0.78.jar:9.0.78]
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:926) [tomcat-embed-core-9.0.78.jar:9.0.78]
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1791) [tomcat-embed-core-9.0.78.jar:9.0.78]
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) [tomcat-embed-core-9.0.78.jar:9.0.78]
    at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) [tomcat-embed-core-9.0.78.jar:9.0.78]
    at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) [tomcat-embed-core-9.0.78.jar:9.0.78]
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-9.0.78.jar:9.0.78]
    at java.lang.Thread.run(Thread.java:833) [?:?]

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:

tmpFile = File.createTempFile("upload", "." + (format.equals("nif")? FilenameUtils.getExtension(CompressionUtils.stripCompressionExtension(aFile.getOriginalFilename())): "bin"));
reckart commented 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.

reckart commented 1 year ago

@skarampatakis please try https://github.com/inception-project/inception/releases/tag/inception-29.0-rc-1

skarampatakis commented 1 year ago

That was really quick! Tested it and it works like a charm. Thanks a lot @reckart