org.jrdf.graph.local.util
Class CopyGraphUtilImpl

java.lang.Object
  extended by org.jrdf.graph.local.util.CopyGraphUtilImpl
All Implemented Interfaces:
CopyGraphUtil

public class CopyGraphUtilImpl
extends Object
implements CopyGraphUtil


Constructor Summary
CopyGraphUtilImpl(MapFactory newMapFactory, SortedSetFactory newSetFactory)
           
 
Method Summary
 Graph copyGraph(Graph newSourceGraph, Graph newTargetGraph)
          Copies all the triples in source graph to target graph, respecting the blank node "identifies".
 Node copyTriplesForNode(Graph newSourceGraph, Graph newTargetGraph, Node node, Node newNode)
          Given a node, copies all the triples that include
 ObjectNode copyTriplesForObjectNode(Graph newSourceGraph, Graph newTargetGraph, ObjectNode node, ObjectNode newNode)
           
 SubjectNode copyTriplesForSubjectNode(Graph newSourceGraph, Graph newTargetGraph, SubjectNode node, SubjectNode newNode)
           
 Graph getGraph()
           
 void replaceNode(Graph newTargetGraph, Node oldNode, Node newNode)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CopyGraphUtilImpl

public CopyGraphUtilImpl(MapFactory newMapFactory,
                         SortedSetFactory newSetFactory)
Method Detail

getGraph

public Graph getGraph()
Specified by:
getGraph in interface CopyGraphUtil

copyGraph

public Graph copyGraph(Graph newSourceGraph,
                       Graph newTargetGraph)
                throws GraphException
Description copied from interface: CopyGraphUtil
Copies all the triples in source graph to target graph, respecting the blank node "identifies".

Specified by:
copyGraph in interface CopyGraphUtil
Returns:
a merged graph.
Throws:
GraphException

copyTriplesForNode

public Node copyTriplesForNode(Graph newSourceGraph,
                               Graph newTargetGraph,
                               Node node,
                               Node newNode)
                        throws GraphException
Description copied from interface: CopyGraphUtil
Given a node, copies all the triples that include. (1) triples that contain this node (2) triples in (1) & (2) that contain blank nodes (recursively)

Specified by:
copyTriplesForNode in interface CopyGraphUtil
node - @return
Throws:
GraphException

replaceNode

public void replaceNode(Graph newTargetGraph,
                        Node oldNode,
                        Node newNode)
                 throws GraphException
Specified by:
replaceNode in interface CopyGraphUtil
Throws:
GraphException

copyTriplesForSubjectNode

public SubjectNode copyTriplesForSubjectNode(Graph newSourceGraph,
                                             Graph newTargetGraph,
                                             SubjectNode node,
                                             SubjectNode newNode)
                                      throws GraphException
Specified by:
copyTriplesForSubjectNode in interface CopyGraphUtil
Throws:
GraphException

copyTriplesForObjectNode

public ObjectNode copyTriplesForObjectNode(Graph newSourceGraph,
                                           Graph newTargetGraph,
                                           ObjectNode node,
                                           ObjectNode newNode)
                                    throws GraphException
Specified by:
copyTriplesForObjectNode in interface CopyGraphUtil
Throws:
GraphException