Search in sources :

Example 1 with QueryExecDatasetBuilder

use of org.apache.jena.sparql.exec.QueryExecDatasetBuilder in project jena by apache.

the class QueryExecutionFactory method make.

private static QueryExecution make(Query query, Dataset dataset, DatasetGraph datasetGraph, Binding initialBinding) {
    QueryExecDatasetBuilder builder = QueryExecDataset.newBuilder().query(query);
    if (initialBinding != null)
        builder.initialBinding(initialBinding);
    if (dataset == null && datasetGraph == null)
        return QueryExecutionCompat.compatibility(builder, null, query, builder.getQueryString());
    if (dataset == null) {
        builder.dataset(datasetGraph);
        dataset = DatasetFactory.wrap(datasetGraph);
    } else {
        builder.dataset(dataset.asDatasetGraph());
    }
    return QueryExecutionCompat.compatibility(builder, dataset, query, builder.getQueryString());
}
Also used : QueryExecDatasetBuilder(org.apache.jena.sparql.exec.QueryExecDatasetBuilder)

Example 2 with QueryExecDatasetBuilder

use of org.apache.jena.sparql.exec.QueryExecDatasetBuilder in project jena by apache.

the class SPARQLQueryProcessor method createQueryExecution.

/**
 * Create the {@link QueryExecution} for this operation.
 * @param action
 * @param query
 * @param dataset
 * @return QueryExecution
 */
protected QueryExecution createQueryExecution(HttpAction action, Query query, DatasetGraph dataset) {
    QueryExecDatasetBuilder builder = QueryExec.newBuilder().dataset(dataset).query(query).context(action.getContext());
    setTimeouts(builder, action);
    QueryExec qExec = builder.build();
    return QueryExecutionAdapter.adapt(qExec);
}
Also used : QueryExec(org.apache.jena.sparql.exec.QueryExec) QueryExecDatasetBuilder(org.apache.jena.sparql.exec.QueryExecDatasetBuilder)

Aggregations

QueryExecDatasetBuilder (org.apache.jena.sparql.exec.QueryExecDatasetBuilder)2 QueryExec (org.apache.jena.sparql.exec.QueryExec)1