Hello Sirs at Jena, 

I get this stacktrace warning from Jena 3.12.0 on NetBeans IDE:

org.apache.jena.query.QueryException: Endpoint returned Content-Type: text/html 
which is not rcognized for SELECT queries

I’m trying to make the example query given at http://revyu.com/sparql/queryform 
<http://revyu.com/sparql/queryform> 
but this time remotely against the revyu.com/sparql <http://revyu.com/sparql> 
endpoint, using the following class/main method: 


import org.apache.jena.query.* ;
import org.apache.jena.sparql.engine.http.QueryEngineHTTP ;

public class SPARQLEndpointQuery
{
    static public void main(String...argv) {

        String queryStr =       "PREFIX rev: <http://purl.org/stuff/rev#>\n" +
                                        "PREFIX rdfs: 
<http://www.w3.org/2000/01/rdf-schema#> \n" +
                                        "\n" +     
                                        "SELECT DISTINCT ?thing ?name ?review 
?createdOn \n" +
                                        "WHERE \n" +
                                        "{ \n" +
                                        "?thing rdfs:label ?name .\n" +
                                        "?thing rev:hasReview ?review .\n" +
                                        "?review rev:reviewer <people/tom> . 
\n" +
                                        "?review rev:createdOn ?createdOn \n" +
                                        "} \n" +
                                        "LIMIT 2 OFFSET 0";
        
        Query query = QueryFactory.create(queryStr);

        // Remote execution.
        try ( QueryExecution qexec = 
QueryExecutionFactory.sparqlService("http://revyu.com/sparql";, query) ) { 
            // Set the endpoint specific timeout:
            ((QueryEngineHTTP)qexec).addParam("timeout", "10000") ;

            // Execute:
            ResultSet rs = qexec.execSelect();
            ResultSetFormatter.out(System.out, rs, query);

        } catch (Exception e) {
            e.printStackTrace();
        }

    }
}


I don’t know why it doesn’t work… on a similar query against the 
DBpedia.com/sparql <http://dbpedia.com/sparql> endpoint everything worked fine.
Any hint? Thank you in advance

Best Regards
Hyrundo

Reply via email to