01: /*
02: * Copyright Aduna (http://www.aduna-software.com/) (c) 2007.
03: *
04: * Licensed under the Aduna BSD-style license.
05: */
06: package org.openrdf.repository.http;
07:
08: import java.util.Iterator;
09:
10: import org.openrdf.query.Binding;
11: import org.openrdf.query.BindingSet;
12: import org.openrdf.query.QueryLanguage;
13: import org.openrdf.query.impl.AbstractQuery;
14:
15: /**
16: * @author Arjohn Kampman
17: */
18: public abstract class HTTPQuery extends AbstractQuery {
19:
20: protected HTTPRepositoryConnection httpCon;
21:
22: protected QueryLanguage queryLanguage;
23:
24: protected String queryString;
25:
26: protected String baseURI;
27:
28: public HTTPQuery(HTTPRepositoryConnection con, QueryLanguage ql,
29: String queryString, String baseURI) {
30: this .httpCon = con;
31: this .queryLanguage = ql;
32: this .queryString = queryString;
33: this .baseURI = baseURI;
34: }
35:
36: protected Binding[] getBindingsArray() {
37: BindingSet bindings = this .getBindings();
38:
39: Binding[] bindingsArray = new Binding[bindings.size()];
40:
41: Iterator<Binding> iter = bindings.iterator();
42: for (int i = 0; i < bindings.size(); i++) {
43: bindingsArray[i] = iter.next();
44: }
45:
46: return bindingsArray;
47: }
48:
49: @Override
50: public String toString() {
51: return queryString;
52: }
53: }
|