Search Mailing List Archives


Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[bioontology-support] [BioPortal] Feedback from fawks

Jennifer Leigh Vendetti vendetti at stanford.edu
Tue Jul 17 16:21:08 PDT 2018


Hello Alex,

Thank you for the additional information. We throttle API calls to 15 per second for each user account. Any requests beyond the 15 per second are rejected with an HTTP status code of 429. Have you tried spacing out your API calls?

Also, a couple of points you may want to consider:

1). Do you need to use the descendants endpoint? Or, is the children endpoint sufficient for you? The descendants endpoint will return *all* children, going all the way down the tree. The children endpoint will only return the *direct* children (one level deep).

2). You could modify your API calls for class data to get only the attributes you need via the include parameter, which results in a smaller response. A call to get the preferred label and cui for a MEDDRA class would look like the following:

http://data.bioontology.org/ontologies/MEDDRA/classes/http%3A%2F%2Fpurl.bioontology.org%2Fontology%2FMEDDRA%2F10028222?include=prefLabel,cui,hasChildren<http://data.bioontology.org/ontologies/MEDDRA/classes/http://purl.bioontology.org/ontology/MEDDRA/10028222?include=prefLabel,cui,hasChildren>

Notice that I also tacked on the “hasChildren” attribute. Another idea would be to check this value to see if the class has children before making an additional call to retrieve them.

3). You could turn off the hypermedia link serialization with the display_links parameter, again resulting in smaller responses:

http://data.bioontology.org/ontologies/MEDDRA/classes/http%3A%2F%2Fpurl.bioontology.org%2Fontology%2FMEDDRA%2F10028222?include=prefLabel,cui&display_links=false<http://data.bioontology.org/ontologies/MEDDRA/classes/http://purl.bioontology.org/ontology/MEDDRA/10028222?include=prefLabel,cui&display_links=false>

Hope this information is helpful.

Kind regards,
Jennifer




On Jul 17, 2018, at 12:23 PM, Alex Fawksson <fawks14 at gmail.com<mailto:fawks14 at gmail.com>> wrote:

Thank you for your prompt response. I am making a call to data.bioontology.org/ontologies/MEDDRA/classes<http://data.bioontology.org/ontologies/MEDDRA/classes>. I need to get name, cui and descendants from all classes for MEDDRA to store in db. The descendants are needed to preserve data structure so it could be later correctly displayed on front-end.

I do the call to API using apache HttpClient. Originally I tried to use spring RestTemplate but it had some issues with making calls for descendants.

The exception stack trace is this

java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:210)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:161)
at org.apache.http.impl.io.SocketInputBuffer.fillBuffer(SocketInputBuffer.java:82)
at org.apache.http.impl.io.AbstractSessionInputBuffer.readLine(AbstractSessionInputBuffer.java:278)
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:138)
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:56)
at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:259)
at org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(AbstractHttpClientConnection.java:286)
at org.apache.http.impl.conn.DefaultClientConnection.receiveResponseHeader(DefaultClientConnection.java:257)
at org.apache.http.impl.conn.ManagedClientConnectionImpl.receiveResponseHeader(ManagedClientConnectionImpl.java:207)
at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:273)
at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:125)
at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:684)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:486)
at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:835)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56)
at com.ua.satrumroom.farma.service.MeddraService.getJSON(MeddraService.java:146)
at com.ua.satrumroom.farma.service.MeddraService.parseMedOne(MeddraService.java:90)
at com.ua.satrumroom.farma.service.MeddraService.parseMedOne(MeddraService.java:105)
at com.ua.satrumroom.farma.service.MeddraService.parseMedOne(MeddraService.java:105)
at com.ua.satrumroom.farma.service.MeddraService.parseMedOne(MeddraService.java:116)
at com.ua.satrumroom.farma.service.MeddraService.parseMedOne(MeddraService.java:116)
at com.ua.satrumroom.farma.service.MeddraService$$FastClassBySpringCGLIB$$da2ae9d8.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:738)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:85)
at com.ua.satrumroom.farma.aop.logging.LoggingAspect.logAround(LoggingAspect.java:85)
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.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:627)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:616)
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:62)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:673)
at com.ua.satrumroom.farma.service.MeddraService$$EnhancerBySpringCGLIB$$ea306061.parseMedOne(<generated>)
at com.ua.satrumroom.farma.FarmaBaseApp.initApplication(FarmaBaseApp.java:64)
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.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:366)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:311)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:134)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:409)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1622)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:303)
at com.ua.satrumroom.farma.FarmaBaseApp.main(FarmaBaseApp.java:81)
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.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)


On Tue, 17 Jul 2018 21:58 Jennifer Leigh Vendetti, <vendetti at stanford.edu<mailto:vendetti at stanford.edu>> wrote:
Hello,

On Jul 17, 2018, at 11:27 AM, support at bioontology.org<mailto:support at bioontology.org> wrote:


Name: fawks

Email: fawks14 at gmail.com<mailto:fawks14 at gmail.com>

Location: http%3A%2F%2Fbioportal.bioontology.org<http://2fbioportal.bioontology.org/>%2F

Feedback:

Hi, I am currently working on java application where I need to get all MEDDRA ontologies

This is not enough information for us to help you. What do you mean by “get all MEDDRA ontologies”? Are you attempting to download the ontology source files for every submission of MEDDRA? Or, are you trying to download all the class data for MEDDRA? Please send a specific example of the API call you’re issuing.


but after approximately 200 parsed values I get connection reset. Apparently server closes the connection to me. Could you please explain to me why that could happen and what I possibly do wrong. Thank you in advance.



Please include the stack trace from your Java program.

Jennifer


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.stanford.edu/pipermail/bioontology-support/attachments/20180717/2841fc45/attachment-0001.html>


More information about the bioontology-support mailing list