Uploaded image for project: 'Apache Jena'
  1. Apache Jena
  2. JENA-466

a QueryEngineHTTP doesn't handle the returned content type after an execModel() call.

    XMLWordPrintableJSON

Details

    Description

      When executing this simple piece of code :

      test.java
      public class test {
      
      	public static void main(String[] argv){
      		String request = "Ask from <http://example.com#graphe> where {<http://example.com#ProofOfConcept> ?p ?o}";
      		String endpoint = "http://localhost:3030/ds/query";
      
      		Query query;
      		try{
      		query = QueryFactory.create(request);
      		}
      		catch(Exception e){
      			throw e;
      		}		
      		QueryEngineHTTP query_engine = new QueryEngineHTTP(endpoint, query);
      		try{
      			SPARQLResult spqlr = new SPARQLResult(query_engine.execDescribe());
      		}
      		finally{
      			query_engine.close();
      		}
      	}
      
      }
      

      I got the following exception :
      Exception in thread "main" com.hp.hpl.jena.query.QueryException: Endpoint returned Content Type: application/sparql-results+xml which is not a valid RDF Graph syntax
      at com.hp.hpl.jena.sparql.engine.http.QueryEngineHTTP.execModel(QueryEngineHTTP.java:275)
      at com.hp.hpl.jena.sparql.engine.http.QueryEngineHTTP.execDescribe(QueryEngineHTTP.java:251)
      at com.hp.hpl.jena.sparql.engine.http.QueryEngineHTTP.execDescribe(QueryEngineHTTP.java:248)
      at test.main(test.java:29)

      The same error occurs when I change the endpoint to a Sesame repository. So I think the problem come from the code who receive the repository response and check content type. He probably wait another content type.

      Attachments

        Activity

          People

            Unassigned Unassigned
            avl ArthurVaisse-Lesteven
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified