/** Create a DatasetGraph based on an existing one; * this is a structure copy of the dataset struture * but graphs are shared */ public static DatasetGraph create(DatasetGraph dsg) { // Fixed - requires explicit "add graph" return new DatasetGraphMap(dsg) ; // DatasetGraph dsg2 = createMem() ; // copyOver(dsg2, dsg2) ; // return dsg2 ; }
@Override public Graph getGraph(Node graphNode) { Graph g = graphs.get(graphNode) ; if ( g == null ) { g = getGraphCreate() ; if ( g != null ) addGraph(graphNode, g) ; } return g ; }
DatasetGraphMap dsg = new DatasetGraphMap(graphStore) ; if ( update.getUsing().size() > 0 ) g.getBulkUpdateHandler().add(g2) ; dsg.setDefaultGraph(g) ; dsg.setDefaultGraph(graphStore.getGraph(gn)) ; dsg = new DatasetGraphMap(dsg.getDefaultGraph()) ; dsg.addGraph(gn, graphStore.getGraph(gn)) ;
/** Create a new DatasetGraph that initially shares the graphs of the * givem DatasetGraph. Adding/removing graphs will only affect this * object, not the argument DatasetGraph but changed to shared * graphs are seenby both objects. */ public DatasetGraphMap(DatasetGraph dsg) { this(dsg.getDefaultGraph()) ; for ( Iterator<Node> names = dsg.listGraphNodes() ; names.hasNext() ; ) { Node gn = names.next() ; addGraph(gn, dsg.getGraph(gn)) ; } }
@Override public final Graph getGraph(Node graphNode) { Graph g = graphs.get(graphNode) ; if ( g == null ) { g = getGraphCreate() ; if ( g != null ) graphs.put(graphNode, g) ; } return g ; }
/** Create a new DatasetGraph that initially shares the graphs of the * givem DatasetGraph. Adding/removing graphs will only affect this * object, not the argument DatasetGraph but changed to shared * graphs are seenby both objects. */ public DatasetGraphMap(DatasetGraph dsg) { this(dsg.getDefaultGraph()) ; for ( Iterator<Node> names = dsg.listGraphNodes() ; names.hasNext() ; ) { Node gn = names.next() ; this.addGraph(gn, dsg.getGraph(gn)) ; } }
/** Create a DatasetGraph based on an existing one; * this is a structure copy of the dataset struture * but graphs are shared */ public static DatasetGraph create(DatasetGraph dsg) { // Fixed - requires explicit "add graph" return new DatasetGraphMap(dsg) ; // DatasetGraph dsg2 = createMem() ; // copyOver(dsg2, dsg2) ; // return dsg2 ; }
/** * Create a DatasetGraph starting with a single graph. */ public static DatasetGraph create(Graph graph) { // Fixed - requires explicit "add graph" return new DatasetGraphMap(graph) ; // DatasetGraph dsg2 = createMem() ; // dsg2.setDefaultGraph(graph) ; // return dsg2 ; }
public static DatasetGraph createMemFixed() { return new DatasetGraphMap() ; } }
/** Clone the structure of a DatasetGraph. * The current graph themselves are shared but new naming and new graphs are * only in the cloned */ public static Dataset cloneStructure(DatasetGraph datasetGraph) { return new DatasetImpl(new DatasetGraphMap(datasetGraph)) ; }
public static DataSource cloneStructure(DatasetGraph datasetGraph) { DataSourceImpl ds = new DataSourceImpl() ; ds.dsg = new DatasetGraphMap(datasetGraph) ; return ds ; }
public static DatasetGraph createMemFixed() { return new DatasetGraphMap(GraphFactory.createDefaultGraph()) ; } }
DatasetGraph dsg2 = new DatasetGraphMap(dft) ;