Class QueryExecutionFactory


  • public class QueryExecutionFactory
    extends java.lang.Object
    QueryExecutionFactory provides some convenience operations for making QueryExecution objects. It is not comprehensive and only covers common, simple cases.

    For more control of building a local or remote QueryExecution object see the builder pattern:

    • QueryExecution.create(). ... .build() for querying local data.
    • QueryExecutionHTTP.service(url). ... .build() for querying a remote store using HTTP.

    See also RDFConnection for working with SPARQL Query, SPARQL Update and SPARQL Graph Store Protocol together.

    See Also:
    QueryExecutionDatasetBuilder, QueryExecutionHTTPBuilder
    • Method Detail

      • create

        public static QueryExecution create​(Query query)
        Create a QueryExecution
        Parameters:
        query - Query
        Returns:
        QueryExecution
      • create

        public static QueryExecution create​(java.lang.String queryStr)
        Create a QueryExecution
        Parameters:
        queryStr - Query string
        Returns:
        QueryExecution
      • create

        public static QueryExecution create​(java.lang.String queryStr,
                                            Syntax syntax)
        Create a QueryExecution
        Parameters:
        queryStr - Query string
        syntax - Query syntax
        Returns:
        QueryExecution
      • create

        public static QueryExecution create​(Query query,
                                            Dataset dataset)
        Create a QueryExecution to execute over the Dataset.
        Parameters:
        query - Query
        dataset - Target of the query
        Returns:
        QueryExecution
      • create

        public static QueryExecution create​(Query query,
                                            DatasetGraph datasetGraph)
        Create a QueryExecution to execute over the DatasetGraph.
        Parameters:
        query - Query
        datasetGraph - Target of the query
        Returns:
        QueryExecution
      • create

        public static QueryExecution create​(java.lang.String queryStr,
                                            Dataset dataset)
        Create a QueryExecution to execute over the Dataset.
        Parameters:
        queryStr - Query string
        dataset - Target of the query
        Returns:
        QueryExecution
      • create

        public static QueryExecution create​(java.lang.String queryStr,
                                            Syntax syntax,
                                            Dataset dataset)
        Create a QueryExecution to execute over the Dataset.
        Parameters:
        queryStr - Query string
        syntax - Query language
        dataset - Target of the query
        Returns:
        QueryExecution
      • create

        public static QueryExecution create​(Query query,
                                            Model model)
        Create a QueryExecution to execute over the Model.
        Parameters:
        query - Query
        model - Target of the query
        Returns:
        QueryExecution
      • create

        public static QueryExecution create​(java.lang.String queryStr,
                                            Model model)
        Create a QueryExecution to execute over the Model.
        Parameters:
        queryStr - Query string
        model - Target of the query
        Returns:
        QueryExecution
      • create

        public static QueryExecution create​(java.lang.String queryStr,
                                            Syntax lang,
                                            Model model)
        Create a QueryExecution to execute over the Model.
        Parameters:
        queryStr - Query string
        lang - Query language
        model - Target of the query
        Returns:
        QueryExecution
      • create

        @Deprecated
        public static QueryExecution create​(Query query,
                                            QuerySolution initialBinding)
        Deprecated.
        Create a QueryExecution to execute over the Model.
        Parameters:
        query - Query string
        initialBinding - Any initial binding of variables
        Returns:
        QueryExecution
      • create

        @Deprecated
        public static QueryExecution create​(java.lang.String queryStr,
                                            QuerySolution initialBinding)
        Deprecated.
        Create a QueryExecution given some initial values of variables.
        Parameters:
        queryStr - QueryString
        initialBinding - Any initial binding of variables
        Returns:
        QueryExecution
      • create

        public static QueryExecution create​(java.lang.String queryStr,
                                            Syntax syntax,
                                            QuerySolution initialBinding)
        Create a QueryExecution given some initial values of variables.
        Parameters:
        queryStr - QueryString
        syntax - Query language syntax
        initialBinding - Any initial binding of variables
        Returns:
        QueryExecution
      • create

        @Deprecated
        public static QueryExecution create​(Query query,
                                            Model model,
                                            QuerySolution initialBinding)
        Deprecated.
        Create a QueryExecution to execute over the Model, given some initial values of variables.
        Parameters:
        query - Query
        model - Target of the query
        initialBinding - Any initial binding of variables
        Returns:
        QueryExecution
      • create

        public static QueryExecution create​(java.lang.String queryStr,
                                            Model model,
                                            QuerySolution initialBinding)
        Create a QueryExecution to execute over the Model, given some initial values of variables.
        Parameters:
        queryStr - Query string
        model - Target of the query
        initialBinding - Any initial binding of variables
        Returns:
        QueryExecution
      • create

        @Deprecated
        public static QueryExecution create​(java.lang.String queryStr,
                                            Syntax syntax,
                                            Model model,
                                            QuerySolution initialBinding)
        Deprecated.
        Create a QueryExecution to execute over the Model, given some initial values of variables.
        Parameters:
        queryStr - Query string
        syntax - Query language
        model - Target of the query
        initialBinding - Any initial binding of variables
        Returns:
        QueryExecution
      • create

        public static QueryExecution create​(Query query,
                                            Dataset dataset,
                                            QuerySolution initialBinding)
        Create a QueryExecution over a Dataset given some initial values of variables.
        Parameters:
        query - Query
        dataset - Target of the query
        initialBinding - Any initial binding of variables
        Returns:
        QueryExecution
      • create

        @Deprecated
        public static QueryExecution create​(java.lang.String queryStr,
                                            Dataset dataset,
                                            QuerySolution initialBinding)
        Deprecated.
        Create a QueryExecution over a Dataset given some initial values of variables.
        Parameters:
        queryStr - Query string
        dataset - Target of the query
        initialBinding - Any initial binding of variables
        Returns:
        QueryExecution
      • create

        @Deprecated
        public static QueryExecution create​(java.lang.String queryStr,
                                            Syntax syntax,
                                            Dataset dataset,
                                            QuerySolution initialBinding)
        Deprecated.
        Create a QueryExecution over a Dataset given some initial values of variables.
        Parameters:
        queryStr - Query string
        dataset - Target of the query
        initialBinding - Any initial binding of variables
        Returns:
        QueryExecution
      • sparqlService

        @Deprecated
        public static QueryExecutionHTTP sparqlService​(java.lang.String serviceURL,
                                                       Query query)
        Deprecated.
        Use QueryExecution.service(serviceURL).query(query).build() or QueryExecutionHTTP.service(java.lang.String)
        Create a QueryExecution that will access a SPARQL service over HTTP
        Parameters:
        serviceURL - URL of the remote service
        query - Query string to execute
        Returns:
        QueryExecution
      • sparqlService

        @Deprecated
        public static QueryExecutionHTTP sparqlService​(java.lang.String serviceURL,
                                                       java.lang.String query)
        Deprecated.
        Use QueryExecution.service(serviceURL).query(query).build() or QueryExecutionHTTP.service(java.lang.String)
        Create a QueryExecution that will access a SPARQL service over HTTP
        Parameters:
        serviceURL - URL of the remote service
        query - Query string to execute
        Returns:
        QueryExecution
      • sparqlService

        @Deprecated
        public static QueryExecution sparqlService​(java.lang.String serviceURL,
                                                   java.lang.String query,
                                                   java.lang.String defaultGraph)
        Deprecated.
        Create a QueryExecution that will access a SPARQL service over HTTP
        Parameters:
        serviceURL - URL of the remote service
        query - Query string to execute
        defaultGraph - URI of the default graph
        Returns:
        QueryExecution
      • sparqlService

        @Deprecated
        public static QueryExecutionHTTP sparqlService​(java.lang.String serviceURL,
                                                       Query query,
                                                       java.util.List<java.lang.String> defaultGraphURIs,
                                                       java.util.List<java.lang.String> namedGraphURIs)
        Deprecated.
        Create a QueryExecution that will access a SPARQL service over HTTP
        Parameters:
        serviceURL - URL of the remote service
        query - Query string to execute
        defaultGraphURIs - List of URIs to make up the default graph
        namedGraphURIs - List of URIs to make up the named graphs
        Returns:
        QueryExecution
      • sparqlService

        @Deprecated
        public static QueryExecutionHTTP sparqlService​(java.lang.String serviceURL,
                                                       java.lang.String query,
                                                       java.util.List<java.lang.String> defaultGraphURIs,
                                                       java.util.List<java.lang.String> namedGraphURIs)
        Deprecated.
        Create a QueryExecution that will access a SPARQL service over HTTP
        Parameters:
        serviceURL - URL of the remote service
        query - Query string to execute
        defaultGraphURIs - List of URIs to make up the default graph
        namedGraphURIs - List of URIs to make up the named graphs
        Returns:
        QueryExecution
      • sparqlService

        @Deprecated
        public static QueryExecutionHTTP sparqlService​(java.lang.String serviceURL,
                                                       Query query,
                                                       java.lang.String defaultGraph)
        Deprecated.
        Create a QueryExecution that will access a SPARQL service over HTTP
        Parameters:
        serviceURL - URL of the remote service
        query - Query to execute
        defaultGraph - URI of the default graph
        Returns:
        QueryExecution
      • createServiceRequest

        @Deprecated
        public static QueryExecutionHTTPBuilder createServiceRequest​(java.lang.String service,
                                                                     Query query)
        Deprecated.
        Use the builder directly QueryExecutionHTTP.create()....build()
        Create a service request for remote execution over HTTP. allows various HTTP specific parameters to be set.
        Parameters:
        service - Endpoint URL
        query - Query
        Returns:
        QueryExecutionHTTP