EcoCor / ecocor-api

eXist extension providing REST API for EcoCor
0 stars 1 forks source link

Integrate Voyant tools #1

Open ingoboerner opened 1 year ago

ingoboerner commented 1 year ago

https://voyant-tools.org/ allows to add a URL pointing to a text

The functionality to directly send a text to Voyant ist implemented by the DTA, e.g. https://www.deutschestextarchiv.de/book/show/bakunin_russland_1848 use https://voyant-tools.org/?view=corpusset&stopList=stop.de.german.txt&input=https://www.deutschestextarchiv.de/book/download_unicruftxml/bakunin_russland_1848

It doesn't work for DraCor, at least. I copied the following URL to the box https://dracor.org/api/corpora/ger/play/gryphius-catharina-von-georgien/spoken-text

Server returns the following error:

Server returned HTTP response code: 500 for URL: https://dracor.org/api/corpora/ger/play/gryphius-catharina-von-georgien/spoken-text
java.io.IOException: Server returned HTTP response code: 500 for URL: https://dracor.org/api/corpora/ger/play/gryphius-catharina-von-georgien/spoken-text
    at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1924)
    at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1520)
    at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:250)
    at org.voyanttools.trombone.input.source.UriInputSource.getInputStream(UriInputSource.java:144)
    at org.voyanttools.trombone.storage.file.FileStoredDocumentSourceStorage.getStoredDocumentSource(FileStoredDocumentSourceStorage.java:115)
    at org.voyanttools.trombone.tool.build.DocumentStorer.run(DocumentStorer.java:77)
    at org.voyanttools.trombone.tool.build.DocumentStorer.run(DocumentStorer.java:63)
    at org.voyanttools.trombone.tool.build.RealCorpusCreator.run(RealCorpusCreator.java:71)
    at org.voyanttools.trombone.tool.build.RealCorpusCreator.run(RealCorpusCreator.java:57)
    at org.voyanttools.trombone.tool.corpus.CorpusManager.run(CorpusManager.java:104)
    at org.voyanttools.trombone.tool.corpus.CorpusManager.getCorpus(CorpusManager.java:112)
    at org.voyanttools.trombone.tool.corpus.AbstractCorpusTool.run(AbstractCorpusTool.java:57)
    at org.voyanttools.trombone.tool.util.ToolRunner.run(ToolRunner.java:134)
    at org.voyanttools.trombone.Controller.run(Controller.java:110)
    at org.voyanttools.voyant.Trombone.runTromboneController(Trombone.java:337)
    at org.voyanttools.voyant.Trombone.doRequest(Trombone.java:311)
    at org.voyanttools.voyant.Trombone.doRequest(Trombone.java:146)
    at org.voyanttools.voyant.Trombone.doPost(Trombone.java:87)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:681)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:764)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:540)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:357)
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:382)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:893)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1726)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
    at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.base/java.lang.Thread.run(Thread.java:829)
ingoboerner commented 1 year ago

https://voyant-tools.org/?view=corpusset&stopList=stop.de.german.txt&input=https://dracor.org/api/corpora/ger/play/gryphius-catharina-von-georgien/spoken-text

cmil commented 1 month ago

The above link seems to work now. To use the current (staging) API the URL should however be changed to https://voyant-tools.org/?view=corpusset&stopList=stop.de.german.txt&input=https://staging.dracor.org/api/v1/corpora/ger/plays/gryphius-catharina-von-georgien/spoken-text. So maybe this was fixed with our upgrade to eXist DB 6.2.0 or Voyant Tools changed how they request the URLs.

So, now, how exactly do we want to integrate with Voyant Tools?