* @return the response
*/
private Response executeLDPathQuery(Entityhub entityhub,FieldQuery query, String ldpathProgramString, MediaType mediaType, HttpHeaders headers) {
QueryResultList<Representation> result;
ValueFactory vf = new RdfValueFactory(new IndexedMGraph());
EntityhubBackend backend = new EntityhubBackend(entityhub);
EntityhubLDPath ldPath = new EntityhubLDPath(backend,vf);
//copy the selected fields, because we might need to delete some during
//the preparation phase
Set<String> selectedFields = new HashSet<String>(query.getSelectedFields());
//first prepare (only execute the query if the parameters are valid)