static private void checkArg(Query query) { checkNotNull(query, "Query is null") ; } }
static private void checkArg(Model model) { checkNotNull(model, "Model is a null pointer") ; }
static private void checkArg(String queryStr) { checkNotNull(queryStr, "Query string is null") ; }
/** Create a QueryExecution that will access a SPARQL service over HTTP * @param service URL of the remote service * @param query Query to execute * @param client HTTP client * @return QueryExecution */ static public QueryExecution sparqlService(String service, Query query, HttpClient client) { checkNotNull(service, "URL for service is null") ; checkArg(query) ; return createServiceRequest(service, query, client) ; }
/** Create a QueryExecution that will access a SPARQL service over HTTP * @param service URL of the remote service * @param query Query to execute * @param client HTTP client * @return QueryExecution */ static public QueryExecution sparqlService(String service, Query query, HttpClient client, HttpContext httpContext) { checkNotNull(service, "URL for service is null") ; checkArg(query) ; return createServiceRequest(service, query, client, httpContext) ; }
/** Create a QueryExecution that will access a SPARQL service over HTTP * @param service URL of the remote service * @param query Query string to execute * @param client HTTP client * @param httpContext HTTP Context * @return QueryExecution */ static public QueryExecution sparqlService(String service, String query, HttpClient client, HttpContext httpContext) { checkNotNull(service, "URL for service is null") ; checkArg(query) ; return sparqlService(service, QueryFactory.create(query), client) ; }
/** Create a QueryExecution that will access a SPARQL service over HTTP * @param service URL of the remote service * @param query Query string to execute * @param defaultGraph URI of the default graph * @param client HTTP client * @param httpContext HTTP Context * @return QueryExecution */ static public QueryExecution sparqlService(String service, String query, String defaultGraph, HttpClient client, HttpContext httpContext) { checkNotNull(service, "URL for service is null") ; // checkNotNull(defaultGraph, "IRI for default graph is null") ; checkArg(query) ; return sparqlService(service, QueryFactory.create(query), defaultGraph, client, httpContext) ; }
/** Create a QueryExecution that will access a SPARQL service over HTTP * @param service URL of the remote service * @param query Query to execute * @param defaultGraph URI of the default graph * @param client HTTP client * @return QueryExecution */ static public QueryExecution sparqlService(String service, Query query, String defaultGraph, HttpClient client, HttpContext httpContext) { checkNotNull(service, "URL for service is null") ; // checkNotNull(defaultGraph, "IRI for default graph is null") ; checkArg(query) ; QueryEngineHTTP qe = createServiceRequest(service, query, client, httpContext) ; qe.addDefaultGraph(defaultGraph) ; return qe ; } /** Create a service request for remote execution over HTTP. The returned class,
/** Create a QueryExecution that will access a SPARQL service over HTTP * @param service URL of the remote service * @param query Query string to execute * @param defaultGraphURIs List of URIs to make up the default graph * @param namedGraphURIs List of URIs to make up the named graphs * @param client HTTP client * @param httpContext HTTP Context * @return QueryExecution */ static public QueryExecution sparqlService(String service, String query, List<String> defaultGraphURIs, List<String> namedGraphURIs, HttpClient client, HttpContext httpContext) { checkNotNull(service, "URL for service is null") ; // checkNotNull(defaultGraphURIs, "List of default graph URIs is null") ; // checkNotNull(namedGraphURIs, "List of named graph URIs is null") ; checkArg(query) ; return sparqlService(service, QueryFactory.create(query), defaultGraphURIs, namedGraphURIs, client, httpContext) ; }
/** Create a QueryExecution that will access a SPARQL service over HTTP * @param service URL of the remote service * @param query Query to execute * @param defaultGraphURIs List of URIs to make up the default graph * @param namedGraphURIs List of URIs to make up the named graphs * @param client HTTP client * @param httpContext HTTP Context * @return QueryExecution */ static public QueryExecution sparqlService(String service, Query query, List<String> defaultGraphURIs, List<String> namedGraphURIs, HttpClient client, HttpContext httpContext) { checkNotNull(service, "URL for service is null") ; // checkNotNull(defaultGraphURIs, "List of default graph URIs is null") ; // checkNotNull(namedGraphURIs, "List of named graph URIs is null") ; checkArg(query) ; QueryEngineHTTP qe = createServiceRequest(service, query, client) ; if ( defaultGraphURIs != null ) qe.setDefaultGraphURIs(defaultGraphURIs) ; if ( namedGraphURIs != null ) qe.setNamedGraphURIs(namedGraphURIs) ; return qe ; }