Package org.openrdf.query.impl

Examples of org.openrdf.query.impl.TupleQueryResultImpl


    try {
      SailConnection sailCon = getConnection().getSailConnection();
      CloseableIteration<? extends BindingSet, QueryEvaluationException> bindingsIter = sailCon.evaluate(
          tupleExpr, getActiveDataset(), getBindings(), getIncludeInferred());

      return new TupleQueryResultImpl(new ArrayList<String>(tupleExpr.getBindingNames()), bindingsIter);
    }
    catch (SailException e) {
      throw new QueryEvaluationException(e.getMessage(), e);
    }
  }
View Full Code Here


        TupleQueryResultWriterFactory factory = ProtocolUtil.getAcceptableService(request, response,
            TupleQueryResultWriterRegistry.getInstance());

        Map<String, Object> model = new HashMap<String, Object>();
        model.put(QueryResultView.QUERY_RESULT_KEY, new TupleQueryResultImpl(bindingNames, bindingSets));
        model.put(QueryResultView.FILENAME_HINT_KEY, "repositories");
        model.put(QueryResultView.FACTORY_KEY, factory);

        return new ModelAndView(TupleQueryResultView.getInstance(), model);
      }
View Full Code Here

    TupleQueryResultWriterFactory factory = ProtocolUtil.getAcceptableService(request, response,
        TupleQueryResultWriterRegistry.getInstance());

    Map<String, Object> model = new HashMap<String, Object>();
    model.put(QueryResultView.QUERY_RESULT_KEY, new TupleQueryResultImpl(columnNames, contexts));
    model.put(QueryResultView.FILENAME_HINT_KEY, "contexts");
    model.put(QueryResultView.FACTORY_KEY, factory);

    return new ModelAndView(TupleQueryResultView.getInstance(), model);
  }
View Full Code Here

    TupleQueryResultWriterFactory factory = ProtocolUtil.getAcceptableService(request, response,
        TupleQueryResultWriterRegistry.getInstance());

    Map<String, Object> model = new HashMap<String, Object>();
    model.put(QueryResultView.QUERY_RESULT_KEY, new TupleQueryResultImpl(columnNames, namespaces));
    model.put(QueryResultView.FILENAME_HINT_KEY, "namespaces");
    model.put(QueryResultView.FACTORY_KEY, factory);

    return new ModelAndView(TupleQueryResultView.getInstance(), model);
  }
View Full Code Here

    solution2.addBinding("a", new LiteralImpl("1", XMLSchema.INTEGER));
    solution2.addBinding("c", new LiteralImpl("Hello World!", "en"));

    List<? extends BindingSet> bindingSetList = Arrays.asList(solution1, solution2);

    TupleQueryResultImpl result = new TupleQueryResultImpl(bindingNames, bindingSetList);

    return result;
  }
View Full Code Here

        String col = rsmd.getColumnName(i);
        if (names.indexOf(col) < 0)
          names.add(col); // no duplicates
      }

      return new TupleQueryResultImpl(names, new CloseableIterationBindingSet(stmt, rs));
    }
    catch (Exception e) {
      throw new QueryEvaluationException(": SPARQL execute failed:["+query+"] \n Exception:"+e);
    }
  }
View Full Code Here

TOP

Related Classes of org.openrdf.query.impl.TupleQueryResultImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.