Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mixed matching approach #18

Merged
merged 16 commits into from
Feb 12, 2019
Merged

Mixed matching approach #18

merged 16 commits into from
Feb 12, 2019

Conversation

lfoppiano
Copy link
Collaborator

I think I've implemented the issue #12. I ran some tests to verify that the logic was following the specification and if I haven't missed anything it should be working properly.
Unfortunately the code is quite hard to follow. It's possible to easily follow the logic by setting the debug to DEBUG and filter only messages from the LookupController while running specific tests.

Indeed, more tests are needed.

@lfoppiano
Copy link
Collaborator Author

Here a list of tests I've ran:

localhost:8080/service/lookup?biblio=R.K. Gupta, in: R.K. Gupta (Ed.), Physics of Particles, Nuclei and Materials-Recent Trends, Narosa Publishing House,New Delhi ,2002 ,p .118 .

localhost:8080/service/lookup?biblio=Baltz, R., Domon, C., Pillay, D.T.N. and Steinmetz, A. (1992) Characterization of a pollen-specific cDNA from sunflower encoding a zinc finger protein. Plant J. 2:713-721

http://localhost:8080/service/lookup?doi=10.1081%2Fbip-100101011&atitle=OPTIMAL SAMPLING TIMES IN BIOEQUIVALENCE TESTS&firstAuthor=Foppiano&postValidate=true


http://localhost:8080/service/lookup?doi=ba&atitle=Nanometre-scale thermometry in a living cell&firstAuthor=Kucsko

localhost:8080/service/lookup?biblio=Schminck, A. , ‘The Beginnings and Origins of the “Macedonian” Dynasty’ in J. Burke and R. Scott , eds., Byzantine Macedonia: Identity, Image and History (Melbourne, 2000), 61–8.

localhost:8080/service/lookup?The beginnings and origins of the 'Macedonian' dynastyatitle=&firstAuthor=Schminck&biblio=Schminck, A. , ‘The Beginnings and Origins of the “Macedonian” Dynasty’ in J. Burke and R. Scott , eds., Byzantine Macedonia: Identity, Image and History (Melbourne, 2000), 61–8.

localhost:8080/service/lookup?doi=10.1163/9789004344730_006&atitle=The beginnings and origins of the 'Macedonian' dynasty&firstAuthor=Schminck&biblio=Schminck, A. , ‘The Beginnings and Origins of the “Macedonian” Dynasty’ in J. Burke and R. Scott , eds., Byzantine Macedonia: Identity, Image and History (Melbourne, 2000), 61–8.

localhost:8080/service/lookup?doi=10.1163/9789004344730_006&atitle=The beginnings and origins of the 'Macedonian' dynasty&firstAuthor=Schminck&jtitle=Byzantine Macedonia: Identity, Image and History&biblio=Schminck, A. , ‘The Beginnings and Origins of the “Macedonian” Dynasty’ in J. Burke and R. Scott , eds., Byzantine Macedonia: Identity, Image and History (Melbourne, 2000), 61–8.

localhost:8080/service/lookup?doi=bao&atitle=The beginnings and origins of the 'Macedonian' dynasty&firstAuthor=Schminck&jtitle=Byzantine Macedonia: Identity, Image and History&biblio=Schminck, A. , ‘The Beginnings and Origins of the “Macedonian” Dynasty’ in J. Burke and R. Scott , eds., Byzantine Macedonia: Identity, Image and History (Melbourne, 2000), 61–8.

localhost:8080/service/lookup?volume=2&jtitle=The Plant Journal&firstPage=713&biblio=Baltz, R., Domon, C., Pillay, D.T.N. and Steinmetz, A. (1992) Characterization of a pollen-specific cDNA from sunflower encoding a zinc finger protein. Plant J. 2:713-721&atitle=Characterization of a pollen-specific cDNA from sunflower encoding a zinc finger protein&firstAuthor=Baltz

localhost:8080/service/lookup?volume=2&jtitle=The Plant Journal&firstPage=713&biblio=Baltz, R., Domon, C., Pillay, D.T.N. and Steinmetz, A. (1992) Characterization of a pollen-specific cDNA from sunflower encoding a zinc finger protein. Plant J. 2:713-721&atitle=Characterization of a pollen-specific cDNA from sunflower encoding a zinc finger protein&firstAuthor=Baltz

localhost:8080/service/lookup?volume=2&jtitle=The Plant Journal&biblio=Baltz, R., Domon, C., Pillay, D.T.N. and Steinmetz, A. (1992) Characterization of a pollen-specific cDNA from sunflower encoding a zinc finger protein. Plant J. 2:713-721&firstAuthor=Baltz


localhost:8080/service/lookup?volume=2&jtitle=The Plant Journal&biblio=Baltz, R., Domon, C., Pillay, D.T.N. and Steinmetz, A. (1992) Characterization of a pollen-specific cDNA from sunflower encoding a zinc finger protein. Plant J. 2:713-721&firstAuthor=Balzarotti

@kermitt2
Copy link
Owner

I made some tests and so far I think it works as expected, but I need to do more.

I observed that exceptions are firing on the console for intermediary failures, for example:

WARN  [2019-02-10 02:46:54,080] com.scienceminer.lookup.web.resource.LookupController: DOI not matched, keep going if enough additional information. 
! com.scienceminer.lookup.exception.NotFoundException: Article not found
! at com.scienceminer.lookup.storage.LookupEngine.validateJsonBody(LookupEngine.java:133)
! at com.scienceminer.lookup.storage.LookupEngine.retrieveByDoi(LookupEngine.java:126)
! at com.scienceminer.lookup.web.resource.LookupController.getByQuery(LookupController.java:124)
! at com.scienceminer.lookup.web.resource.LookupController.getByQueryAsync(LookupController.java:98)
! at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
! at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
! at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
! at java.lang.reflect.Method.invoke(Method.java:498)
! at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
! at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144)
! at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161)
! at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$VoidOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:143)
! at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99)
! at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389)
! at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347)
! at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102)
! at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326)
! at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
! at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
! at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
! at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
! at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
! at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
! at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305)
! at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154)
! at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473)
! at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427)
! at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388)
! at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341)
! at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228)
! at io.dropwizard.jetty.NonblockingServletHolder.handle(NonblockingServletHolder.java:49)
! at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1655)
! at io.dropwizard.servlets.ThreadNameFilter.doFilter(ThreadNameFilter.java:35)
! at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
! at io.dropwizard.jersey.filter.AllowedMethodsFilter.handle(AllowedMethodsFilter.java:45)
! at io.dropwizard.jersey.filter.AllowedMethodsFilter.doFilter(AllowedMethodsFilter.java:39)
! at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
! at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:89)
! at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:120)
! at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:135)
! at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
! at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533)
! at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
! at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1317)
! at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)
! at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)
! at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)
! at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1219)
! at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)
! at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
! at com.codahale.metrics.jetty9.InstrumentedHandler.handle(InstrumentedHandler.java:239)
! at io.dropwizard.jetty.RoutingHandler.handle(RoutingHandler.java:52)
! at org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:724)
! at io.dropwizard.jetty.BiDiGzipHandler.handle(BiDiGzipHandler.java:67)
! at org.eclipse.jetty.server.handler.RequestLogHandler.handle(RequestLogHandler.java:56)
! at org.eclipse.jetty.server.handler.StatisticsHandler.handle(StatisticsHandler.java:169)
! at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
! at org.eclipse.jetty.server.Server.handle(Server.java:531)
! at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:352)
! at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:260)
! at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:281)
! at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102)
! at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:118)
! at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:762)
! at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:680)
! at java.lang.Thread.run(Thread.java:745)
127.0.0.1 - - [10/Feb/2019:02:46:54 +0000] "GET /service/lookup?doi=ba&atitle=Nanometre-scale%20thermometry%20in%20a%20living%20cell&firstAuthor=Kucsko HTTP/1.1" 200 2450 "-" "insomnia/6.3.1" 54

@kermitt2
Copy link
Owner

Removed these exceptions and review a bit the error message with commit 67cd19f

@kermitt2
Copy link
Owner

Opened issue #19 ... it's a bit complicated to fix the error 400 due to the way the sequence of lookup/search is realized

@kermitt2 kermitt2 merged commit 38f2207 into master Feb 12, 2019
@lfoppiano lfoppiano deleted the mixed_matching_approach branch February 12, 2019 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants