01: /*
02: * Copyright Aduna (http://www.aduna-software.com/) (c) 1997-2007.
03: *
04: * Licensed under the Aduna BSD-style license.
05: */
06: package org.openrdf.query.parser.sparql;
07:
08: import java.util.HashMap;
09: import java.util.Set;
10:
11: public class SPARQLDataSet {
12:
13: private HashMap<String, String> namedGraphs = new HashMap<String, String>();
14:
15: private String defaultGraph;
16:
17: public SPARQLDataSet() {
18: }
19:
20: public SPARQLDataSet(String defaultGraph) {
21: this ();
22: setDefaultGraph(defaultGraph);
23: }
24:
25: public void setDefaultGraph(String defaultGraph) {
26: this .defaultGraph = defaultGraph;
27: }
28:
29: public String getDefaultGraph() {
30: return defaultGraph;
31: }
32:
33: public void addNamedGraph(String graphName, String graphLocation) {
34: namedGraphs.put(graphName, graphLocation);
35: }
36:
37: public boolean hasNamedGraphs() {
38: return (!namedGraphs.isEmpty());
39: }
40:
41: public Set<String> getGraphNames() {
42: return namedGraphs.keySet();
43: }
44:
45: public String getGraphLocation(String graphName) {
46: return namedGraphs.get(graphName);
47: }
48: }
|