Skip to content

Method: query(String)

1: package cz.cvut.kbss.ontodriver.rdf4j.query;
2:
3: import java.util.Objects;
4:
5: /**
6: * Represents a query and configuration relevant to the query execution.
7: */
8: public class QuerySpecification {
9:
10: private final String query;
11:
12: private boolean includeInference = true;
13:
14: private QuerySpecification(String query) {
15: this.query = Objects.requireNonNull(query);
16: }
17:
18: public String getQuery() {
19: return query;
20: }
21:
22: public QuerySpecification includeInference(boolean includeInference) {
23: this.includeInference = includeInference;
24: return this;
25: }
26:
27: public boolean isIncludeInference() {
28: return includeInference;
29: }
30:
31: @Override
32: public boolean equals(Object o) {
33: if (this == o) {
34: return true;
35: }
36: if (o == null || getClass() != o.getClass()) {
37: return false;
38: }
39: QuerySpecification that = (QuerySpecification) o;
40: return includeInference == that.includeInference && query.equals(that.query);
41: }
42:
43: @Override
44: public int hashCode() {
45: return Objects.hash(query, includeInference);
46: }
47:
48: public static QuerySpecification query(String query) {
49: return new QuerySpecification(query);
50: }
51: }