/** * Copies the contents of a context node (context nodes, relations, and the literal) into a target context node. * @param contextNode A context node from any graph. * @param targetContextNode The target context node. * @param copyStrategy The strategy to determine what to copy. */ public static void copyContextNodeContents(ContextNode contextNode, ContextNode targetContextNode, CopyStrategy copyStrategy) { if (contextNode == null) throw new NullPointerException(); if (targetContextNode == null) throw new NullPointerException(); if (copyStrategy == null) copyStrategy = DEFAULT_COPY_STRATEGY; copyContextNodes(contextNode, targetContextNode, copyStrategy); copyRelations(contextNode, targetContextNode, copyStrategy); copyLiteralNode(contextNode, targetContextNode, copyStrategy); }
/** * Copies the contents of a context node (context nodes, relations, and the literal) into a target graph. * @param contextNode A context node from any graph. * @param targetGraph The target graph. * @param copyStrategy The strategy to determine what to copy. */ public static void copyContextNodeContents(ContextNode contextNode, Graph targetGraph, CopyStrategy copyStrategy) { if (contextNode == null) throw new NullPointerException(); if (targetGraph == null) throw new NullPointerException(); if (copyStrategy == null) copyStrategy = DEFAULT_COPY_STRATEGY; copyContextNodes(contextNode, targetGraph.getRootContextNode(false), copyStrategy); copyRelations(contextNode, targetGraph.getRootContextNode(false), copyStrategy); copyLiteralNode(contextNode, targetGraph.getRootContextNode(false), copyStrategy); }