You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stanbol.apache.org by Maciek Sykulski <ma...@gmail.com> on 2012/09/05 20:00:17 UTC

Contenthub problems with ldpath and SPARQL endpoint

Hello Stanbol developers,

I already introduced our Early Adopters project in my previous post, for
which the demo site is here: http://bioputer.mimuw.edu.pl:9442/welcome/

In our project, we use contenthub for storing content and enhancements, we
use a predefined enhancer based on KeywordLinking Engine, and a few
enhancers written in python using Stanbol REST query API.
We indexed Uniprot database (
ftp://ftp.uniprot.org/pub/databases/uniprot/current_release/rdf/README )
using the Entityhub Indexing Tool (resulting with 10GB index).

We're running
org.apache.stanbol.launchers.full-0.10.0-incubating-SNAPSHOT.jar

Some questions:
*
*
*1. SPARQL endpoint
* "There is no registered TripleCollection."  This message shows under
sparql/ endpoint. There are content items residing inside contenthub.
I cannot ask any sparql query for content items (because of this message?).
How to fix that, to be able to ask SPARQL queries on ehnancements?

In our configuration component
org.apache.stanbol.contenthub.ldpath.solr.SemanticIndexManagerImpl is
active. What is lacking in the below configuration?

*2.* How / where to configure a triple store to be accessible through
Stanbol api,  SPARQL endpoint?

*3.* I cannot submit any *ldpath program* to contenthub. Any submit request
directed at POST:/contenthub/ldpath/program yields:

curl -i -X POST -d "name=universities&program= \
                    @prefix dbp-ont : ; \
                    city = dbp-ont:city / rdfs:label :: xsd:string; \
                    country = dbp-ont:country / rdfs:label :: xsd:string; \
                    president = dbp-ont:president / rdfs:label ::
xsd:string; \
                    numberOfStudent = dbp-ont:numberOfStudents :: xsd:int;"
                    "http://localhost:8080/contenthub/ldpath/program"
HTTP/1.1 500 Internal Server Error
Content-Type: text/html; charset=iso-8859-1
Cache-Control: must-revalidate,no-cache,no-store
Content-Length: 1414
Server: Jetty(6.1.x)

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<title>Error 500 Internal Server Error</title>
</head>
<body><h2>HTTP ERROR 500</h2>
<p>Problem accessing /contenthub/ldpath/program. Reason:
<pre>    Internal Server Error</pre></p><hr /><i><small>Powered by
Jetty://</small></i><br/>
<br/>

...and our Stanbol server logs as follows:

Aug 9, 2012 6:02:53 PM com.sun.jersey.spi.container.servlet.WebComponent
filterFormParameters
WARNING: A servlet POST request, to the URI
http://localhost:8080/contenthub/ldpath/program, contains form parameters
in the request body but the request body has be
en consumed by the servlet or a servlet filter accessing the request
parameters. Only resource methods using @FormParam will work as expected.
Resource methods consu
ming the request body by other means will not work as expected.
Aug 9, 2012 6:02:53 PM com.sun.jersey.spi.container.ContainerResponse write
SEVERE: A message body writer for Java class
org.apache.stanbol.contenthub.servicesapi.ldpath.LDPathException, and Java
type class org.apache.stanbol.contenthub.serv
icesapi.ldpath.LDPathException, and MIME media type
application/octet-stream was not found
Aug 9, 2012 6:02:53 PM com.sun.jersey.spi.container.ContainerResponse write
SEVERE: The registered message body writers compatible with the MIME media
type are:
*/* ->
  com.sun.jersey.core.impl.provider.entity.FormProvider
  com.sun.jersey.core.impl.provider.entity.MimeMultipartProvider
  com.sun.jersey.core.impl.provider.entity.StringProvider
  com.sun.jersey.core.impl.provider.entity.ByteArrayProvider
  com.sun.jersey.core.impl.provider.entity.FileProvider
  com.sun.jersey.core.impl.provider.entity.InputStreamProvider
  com.sun.jersey.core.impl.provider.entity.DataSourceProvider
  com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider$General
  com.sun.jersey.core.impl.provider.entity.ReaderProvider
  com.sun.jersey.core.impl.provider.entity.DocumentProvider
  com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider
  com.sun.jersey.core.impl.provider.entity.SourceProvider$SourceWriter
  com.sun.jersey.server.impl.template.ViewableMessageBodyWriter
  com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$General
  com.sun.jersey.core.impl.provider.entity.XMLListElementProvider$General
application/octet-stream ->
  com.sun.jersey.core.impl.provider.entity.ByteArrayProvider
  com.sun.jersey.core.impl.provider.entity.FileProvider
  com.sun.jersey.core.impl.provider.entity.InputStreamProvider
  com.sun.jersey.core.impl.provider.entity.DataSourceProvider
  com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider

Aug 9, 2012 6:02:53 PM com.sun.jersey.spi.container.ContainerResponse
logException
SEVERE: Mapped exception to response: 500 (Internal Server Error)
javax.ws.rs.WebApplicationException: com.sun.jersey.api.MessageException: A
message body writer for Java class
org.apache.stanbol.contenthub.servicesapi.ldpath.LDPathException, and Java
type class
org.apache.stanbol.contenthub.servicesapi.ldpath.LDPathException, and MIME
media type application/octet-stream was not found
        at
com.sun.jersey.spi.container.ContainerResponse.write(ContainerResponse.java:285)
        at
com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1451)
        at
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1363)
        at
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1353)
        at
com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:414)
        at
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:537)
        at
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:708)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
        at
org.apache.felix.http.base.internal.handler.ServletHandler.doHandle(ServletHandler.java:96)
        at
org.apache.felix.http.base.internal.handler.ServletHandler.handle(ServletHandler.java:79)
        at
org.apache.felix.http.base.internal.dispatch.ServletPipeline.handle(ServletPipeline.java:42)
        at
org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFilterChain.java:49)
        at
org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.java:33)
        at
org.apache.stanbol.commons.httpqueryheaders.impl.QueryHeadersFilter.doFilter(QueryHeadersFilter.java:75)
        at
org.apache.felix.http.base.internal.handler.FilterHandler.doHandle(FilterHandler.java:88)
        at
org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:76)
        at
org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFilterChain.java:47)
        at
org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.java:33)
        at
org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:78)
        at
org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFilterChain.java:47)
        at
org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.java:33)
        at
org.apache.felix.http.base.internal.dispatch.FilterPipeline.dispatch(FilterPipeline.java:48)
        at
org.apache.felix.http.base.internal.dispatch.Dispatcher.dispatch(Dispatcher.java:39)
        at
org.apache.felix.http.base.internal.DispatcherServlet.service(DispatcherServlet.java:67)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
        at
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
        at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
        at
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
        at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
        at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
        at org.mortbay.jetty.Server.handle(Server.java:326)
        at
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
        at
org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:943)
        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
        at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410)
        at
org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
Caused by: com.sun.jersey.api.MessageException: A message body writer for
Java class
org.apache.stanbol.contenthub.servicesapi.ldpath.LDPathException, and Java
type class
org.apache.stanbol.contenthub.servicesapi.ldpath.LDPathException, and MIME
media type application/octet-stream was not found
        ... 38 more


*4. Indexing Uniprot* results with huge ammount of errors of a following
type:

1:09:47,823 [Thread-3] INFO  source.ResourceLoader -  > loading
'/home/imid/stanbol/indexing/indexing/resources/rdfdata/uniprot.rdf.gz' ...
21:09:48,217 [Thread-3] ERROR impl.RDFDefaultErrorHandler - (line 6 column
82): {E211} Base URI is null, but there are relative URIs to resolve.: <#_2>
21:09:48,220 [Thread-3] WARN  impl.RDFDefaultErrorHandler - (line 6 column
82): {W136} Relative URIs are not permitted in RDF: specifically <#_2>
21:09:48,221 [Thread-3] ERROR impl.RDFDefaultErrorHandler - (line 8 column
34): {E211} Base URI is null, but there are relative URIs to resolve.: <#_2>

This is because the graph from uniprot rdf contains many self-references
like these:

<rdf:Description rdf:about="#_5136475A5833004">
<rdf:type rdf:resource="http://purl.uniprot.org/core/Gene"/>
<orfName>FV3-002L</orfName>
</rdf:Description>
<rdf:Description rdf:about="#_5136475A5833005">
<rdf:type rdf:resource="
http://purl.uniprot.org/core/Subcellular_Location_Annotation"/>
<locatedIn rdf:resource="#_5136475A5833006"/>
</rdf:Description>

Our workaround for this was to not care for now and to 'grep' to minimize
the log file:
    > java -Xmx2048m -jar
org.apache.stanbol.entityhub.indexing.genericrdf-*-jar-with-dependencies.jar
index | grep -v '{E211} Base URI is null' | grep -v '{W136} Relative URIs'
> indexing/log_indexing.txt

However, is there a way to index such entities? (other way than manually
replace them inside rdf with absolute URLs)?


Thanks,
Maciek

Re: Contenthub problems with ldpath and SPARQL endpoint

Posted by Meriç Taze <me...@gmail.com>.
Hi,

2012/9/5 Maciek Sykulski <ma...@gmail.com>

>
> *1. SPARQL endpoint
> * "There is no registered TripleCollection."  This message shows under
> sparql/ endpoint. There are content items residing inside contenthub.
> I cannot ask any sparql query for content items (because of this message?).
> How to fix that, to be able to ask SPARQL queries on ehnancements?
>
> In our configuration component
> org.apache.stanbol.contenthub.ldpath.solr.SemanticIndexManagerImpl is
> active. What is lacking in the below configuration?
>

In first run after building stanbol, there is no enhancement graph. After
creating
your first contentitem, graph is created by TcManager and it appears in
/sparql
endpoint. However, due to a bug in SolrStoreImpl, when you restart your
launcher or rebuild it with this command:

    mvn -o install -DskipTests -P installBundle
            -Dsling.url=http://localhost:8080/system/console

graph will still exist but it is not registered in the OSGi environment
anymore.
Therefore, sparql endpoint can not reach the enhancement graph. I'll create
an issue and a patch file for this bug.



> *2.* How / where to configure a triple store to be accessible through
> Stanbol api,  SPARQL endpoint?
>
>
I think this is the answer of your question:

http://mail-archives.apache.org/mod_mbox/incubator-stanbol-dev/201206.mbox/%3CCAA7LAO0wqetBwT1GwEGQe_hWpd3Lfhjmiy4LmQ8xDW0GmkDBqw@mail.gmail.com%3E

Best,
Meric.

Re: Contenthub problems with ldpath and SPARQL endpoint

Posted by Suat Gonul <su...@gmail.com>.
Hi Maciek,

Thanks for the feedback. However, the error you point out seems the one
printed to the standard output. The log printed into the
.../stanbol/logs/error.log file should indicate the correct error. That
is the default target log file. Anyway, Contenthub registers the
enhancement graph to the OSGi environment in the initialization now. So,
you should be able to execute SPARQL queries on it.

Best,
Suat

On 09/07/2012 04:00 PM, Maciek Sykulski wrote:
> Hi Sergio,
>
> Thank you, this was indeed the problem, I should've tested it better.
>
> However, the server log messages did not point to ldpath program being
> wrong.
> Deducing from this server error message, I suppose that something may be
> wrong with logging Exeptions:
>
> Aug 9, 2012 6:02:53 PM com.sun.jersey.spi.container.ContainerResponse
>> logException
>> SEVERE: Mapped exception to response: 500 (Internal Server Error)
>> javax.ws.rs.WebApplicationException: com.sun.jersey.api.MessageException:
>> A message body writer for Java class org.apache.stanbol.contenthub.
>> servicesapi.ldpath.LDPathException, and Java type class
>> org.apache.stanbol.contenthub.servicesapi.ldpath.LDPathException, and
>> MIME media type application/octet-stream was not found
>>         at com.sun.jersey.spi.container.ContainerResponse.write(
>> ContainerResponse.java:285)
>>
> Thanks,
> Maciek
>
> On Thu, Sep 6, 2012 at 8:51 AM, Sergio Fernández <
> sergio.fernandez@salzburgresearch.at> wrote:
>
>> Hi,
>>
>> On 09/05/2012 08:00 PM, Maciek Sykulski wrote:
>>
>>> *3.* I cannot submit any *ldpath program* to contenthub. Any submit
>>> request
>>>
>>> directed at POST:/contenthub/ldpath/**program yields:
>>>
>>> curl -i -X POST -d "name=universities&program= \
>>>                      @prefix dbp-ont : ; \
>>>                      city = dbp-ont:city / rdfs:label :: xsd:string; \
>>>                      country = dbp-ont:country / rdfs:label ::
>>> xsd:string; \
>>>                      president = dbp-ont:president / rdfs:label ::
>>> xsd:string; \
>>>                      numberOfStudent = dbp-ont:numberOfStudents ::
>>> xsd:int;"
>>>                      "http://localhost:8080/**contenthub/ldpath/program<http://localhost:8080/contenthub/ldpath/program>
>>> "
>>> HTTP/1.1 500 Internal Server Error
>>>
>> Looks that the prefix declaration uses a wrong LDPath syntax, the
>> namespace is missing. You'd need to use something like:
>>
>> @prefix dbp-ont : <http://dbpedia.org/ontology/> ;
>>
>> and it should work.
>>
>> For further details, please check the path language specification:
>>
>> http://code.google.com/p/**ldpath/wiki/PathLanguage#**
>> Namespace_Definitions<http://code.google.com/p/ldpath/wiki/PathLanguage#Namespace_Definitions>
>>
>> Kind regards,
>>
>> --
>> Sergio Fernández
>> Salzburg Research
>> +43 662 2288 318
>> Jakob-Haringer Strasse 5/II
>> A-5020 Salzburg (Austria)
>> http://www.salzburgresearch.at
>>
>
>
>
>
>> ...and our Stanbol server logs as follows:
>> Aug 9, 2012 6:02:53 PM com.sun.jersey.spi.container.servlet.WebComponent
>> filterFormParameters
>> WARNING: A servlet POST request, to the URI
>> http://localhost:8080/contenthub/ldpath/program, contains form parameters
>> in the request body but the request body has be
>> en consumed by the servlet or a servlet filter accessing the request
>> parameters. Only resource methods using @FormParam will work as expected.
>> Resource methods consu
>> ming the request body by other means will not work as expected.
>> Aug 9, 2012 6:02:53 PM com.sun.jersey.spi.container.ContainerResponse
>> write
>> SEVERE: A message body writer for Java class org.apache.stanbol.contenthub.
>> servicesapi.ldpath.LDPathException, and Java type class
>> org.apache.stanbol.contenthub.serv
>> icesapi.ldpath.LDPathException, and MIME media type
>> application/octet-stream was not found
>> Aug 9, 2012 6:02:53 PM com.sun.jersey.spi.container.ContainerResponse
>> write
>> SEVERE: The registered message body writers compatible with the MIME media
>> type are:
>> */* ->
>>   com.sun.jersey.core.impl.provider.entity.FormProvider
>>   com.sun.jersey.core.impl.provider.entity.MimeMultipartProvider
>>   com.sun.jersey.core.impl.provider.entity.StringProvider
>>   com.sun.jersey.core.impl.provider.entity.ByteArrayProvider
>>   com.sun.jersey.core.impl.provider.entity.FileProvider
>>   com.sun.jersey.core.impl.provider.entity.InputStreamProvider
>>   com.sun.jersey.core.impl.provider.entity.DataSourceProvider
>>   com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider$General
>>   com.sun.jersey.core.impl.provider.entity.ReaderProvider
>>   com.sun.jersey.core.impl.provider.entity.DocumentProvider
>>   com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider
>>   com.sun.jersey.core.impl.provider.entity.SourceProvider$SourceWriter
>>   com.sun.jersey.server.impl.template.ViewableMessageBodyWriter
>>   com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$General
>>   com.sun.jersey.core.impl.provider.entity.XMLListElementProvider$General
>> application/octet-stream ->
>>   com.sun.jersey.core.impl.provider.entity.ByteArrayProvider
>>   com.sun.jersey.core.impl.provider.entity.FileProvider
>>   com.sun.jersey.core.impl.provider.entity.InputStreamProvider
>>   com.sun.jersey.core.impl.provider.entity.DataSourceProvider
>>   com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider
>> Aug 9, 2012 6:02:53 PM com.sun.jersey.spi.container.ContainerResponse
>> logException
>> SEVERE: Mapped exception to response: 500 (Internal Server Error)
>> javax.ws.rs.WebApplicationException: com.sun.jersey.api.MessageException:
>> A message body writer for Java class org.apache.stanbol.contenthub.
>> servicesapi.ldpath.LDPathException, and Java type class
>> org.apache.stanbol.contenthub.servicesapi.ldpath.LDPathException, and
>> MIME media type application/octet-stream was not found
>>         at com.sun.jersey.spi.container.ContainerResponse.write(
>> ContainerResponse.java:285)
>>         at com.sun.jersey.server.impl.application.WebApplicationImpl._
>> handleRequest(WebApplicationImpl.java:1451)
>>         at com.sun.jersey.server.impl.application.WebApplicationImpl.
>> handleRequest(WebApplicationImpl.java:1363)
>>         at com.sun.jersey.server.impl.application.WebApplicationImpl.
>> handleRequest(WebApplicationImpl.java:1353)
>>         at com.sun.jersey.spi.container.servlet.WebComponent.service(
>> WebComponent.java:414)
>>         at com.sun.jersey.spi.container.servlet.ServletContainer.
>> service(ServletContainer.java:537)
>>         at com.sun.jersey.spi.container.servlet.ServletContainer.
>> service(ServletContainer.java:708)
>>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
>>         at org.apache.felix.http.base.internal.handler.
>> ServletHandler.doHandle(ServletHandler.java:96)
>>         at org.apache.felix.http.base.internal.handler.
>> ServletHandler.handle(ServletHandler.java:79)
>>         at org.apache.felix.http.base.internal.dispatch.
>> ServletPipeline.handle(ServletPipeline.java:42)
>>         at org.apache.felix.http.base.internal.dispatch.
>> InvocationFilterChain.doFilter(InvocationFilterChain.java:49)
>>         at org.apache.felix.http.base.internal.dispatch.
>> HttpFilterChain.doFilter(HttpFilterChain.java:33)
>>         at org.apache.stanbol.commons.httpqueryheaders.impl.
>> QueryHeadersFilter.doFilter(QueryHeadersFilter.java:75)
>>         at org.apache.felix.http.base.internal.handler.
>> FilterHandler.doHandle(FilterHandler.java:88)
>>         at org.apache.felix.http.base.internal.handler.
>> FilterHandler.handle(FilterHandler.java:76)
>>         at org.apache.felix.http.base.internal.dispatch.
>> InvocationFilterChain.doFilter(InvocationFilterChain.java:47)
>>         at org.apache.felix.http.base.internal.dispatch.
>> HttpFilterChain.doFilter(HttpFilterChain.java:33)
>>         at org.apache.felix.http.base.internal.handler.
>> FilterHandler.handle(FilterHandler.java:78)
>>         at org.apache.felix.http.base.internal.dispatch.
>> InvocationFilterChain.doFilter(InvocationFilterChain.java:47)
>>         at org.apache.felix.http.base.internal.dispatch.
>> HttpFilterChain.doFilter(HttpFilterChain.java:33)
>>         at org.apache.felix.http.base.internal.dispatch.
>> FilterPipeline.dispatch(FilterPipeline.java:48)
>>         at org.apache.felix.http.base.internal.dispatch.Dispatcher.
>> dispatch(Dispatcher.java:39)
>>         at org.apache.felix.http.base.internal.DispatcherServlet.
>> service(DispatcherServlet.java:67)
>>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
>>         at org.mortbay.jetty.servlet.ServletHolder.handle(
>> ServletHolder.java:511)
>>         at org.mortbay.jetty.servlet.ServletHandler.handle(
>> ServletHandler.java:390)
>>         at org.mortbay.jetty.servlet.SessionHandler.handle(
>> SessionHandler.java:182)
>>         at org.mortbay.jetty.handler.ContextHandler.handle(
>> ContextHandler.java:765)
>>         at org.mortbay.jetty.handler.HandlerWrapper.handle(
>> HandlerWrapper.java:152)
>>         at org.mortbay.jetty.Server.handle(Server.java:326)
>>         at org.mortbay.jetty.HttpConnection.handleRequest(
>> HttpConnection.java:542)
>>         at org.mortbay.jetty.HttpConnection$RequestHandler.
>> content(HttpConnection.java:943)
>>         at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
>>         at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.
>> java:218)
>>         at org.mortbay.jetty.HttpConnection.handle(
>> HttpConnection.java:404)
>>         at org.mortbay.io.nio.SelectChannelEndPoint.run(
>> SelectChannelEndPoint.java:410)
>>         at org.mortbay.thread.QueuedThreadPool$PoolThread.
>> run(QueuedThreadPool.java:582)
>> Caused by: com.sun.jersey.api.MessageException: A message body writer for
>> Java class org.apache.stanbol.contenthub.servicesapi.ldpath.LDPathException,
>> and Java type class org.apache.stanbol.contenthub.servicesapi.ldpath.LDPathException,
>> and MIME media type application/octet-stream was not found
>>         ... 38 more
>>
>>


Re: Contenthub problems with ldpath and SPARQL endpoint

Posted by Maciek Sykulski <ma...@gmail.com>.
Hi Sergio,

Thank you, this was indeed the problem, I should've tested it better.

However, the server log messages did not point to ldpath program being
wrong.
Deducing from this server error message, I suppose that something may be
wrong with logging Exeptions:

Aug 9, 2012 6:02:53 PM com.sun.jersey.spi.container.ContainerResponse
> logException
> SEVERE: Mapped exception to response: 500 (Internal Server Error)
> javax.ws.rs.WebApplicationException: com.sun.jersey.api.MessageException:
> A message body writer for Java class org.apache.stanbol.contenthub.
> servicesapi.ldpath.LDPathException, and Java type class
> org.apache.stanbol.contenthub.servicesapi.ldpath.LDPathException, and
> MIME media type application/octet-stream was not found
>         at com.sun.jersey.spi.container.ContainerResponse.write(
> ContainerResponse.java:285)
>

Thanks,
Maciek

On Thu, Sep 6, 2012 at 8:51 AM, Sergio Fernández <
sergio.fernandez@salzburgresearch.at> wrote:

> Hi,
>
> On 09/05/2012 08:00 PM, Maciek Sykulski wrote:
>
>> *3.* I cannot submit any *ldpath program* to contenthub. Any submit
>> request
>>
>> directed at POST:/contenthub/ldpath/**program yields:
>>
>> curl -i -X POST -d "name=universities&program= \
>>                      @prefix dbp-ont : ; \
>>                      city = dbp-ont:city / rdfs:label :: xsd:string; \
>>                      country = dbp-ont:country / rdfs:label ::
>> xsd:string; \
>>                      president = dbp-ont:president / rdfs:label ::
>> xsd:string; \
>>                      numberOfStudent = dbp-ont:numberOfStudents ::
>> xsd:int;"
>>                      "http://localhost:8080/**contenthub/ldpath/program<http://localhost:8080/contenthub/ldpath/program>
>> "
>> HTTP/1.1 500 Internal Server Error
>>
>
> Looks that the prefix declaration uses a wrong LDPath syntax, the
> namespace is missing. You'd need to use something like:
>
> @prefix dbp-ont : <http://dbpedia.org/ontology/> ;
>
> and it should work.
>
> For further details, please check the path language specification:
>
> http://code.google.com/p/**ldpath/wiki/PathLanguage#**
> Namespace_Definitions<http://code.google.com/p/ldpath/wiki/PathLanguage#Namespace_Definitions>
>
> Kind regards,
>
> --
> Sergio Fernández
> Salzburg Research
> +43 662 2288 318
> Jakob-Haringer Strasse 5/II
> A-5020 Salzburg (Austria)
> http://www.salzburgresearch.at
>



>



> ...and our Stanbol server logs as follows:
> Aug 9, 2012 6:02:53 PM com.sun.jersey.spi.container.servlet.WebComponent
> filterFormParameters
> WARNING: A servlet POST request, to the URI
> http://localhost:8080/contenthub/ldpath/program, contains form parameters
> in the request body but the request body has be
> en consumed by the servlet or a servlet filter accessing the request
> parameters. Only resource methods using @FormParam will work as expected.
> Resource methods consu
> ming the request body by other means will not work as expected.
> Aug 9, 2012 6:02:53 PM com.sun.jersey.spi.container.ContainerResponse
> write
> SEVERE: A message body writer for Java class org.apache.stanbol.contenthub.
> servicesapi.ldpath.LDPathException, and Java type class
> org.apache.stanbol.contenthub.serv
> icesapi.ldpath.LDPathException, and MIME media type
> application/octet-stream was not found
> Aug 9, 2012 6:02:53 PM com.sun.jersey.spi.container.ContainerResponse
> write
> SEVERE: The registered message body writers compatible with the MIME media
> type are:
> */* ->
>   com.sun.jersey.core.impl.provider.entity.FormProvider
>   com.sun.jersey.core.impl.provider.entity.MimeMultipartProvider
>   com.sun.jersey.core.impl.provider.entity.StringProvider
>   com.sun.jersey.core.impl.provider.entity.ByteArrayProvider
>   com.sun.jersey.core.impl.provider.entity.FileProvider
>   com.sun.jersey.core.impl.provider.entity.InputStreamProvider
>   com.sun.jersey.core.impl.provider.entity.DataSourceProvider
>   com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider$General
>   com.sun.jersey.core.impl.provider.entity.ReaderProvider
>   com.sun.jersey.core.impl.provider.entity.DocumentProvider
>   com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider
>   com.sun.jersey.core.impl.provider.entity.SourceProvider$SourceWriter
>   com.sun.jersey.server.impl.template.ViewableMessageBodyWriter
>   com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$General
>   com.sun.jersey.core.impl.provider.entity.XMLListElementProvider$General
> application/octet-stream ->
>   com.sun.jersey.core.impl.provider.entity.ByteArrayProvider
>   com.sun.jersey.core.impl.provider.entity.FileProvider
>   com.sun.jersey.core.impl.provider.entity.InputStreamProvider
>   com.sun.jersey.core.impl.provider.entity.DataSourceProvider
>   com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider
> Aug 9, 2012 6:02:53 PM com.sun.jersey.spi.container.ContainerResponse
> logException
> SEVERE: Mapped exception to response: 500 (Internal Server Error)
> javax.ws.rs.WebApplicationException: com.sun.jersey.api.MessageException:
> A message body writer for Java class org.apache.stanbol.contenthub.
> servicesapi.ldpath.LDPathException, and Java type class
> org.apache.stanbol.contenthub.servicesapi.ldpath.LDPathException, and
> MIME media type application/octet-stream was not found
>         at com.sun.jersey.spi.container.ContainerResponse.write(
> ContainerResponse.java:285)
>         at com.sun.jersey.server.impl.application.WebApplicationImpl._
> handleRequest(WebApplicationImpl.java:1451)
>         at com.sun.jersey.server.impl.application.WebApplicationImpl.
> handleRequest(WebApplicationImpl.java:1363)
>         at com.sun.jersey.server.impl.application.WebApplicationImpl.
> handleRequest(WebApplicationImpl.java:1353)
>         at com.sun.jersey.spi.container.servlet.WebComponent.service(
> WebComponent.java:414)
>         at com.sun.jersey.spi.container.servlet.ServletContainer.
> service(ServletContainer.java:537)
>         at com.sun.jersey.spi.container.servlet.ServletContainer.
> service(ServletContainer.java:708)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
>         at org.apache.felix.http.base.internal.handler.
> ServletHandler.doHandle(ServletHandler.java:96)
>         at org.apache.felix.http.base.internal.handler.
> ServletHandler.handle(ServletHandler.java:79)
>         at org.apache.felix.http.base.internal.dispatch.
> ServletPipeline.handle(ServletPipeline.java:42)
>         at org.apache.felix.http.base.internal.dispatch.
> InvocationFilterChain.doFilter(InvocationFilterChain.java:49)
>         at org.apache.felix.http.base.internal.dispatch.
> HttpFilterChain.doFilter(HttpFilterChain.java:33)
>         at org.apache.stanbol.commons.httpqueryheaders.impl.
> QueryHeadersFilter.doFilter(QueryHeadersFilter.java:75)
>         at org.apache.felix.http.base.internal.handler.
> FilterHandler.doHandle(FilterHandler.java:88)
>         at org.apache.felix.http.base.internal.handler.
> FilterHandler.handle(FilterHandler.java:76)
>         at org.apache.felix.http.base.internal.dispatch.
> InvocationFilterChain.doFilter(InvocationFilterChain.java:47)
>         at org.apache.felix.http.base.internal.dispatch.
> HttpFilterChain.doFilter(HttpFilterChain.java:33)
>         at org.apache.felix.http.base.internal.handler.
> FilterHandler.handle(FilterHandler.java:78)
>         at org.apache.felix.http.base.internal.dispatch.
> InvocationFilterChain.doFilter(InvocationFilterChain.java:47)
>         at org.apache.felix.http.base.internal.dispatch.
> HttpFilterChain.doFilter(HttpFilterChain.java:33)
>         at org.apache.felix.http.base.internal.dispatch.
> FilterPipeline.dispatch(FilterPipeline.java:48)
>         at org.apache.felix.http.base.internal.dispatch.Dispatcher.
> dispatch(Dispatcher.java:39)
>         at org.apache.felix.http.base.internal.DispatcherServlet.
> service(DispatcherServlet.java:67)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
>         at org.mortbay.jetty.servlet.ServletHolder.handle(
> ServletHolder.java:511)
>         at org.mortbay.jetty.servlet.ServletHandler.handle(
> ServletHandler.java:390)
>         at org.mortbay.jetty.servlet.SessionHandler.handle(
> SessionHandler.java:182)
>         at org.mortbay.jetty.handler.ContextHandler.handle(
> ContextHandler.java:765)
>         at org.mortbay.jetty.handler.HandlerWrapper.handle(
> HandlerWrapper.java:152)
>         at org.mortbay.jetty.Server.handle(Server.java:326)
>         at org.mortbay.jetty.HttpConnection.handleRequest(
> HttpConnection.java:542)
>         at org.mortbay.jetty.HttpConnection$RequestHandler.
> content(HttpConnection.java:943)
>         at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
>         at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.
> java:218)
>         at org.mortbay.jetty.HttpConnection.handle(
> HttpConnection.java:404)
>         at org.mortbay.io.nio.SelectChannelEndPoint.run(
> SelectChannelEndPoint.java:410)
>         at org.mortbay.thread.QueuedThreadPool$PoolThread.
> run(QueuedThreadPool.java:582)
> Caused by: com.sun.jersey.api.MessageException: A message body writer for
> Java class org.apache.stanbol.contenthub.servicesapi.ldpath.LDPathException,
> and Java type class org.apache.stanbol.contenthub.servicesapi.ldpath.LDPathException,
> and MIME media type application/octet-stream was not found
>         ... 38 more
>
>

Re: Contenthub problems with ldpath and SPARQL endpoint

Posted by Sergio Fernández <se...@salzburgresearch.at>.
Hi,

On 09/05/2012 08:00 PM, Maciek Sykulski wrote:
> *3.* I cannot submit any *ldpath program* to contenthub. Any submit request
> directed at POST:/contenthub/ldpath/program yields:
>
> curl -i -X POST -d "name=universities&program= \
>                      @prefix dbp-ont : ; \
>                      city = dbp-ont:city / rdfs:label :: xsd:string; \
>                      country = dbp-ont:country / rdfs:label :: xsd:string; \
>                      president = dbp-ont:president / rdfs:label ::
> xsd:string; \
>                      numberOfStudent = dbp-ont:numberOfStudents :: xsd:int;"
>                      "http://localhost:8080/contenthub/ldpath/program"
> HTTP/1.1 500 Internal Server Error

Looks that the prefix declaration uses a wrong LDPath syntax, the 
namespace is missing. You'd need to use something like:

@prefix dbp-ont : <http://dbpedia.org/ontology/> ;

and it should work.

For further details, please check the path language specification:

http://code.google.com/p/ldpath/wiki/PathLanguage#Namespace_Definitions

Kind regards,

-- 
Sergio Fernández
Salzburg Research
+43 662 2288 318
Jakob-Haringer Strasse 5/II
A-5020 Salzburg (Austria)
http://www.salzburgresearch.at

Re: Contenthub problems with ldpath and SPARQL endpoint

Posted by Rupert Westenthaler <ru...@gmail.com>.
On Wed, Sep 5, 2012 at 8:00 PM, Maciek Sykulski <ma...@gmail.com> wrote:
>
> *4. Indexing Uniprot* results with huge ammount of errors of a following
> type:
[..]
> 21:09:48,217 [Thread-3] ERROR impl.RDFDefaultErrorHandler - (line 6 column
> 82): {E211} Base URI is null, but there are relative URIs to resolve.: <#_2>
[..]

I think this is because the RDF/XML file is missing the xml:base header.

See
   http://www.w3.org/TR/2003/PR-rdf-syntax-grammar-20031215/#section-Syntax-ID-xml-base

>
> This is because the graph from uniprot rdf contains many self-references
> like these:

I added

<?xml version="1.0"?>
<rdf:RDF xmlns="http://default.namespace.org/namesoace"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xml:base="http://base.example.com/base-uir-demo">

>
> <rdf:Description rdf:about="#_5136475A5833004">
> <rdf:type rdf:resource="http://purl.uniprot.org/core/Gene"/>
> <orfName>FV3-002L</orfName>
> </rdf:Description>
> <rdf:Description rdf:about="#_5136475A5833005">
> <rdf:type rdf:resource="
> http://purl.uniprot.org/core/Subcellular_Location_Annotation"/>
> <locatedIn rdf:resource="#_5136475A5833006"/>
> </rdf:Description>

</rdf:RDF>

and where able to import the data of this snippet without any
ERROR/WARN messages

> However, is there a way to index such entities? (other way than manually
> replace them inside rdf with absolute URLs)?

adding the correct xml:base as described about should fix this problem.

best
Rupert


-- 
| Rupert Westenthaler             rupert.westenthaler@gmail.com
| Bodenlehenstraße 11                             ++43-699-11108907
| A-5500 Bischofshofen