/** * Creates a QueryExecution by selecting the most appropriate {@link QueryEngineType} that can answer the given query. * * @see QueryEngineType * @param query the query * @param dataset the target of the query * @return a <code>QueryExecution</code> that will answer the query with the given dataset */ public static QueryExecution create(final Query query, final Dataset dataset) { return create(query, dataset, null); }
/** * @deprecated Use {@link #createPelletExecution(Query, Model)} instead */ @Deprecated public static QueryExecution createBasicExecution(final Query query, final Model model) { return createPelletExecution(query, model); }
/** * Creates a QueryExecution by selecting the most appropriate {@link QueryEngineType} that can answer the given query. * * @see QueryEngineType * @param query the query * @param dataset the target of the query * @return a <code>QueryExecution</code> that will answer the query with the given dataset */ public static QueryExecution create(final Query query, final Dataset dataset) { return create(query, dataset, null); }
/** * @deprecated Use {@link #createPelletExecution(Query, Model)} instead */ @Deprecated public static QueryExecution createBasicExecution(final Query query, final Model model) { return createPelletExecution(query, model); }
/** * Creates a QueryExecution by selecting the most appropriate {@link QueryEngineType} that can answer the given query. * * @see QueryEngineType * @param query the query * @param dataset the target of the query * @return a <code>QueryExecution</code> that will answer the query with the given dataset */ public static QueryExecution create(final Query query, final Dataset dataset) { return create(query, dataset, null); }
/** * @deprecated Use {@link #createPelletExecution(Query, Model)} instead */ @Deprecated public static QueryExecution createBasicExecution(final Query query, final Model model) { return createPelletExecution(query, model); }
/** * Creates a QueryExecution with the given {@link QueryEngineType}. If the query engine cannot handle the given query a QueryException may be thrown during * query execution. Users are recommended to use {@link #create(Query, Dataset, QuerySolution)} * * @param query the query * @param dataset the target of the query * @param initialBinding used for parametrized queries * @param queryEngineType type of the query engine that will be used to answer the query * @return a <code>QueryExecution</code> that will answer the query with the given dataset */ public static QueryExecution create(final Query query, final Dataset dataset, final QuerySolution initialBinding, final QueryEngineType queryEngineType) { return create(query, dataset, initialBinding, queryEngineType, true); }
/** * @deprecated Use {@link #createPelletExecution(Query, Dataset)} instead */ @Deprecated public static QueryExecution createBasicExecution(final Query query, final Dataset dataset) { return createPelletExecution(query, dataset); }
/** * Creates a QueryExecution object where the Basic Graph Patterns (BGPs) will be answered by native Pellet query engine whenever possible. The unsupported * BGPs, i.e. the ones that are not in the SPARQL-DL fragment, will be answered by the Jena query engine. With this fall-back model all types of SPARQL * queries are supported. * * @param query the query * @param model the target of the query * @return a <code>QueryExecution</code> that will answer the query with the given model * @throws QueryException if the given model is not associated with Pellet reasoner */ public static QueryExecution create(final Query query, final Model model) { return create(query, model, null); }
/** * @deprecated Use {@link #createPelletExecution(Query, Dataset)} instead */ @Deprecated public static QueryExecution createBasicExecution(final Query query, final Dataset dataset) { return createPelletExecution(query, dataset); }
/** * Creates a QueryExecution with the given {@link QueryEngineType}. If the query engine cannot handle the given query a QueryException may be thrown during * query execution. Users are recommended to use {@link #create(Query, Dataset, QuerySolution)} * * @param query the query * @param dataset the target of the query * @param initialBinding used for parametrized queries * @param queryEngineType type of the query engine that will be used to answer the query * @return a <code>QueryExecution</code> that will answer the query with the given dataset */ public static QueryExecution create(final Query query, final Dataset dataset, final QuerySolution initialBinding, final QueryEngineType queryEngineType) { return create(query, dataset, initialBinding, queryEngineType, true); }
/** * @deprecated Use {@link #createPelletExecution(Query, Dataset)} instead */ @Deprecated public static QueryExecution createBasicExecution(final Query query, final Dataset dataset) { return createPelletExecution(query, dataset); }
/** * Creates a QueryExecution object where the Basic Graph Patterns (BGPs) will be answered by native Pellet query engine whenever possible. The unsupported * BGPs, i.e. the ones that are not in the SPARQL-DL fragment, will be answered by the Jena query engine. With this fall-back model all types of SPARQL * queries are supported. * * @param query the query * @param model the target of the query * @return a <code>QueryExecution</code> that will answer the query with the given model * @throws QueryException if the given model is not associated with Pellet reasoner */ public static QueryExecution create(final Query query, final Model model) { return create(query, model, null); }
qe = SparqlDLExecutionFactory.createPelletExecution(query, model); rs = qe.execSelect(); assertEquals(1, ResultSetFormatter.consume(rs)); qe = SparqlDLExecutionFactory.createPelletExecution(query, model); rs = qe.execSelect(); assertEquals(1, ResultSetFormatter.consume(rs)); qe = SparqlDLExecutionFactory.createPelletExecution(query, model); rs = qe.execSelect(); assertEquals(0, ResultSetFormatter.consume(rs)); qe = SparqlDLExecutionFactory.createPelletExecution(query, model); rs = qe.execSelect(); assertEquals(1, ResultSetFormatter.consume(rs)); qe = SparqlDLExecutionFactory.createPelletExecution(query, model); rs = qe.execSelect(); assertEquals(0, ResultSetFormatter.consume(rs));
/** * Creates a Pellet query engine that will answer the given query. This function should be used only if it is known that Pellet query engine can handle the * given query. Otherwise query execution will result in an exception. for arbitrary queries it is safer to use the <code>create</code> functions. * * @see QueryEngineType * @param query the query * @param dataset the target of the query * @param initialBinding initial binding that will be applied before query execution or <code>null</code> if there is no initial binding * @return a <code>QueryExecution</code> that will answer the query with the given dataset */ public static QueryExecution createPelletExecution(final Query query, final Dataset dataset, final QuerySolution initialBinding) { return create(query, dataset, initialBinding, QueryEngineType.PELLET); }
qe = SparqlDLExecutionFactory.createPelletExecution(query, model); rs = qe.execSelect(); assertEquals(2, ResultSetFormatter.consume(rs)); qe = SparqlDLExecutionFactory.createPelletExecution(query, model); rs = qe.execSelect(); assertEquals(1, ResultSetFormatter.consume(rs)); qe = SparqlDLExecutionFactory.createPelletExecution(query, model); rs = qe.execSelect(); assertEquals(2, ResultSetFormatter.consume(rs));
/** * Creates a Pellet query engine that will answer the given query. This function should be used only if it is known that Pellet query engine can handle the * given query. Otherwise query execution will result in an exception. for arbitrary queries it is safer to use the <code>create</code> functions. * * @see QueryEngineType * @param query the query * @param dataset the target of the query * @param initialBinding initial binding that will be applied before query execution or <code>null</code> if there is no initial binding * @return a <code>QueryExecution</code> that will answer the query with the given dataset */ public static QueryExecution createPelletExecution(final Query query, final Dataset dataset, final QuerySolution initialBinding) { return create(query, dataset, initialBinding, QueryEngineType.PELLET); }
/** * Creates a Pellet query engine that will answer the given query. This function should be used only if it is known that Pellet query engine can handle the * given query. Otherwise query execution will result in an exception. for arbitrary queries it is safer to use the <code>create</code> functions. * * @see QueryEngineType * @param query the query * @param dataset the target of the query * @param initialBinding initial binding that will be applied before query execution or <code>null</code> if there is no initial binding * @return a <code>QueryExecution</code> that will answer the query with the given dataset */ public static QueryExecution createPelletExecution(final Query query, final Dataset dataset) { return create(query, dataset, null, QueryEngineType.PELLET); }
/** * Creates a QueryExecution with the given {@link QueryEngineType}. If the query engine cannot handle the given query a QueryException may be thrown during * query execution. Users are recommended to use {@link #create(Query, Dataset, QuerySolution)} * * @param query the query * @param dataset the target of the query * @param initialBinding used for parametrized queries * @param queryEngineType type of the query engine that will be used to answer the query * @return a <code>QueryExecution</code> that will answer the query with the given dataset */ public static QueryExecution create(final Query query, final Dataset dataset, final QuerySolution initialBinding, final QueryEngineType queryEngineType) { return create(query, dataset, initialBinding, queryEngineType, true); }
/** * Creates a QueryExecution object where the Basic Graph Patterns (BGPs) will be answered by native Pellet query engine whenever possible. The unsupported * BGPs, i.e. the ones that are not in the SPARQL-DL fragment, will be answered by the Jena query engine. With this fall-back model all types of SPARQL * queries are supported. * * @param query the query * @param model the target of the query * @return a <code>QueryExecution</code> that will answer the query with the given model * @throws QueryException if the given model is not associated with Pellet reasoner */ public static QueryExecution create(final Query query, final Model model) { return create(query, model, null); }