<commit_before>/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.apache.jena.sparql.exec;

import java.util.Iterator;

import org.apache.jena.atlas.json.JsonArray;
import org.apache.jena.atlas.json.JsonObject;
import org.apache.jena.graph.Graph;
import org.apache.jena.graph.Triple;
import org.apache.jena.query.Query;
import org.apache.jena.query.QueryExecution;
import org.apache.jena.sparql.core.DatasetGraph;
import org.apache.jena.sparql.core.DatasetGraphFactory;
import org.apache.jena.sparql.core.Quad;
import org.apache.jena.sparql.exec.http.QueryExecHTTPBuilder;
import org.apache.jena.sparql.graph.GraphFactory;
import org.apache.jena.sparql.util.Context;

/**
 * Query execution interface working at the Graph-Node-Triple level.
 *
 * @see QueryExecution
 */
public interface QueryExec extends AutoCloseable {

    /**
     * Create a {@link QueryExecBuilder} for a dataset.
     * For local dataset specific configuration, use {@link #newBuilder}().dataset(dataset)
     * to get a {@link QueryExecDatasetBuilder}.
     */
    public static QueryExecBuilder dataset(DatasetGraph dataset) {
        return QueryExecDatasetBuilder.create().dataset(dataset);
    }

    /** Create a {@link QueryExecBuilder} for a graph. */
    public static QueryExecBuilder dataset(Graph graph) {
        return QueryExecDatasetBuilder.create().graph(graph);
    }

    /** Create a {@link QueryExecBuilder} for a remote endpoint. */
    public static QueryExecBuilder endpoint(String serviceURL) {
        return QueryExecHTTPBuilder.create().endpoint(serviceURL);
    }

    /** Create an uninitialized {@link QueryExecDatasetBuilder}. */
    public static QueryExecDatasetBuilder newBuilder() {
        return QueryExecDatasetBuilder.create();
    }

    /**
     * The dataset against which the query will execute. May be null - the dataset
     * may be remote or the query itself has a dataset description.
     */
    public DatasetGraph getDataset();

    /**
     * The properties associated with a query execution - implementation specific
     * parameters This includes Java objects (so it is not an RDF graph). Keys should
     * be URIs as strings. May be null (this implementation does not provide any<commit_msg>Correct name for method<commit_after>/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.apache.jena.sparql.exec;

import java.util.Iterator;

import org.apache.jena.atlas.json.JsonArray;
import org.apache.jena.atlas.json.JsonObject;
import org.apache.jena.graph.Graph;
import org.apache.jena.graph.Triple;
import org.apache.jena.query.Query;
import org.apache.jena.query.QueryExecution;
import org.apache.jena.sparql.core.DatasetGraph;
import org.apache.jena.sparql.core.DatasetGraphFactory;
import org.apache.jena.sparql.core.Quad;
import org.apache.jena.sparql.exec.http.QueryExecHTTPBuilder;
import org.apache.jena.sparql.graph.GraphFactory;
import org.apache.jena.sparql.util.Context;

/**
 * Query execution interface working at the Graph-Node-Triple level.
 *
 * @see QueryExecution
 */
public interface QueryExec extends AutoCloseable {

    /**
     * Create a {@link QueryExecBuilder} for a dataset.
     * For local dataset specific configuration, use {@link #newBuilder}().dataset(dataset)
     * to get a {@link QueryExecDatasetBuilder}.
     */
    public static QueryExecBuilder dataset(DatasetGraph dataset) {
        return QueryExecDatasetBuilder.create().dataset(dataset);
    }

    /** Create a {@link QueryExecBuilder} for a graph. */
    public static QueryExecBuilder graph(Graph graph) {
        return QueryExecDatasetBuilder.create().graph(graph);
    }

    /** Create a {@link QueryExecBuilder} for a remote endpoint. */
    public static QueryExecBuilder endpoint(String serviceURL) {
        return QueryExecHTTPBuilder.create().endpoint(serviceURL);
    }

    /** Create an uninitialized {@link QueryExecDatasetBuilder}. */
    public static QueryExecDatasetBuilder newBuilder() {
        return QueryExecDatasetBuilder.create();
    }

    /**
     * The dataset against which the query will execute. May be null - the dataset
     * may be remote or the query itself has a dataset description.
     */
    public DatasetGraph getDataset();

    /**
     * The properties associated with a query execution - implementation specific
     * parameters This includes Java objects (so it is not an RDF graph). Keys should
     * be URIs as strings. May be null (this implementation does not provide any
{'fraction_non_alphanumeric': 0.08647746243739567, 'fraction_numerical': 0.001335559265442404, 'mean_word_length': 3.7472266244057053, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6960717', 'n_tokens_mistral': 1583, 'n_tokens_neox': 1585, 'n_words': 574}