Hi Reto If you create fise:TextAnnotation, fise:EntityAnnotation and/or fise:TopicAnnotations the graph should pass the unit tests for TextAnnotations (see enhancer/generic/test module; EnhancementStructureHelper).
On Thu, Jun 27, 2013 at 5:02 PM, Reto Bachmann-Gmür <r...@wymiwyg.com> wrote: > Hi Rupert, > > I would like to fix the archetype. Do you think the example is good and the > infrastructure should be fixed do this with enhancement or do you suggest > to create another enhancement. > I do not like this example. For this I would probably use a simple triple from the URI of the ContentItem that notes the length of the text as a value. For a fise:TextAnnotation you should set the fise:start/fise:end as well as the fise:selected-text best Rupert > Cheers, > Reto > > > On Thu, Jun 20, 2013 at 3:18 AM, Reto Bachmann-Gmür <r...@wymiwyg.com>wrote: > >> Hi Rupert >> >> Thanks, this explains it. >> >> In the archetype generated example there's following code: >> >> UriRef textAnnotation = >>> EnhancementEngineHelper.createTextEnhancement(ci, this); >>> metadata.add(new TripleImpl(textAnnotation, RDFS.comment, >>> new PlainLiteralImpl("A text of " + content.length() >>> + " charaters"))); >>> >> >> I guess TextEnhancement is the wrong type for such a comment on the text >> as a whole. Which type shold be used instead? >> >> Cheers, >> Reto >> >> >> On Wed, Jun 19, 2013 at 2:39 PM, Rupert Westenthaler < >> rupert.westentha...@gmail.com> wrote: >> >>> Hi Reto, >>> >>> Based on the source of "ContentItemResource" this happens if an >>> fise:TextAnnotation does not have a fise:selected-text nor a dc:type >>> value. Up to now there where no such fise:TextAnnotation created by >>> any engine. But I guess that your Engine does exactly that. >>> >>> No Idea what the UI should use as label for the mention in such cases >>> but causing a NPE ( by calling extractLabel(NULL) in line 590) is >>> probably not the best Idea >>> >>> best >>> Rupert >>> >>> On Wed, Jun 19, 2013 at 1:26 PM, Reto Bachmann-Gmür <r...@apache.org> >>> wrote: >>> > Hello >>> > >>> > After deploying a new enhancement engine created from the archetype I'm >>> > getting the exception below for chains that include the enhancer. I'm >>> using >>> > the latest trunk version both for the Stanbol instance as well as for >>> the >>> > archetype. Any idea what's causing this? >>> > >>> > Cheers, >>> > Reto >>> > >>> > [java] WARNING: A servlet request, to the URI >>> > http://localhost:8080/enhancer/chain/all-active, contains form >>> parameters >>> > in the request body but the request body has been consumed by the >>> servlet >>> > or a servlet filter accessing the request parameters. Only resource >>> methods >>> > using @FormParam will work as expected. Resource methods consuming the >>> > request body by other means will not work as expected. >>> > [java] Jun 19, 2013 12:18:14 PM >>> > com.sun.jersey.spi.container.ContainerResponse >>> mapMappableContainerException >>> > [java] SEVERE: The RuntimeException could not be mapped to a >>> response, >>> > re-throwing to the HTTP container >>> > [java] java.lang.NullPointerException >>> > [java] at >>> > >>> org.apache.stanbol.enhancer.jersey.resource.ContentItemResource.extractLabel(ContentItemResource.java:280) >>> > [java] at >>> > >>> org.apache.stanbol.enhancer.jersey.resource.ContentItemResource$EntityExtractionSummary.<init>(ContentItemResource.java:590) >>> > [java] at >>> > >>> org.apache.stanbol.enhancer.jersey.resource.ContentItemResource.initOccurrences(ContentItemResource.java:398) >>> > [java] at >>> > >>> org.apache.stanbol.enhancer.jersey.resource.ContentItemResource.<init>(ContentItemResource.java:191) >>> > [java] at >>> > >>> org.apache.stanbol.enhancer.jersey.resource.AbstractEnhancerUiResource.enhanceFromForm(AbstractEnhancerUiResource.java:131) >>> > [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native >>> > Method) >>> > [java] at >>> > >>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) >>> > [java] at >>> > >>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) >>> > [java] at java.lang.reflect.Method.invoke(Method.java:601) >>> > [java] at >>> > >>> com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60) >>> > [java] at >>> > >>> com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205) >>> > [java] at >>> > >>> com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75) >>> > [java] at >>> > >>> com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302) >>> > [java] at >>> > >>> com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108) >>> > [java] at >>> > >>> com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) >>> > [java] at >>> > >>> com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84) >>> > [java] at >>> > >>> com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1480) >>> > [java] at >>> > >>> com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1411) >>> > [java] at >>> > >>> com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1360) >>> > [java] at >>> > >>> com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1350) >>> > [java] at >>> > >>> com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416) >>> > [java] at >>> > >>> com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:538) >>> > [java] at >>> > >>> com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:716) >>> > [java] at >>> > javax.servlet.http.HttpServlet.service(HttpServlet.java:820) >>> > [java] at >>> > >>> org.apache.felix.http.base.internal.handler.ServletHandler.doHandle(ServletHandler.java:96) >>> > [java] at >>> > >>> org.apache.felix.http.base.internal.handler.ServletHandler.handle(ServletHandler.java:79) >>> > [java] at >>> > >>> org.apache.felix.http.base.internal.dispatch.ServletPipeline.handle(ServletPipeline.java:42) >>> > [java] at >>> > >>> org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFilterChain.java:49) >>> > [java] at >>> > >>> org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.java:33) >>> > [java] at >>> > >>> org.apache.stanbol.commons.httpqueryheaders.impl.QueryHeadersFilter.doFilter(QueryHeadersFilter.java:75) >>> > [java] at >>> > >>> org.apache.felix.http.base.internal.handler.FilterHandler.doHandle(FilterHandler.java:88) >>> > [java] at >>> > >>> org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:76) >>> > [java] at >>> > >>> org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFilterChain.java:47) >>> > [java] at >>> > >>> org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.java:33) >>> > [java] at >>> > >>> org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:78) >>> > [java] at >>> > >>> org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFilterChain.java:47) >>> > [java] at >>> > >>> org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.java:33) >>> > [java] at >>> > >>> org.apache.stanbol.commons.web.resources.ResourceServingFilter.doFilterHttp(ResourceServingFilter.java:148) >>> > [java] at >>> > >>> org.apache.stanbol.commons.web.resources.ResourceServingFilter.doFilter(ResourceServingFilter.java:91) >>> > [java] at >>> > >>> org.apache.felix.http.base.internal.handler.FilterHandler.doHandle(FilterHandler.java:88) >>> > [java] at >>> > >>> org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:76) >>> > [java] at >>> > >>> org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFilterChain.java:47) >>> > [java] at >>> > >>> org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.java:33) >>> > [java] at >>> > >>> org.apache.stanbol.commons.security.auth.AuthenticatingFilter$1.run(AuthenticatingFilter.java:163) >>> > [java] at java.security.AccessController.doPrivileged(Native >>> > Method) >>> > [java] at >>> > javax.security.auth.Subject.doAsPrivileged(Subject.java:536) >>> > [java] at >>> > >>> org.apache.stanbol.commons.security.auth.AuthenticatingFilter.doFilter(AuthenticatingFilter.java:159) >>> > [java] at >>> > >>> org.apache.felix.http.base.internal.handler.FilterHandler.doHandle(FilterHandler.java:88) >>> > [java] at >>> > >>> org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:76) >>> > [java] at >>> > >>> org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFilterChain.java:47) >>> > [java] at >>> > >>> org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.java:33) >>> > [java] at >>> > >>> org.apache.felix.http.base.internal.dispatch.FilterPipeline.dispatch(FilterPipeline.java:48) >>> > [java] at >>> > >>> org.apache.felix.http.base.internal.dispatch.Dispatcher.dispatch(Dispatcher.java:39) >>> > [java] at >>> > >>> org.apache.felix.http.base.internal.DispatcherServlet.service(DispatcherServlet.java:67) >>> > [java] at >>> > javax.servlet.http.HttpServlet.service(HttpServlet.java:820) >>> > [java] at >>> > org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511) >>> > [java] at >>> > org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390) >>> > [java] at >>> > org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) >>> > [java] at >>> > org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) >>> > [java] at >>> > org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) >>> > [java] at org.mortbay.jetty.Server.handle(Server.java:326) >>> > [java] at >>> > org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) >>> > [java] at >>> > >>> org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:943) >>> > [java] at >>> > org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756) >>> > [java] at >>> > org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218) >>> > [java] at >>> > org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) >>> > [java] at >>> > >>> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410) >>> > [java] at >>> > >>> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582) >>> > [java] >>> >>> >>> >>> -- >>> | Rupert Westenthaler rupert.westentha...@gmail.com >>> | Bodenlehenstraße 11 ++43-699-11108907 >>> | A-5500 Bischofshofen >>> >> >> -- | Rupert Westenthaler rupert.westentha...@gmail.com | Bodenlehenstraße 11 ++43-699-11108907 | A-5500 Bischofshofen