You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Олег Герасин <go...@gmail.com> on 2017/01/30 07:17:27 UTC
Fwd: Endpoint returned Content-Type: text/html
Hello there!
Excuse me, I was not subscribed for replies, If someone replied, please
resend It.
Thank you!
---------- Forwarded message ----------
From: Олег Герасин <ov...@gmail.com>
Date: 2017-01-30 1:00 GMT+03:00
Subject: Endpoint returned Content-Type: text/html
To: users@jena.apache.org
Hello!
Please, help me!
When I try to send a sparql query to some endpoint, for example:
> QueryExecution qe = QueryExecutionFactory.sparqlService("http://data.
> open.ac.uk/sparql",
> getStringForQuery());
> ResultSet results = qe.execSelect();
I get
> Exception in thread "main" org.apache.jena.query.QueryException: Endpoint
> returned Content-Type: text/html which is not currently supported for
> SELECT queries
> at org.apache.jena.sparql.engine.http.QueryEngineHTTP.execResultSetInner(
> QueryEngineHTTP.java:372)
> at org.apache.jena.sparql.engine.http.QueryEngineHTTP.
> execSelect(QueryEngineHTTP.java:334)
And this is nit the only one endpoint, to which I can't send query,
What should I do to get results in other content-type? I try to google it,
but I found that it can happen if I send query to bad html (not sparql
endpoint), but http://data.open.ac.uk/sparql is good endpoint, I send
sparql query to it via python and everything was good,
Best regards,
Oleg Gerasin
Re: Fwd: Endpoint returned Content-Type: text/html
Posted by Олег Герасин <ov...@gmail.com>.
Thank you for your answers, it works!
On Jan 30, 2017 13:18, "Andy Seaborne" <an...@apache.org> wrote:
>
>
> On 30/01/17 08:23, Lorenz B. wrote:
>
>> I don't know what kind of backend they use, but for whatever reason, you
>> have to use an additional HTTP parameter force=true when using the
>> SPARQL endpoint from external services:
>>
>> http://data.open.ac.uk/sparql?force=true
>>
>>
>>
>> select distinct ?Concept where {[] a ?Concept}
>>> LIMIT 100
>>>
>>
>>
> This is a bug in Jena 3.1.1 to do with redirection handling.
>
> It works in 3.1.0 and in the development branch.
>
> Adding ?force=true works because it is where the redirection goes.
>
> Andy
>
> > I don't know what kind of backend they use,
>
> Apache Jena Fuseki 2.3.1
>
> (It's in the HTTP response header.)
>
Re: Fwd: Endpoint returned Content-Type: text/html
Posted by Andy Seaborne <an...@apache.org>.
On 30/01/17 08:23, Lorenz B. wrote:
> I don't know what kind of backend they use, but for whatever reason, you
> have to use an additional HTTP parameter force=true when using the
> SPARQL endpoint from external services:
>
> http://data.open.ac.uk/sparql?force=true
>
>
>
>> select distinct ?Concept where {[] a ?Concept}
>> LIMIT 100
>
This is a bug in Jena 3.1.1 to do with redirection handling.
It works in 3.1.0 and in the development branch.
Adding ?force=true works because it is where the redirection goes.
Andy
> I don't know what kind of backend they use,
Apache Jena Fuseki 2.3.1
(It's in the HTTP response header.)
Re: Fwd: Endpoint returned Content-Type: text/html
Posted by "Lorenz B." <bu...@informatik.uni-leipzig.de>.
I don't know what kind of backend they use, but for whatever reason, you
have to use an additional HTTP parameter force=true when using the
SPARQL endpoint from external services:
http://data.open.ac.uk/sparql?force=true
> select distinct ?Concept where {[] a ?Concept}
> LIMIT 100
--
Lorenz B�hmann
AKSW group, University of Leipzig
Group: http://aksw.org - semantic web research center
Re: Fwd: Endpoint returned Content-Type: text/html
Posted by Олег Герасин <ov...@gmail.com>.
Thank you for your answer!
My query is right because I check it on the site as I replied on
Stackoverflow.
The simple queries such as "select distinct ?Concept where {[] a ?Concept}
LIMIT 100" or "select distinct * where {?x ?y ?z} LIMIT 100" don't work in
jena but work on the site
2017-01-30 10:29 GMT+03:00 Lorenz B. <bu...@informatik.uni-leipzig.de>:
> As I said on Stackoverflow, please show the SPARQL query String that is
> created by getStringForQuery()
>
> I looks like this query has somes yntax error such that the endpoint
> returns an HTML error page instead of the resultset format.
>
> > Hello there!
> >
> > Excuse me, I was not subscribed for replies, If someone replied, please
> > resend It.
> > Thank you!
> >
> > ---------- Forwarded message ----------
> > From: Олег Герасин <ov...@gmail.com>
> > Date: 2017-01-30 1:00 GMT+03:00
> > Subject: Endpoint returned Content-Type: text/html
> > To: users@jena.apache.org
> >
> > Hello!
> >
> > Please, help me!
> >
> > When I try to send a sparql query to some endpoint, for example:
> >
> >> QueryExecution qe = QueryExecutionFactory.sparqlService("http://data.
> >> open.ac.uk/sparql",
> >> getStringForQuery());
> >> ResultSet results = qe.execSelect();
> > I get
> >
> >> Exception in thread "main" org.apache.jena.query.QueryException:
> Endpoint
> >> returned Content-Type: text/html which is not currently supported for
> >> SELECT queries
> >> at org.apache.jena.sparql.engine.http.QueryEngineHTTP.
> execResultSetInner(
> >> QueryEngineHTTP.java:372)
> >> at org.apache.jena.sparql.engine.http.QueryEngineHTTP.
> >> execSelect(QueryEngineHTTP.java:334)
> >
> > And this is nit the only one endpoint, to which I can't send query,
> >
> > What should I do to get results in other content-type? I try to google
> it,
> > but I found that it can happen if I send query to bad html (not sparql
> > endpoint), but http://data.open.ac.uk/sparql is good endpoint, I send
> > sparql query to it via python and everything was good,
> >
> > Best regards,
> > Oleg Gerasin
> >
> --
> Lorenz Bühmann
> AKSW group, University of Leipzig
> Group: http://aksw.org - semantic web research center
>
>
Re: Fwd: Endpoint returned Content-Type: text/html
Posted by "Lorenz B." <bu...@informatik.uni-leipzig.de>.
As I said on Stackoverflow, please show the SPARQL query String that is
created by getStringForQuery()
I looks like this query has somes yntax error such that the endpoint
returns an HTML error page instead of the resultset format.
> Hello there!
>
> Excuse me, I was not subscribed for replies, If someone replied, please
> resend It.
> Thank you!
>
> ---------- Forwarded message ----------
> From: \u041e\u043b\u0435\u0433 \u0413\u0435\u0440\u0430\u0441\u0438\u043d <ov...@gmail.com>
> Date: 2017-01-30 1:00 GMT+03:00
> Subject: Endpoint returned Content-Type: text/html
> To: users@jena.apache.org
>
> Hello!
>
> Please, help me!
>
> When I try to send a sparql query to some endpoint, for example:
>
>> QueryExecution qe = QueryExecutionFactory.sparqlService("http://data.
>> open.ac.uk/sparql",
>> getStringForQuery());
>> ResultSet results = qe.execSelect();
> I get
>
>> Exception in thread "main" org.apache.jena.query.QueryException: Endpoint
>> returned Content-Type: text/html which is not currently supported for
>> SELECT queries
>> at org.apache.jena.sparql.engine.http.QueryEngineHTTP.execResultSetInner(
>> QueryEngineHTTP.java:372)
>> at org.apache.jena.sparql.engine.http.QueryEngineHTTP.
>> execSelect(QueryEngineHTTP.java:334)
>
> And this is nit the only one endpoint, to which I can't send query,
>
> What should I do to get results in other content-type? I try to google it,
> but I found that it can happen if I send query to bad html (not sparql
> endpoint), but http://data.open.ac.uk/sparql is good endpoint, I send
> sparql query to it via python and everything was good,
>
> Best regards,
> Oleg Gerasin
>
--
Lorenz B�hmann
AKSW group, University of Leipzig
Group: http://aksw.org - semantic web research center