sparqlGraphLibrary/src/main/java/com/ge/research/semtk/belmont/NodeGroup.java
public static String generateCombinedSparqlInsert(ArrayList<NodeGroup> ngList, OntologyInfo oInfo, SparqlEndpointInterface endpoint) throws Exception {
		
		HashMap<String, String> prefixHash = new HashMap<String, String>();
		String totalInsertHead = "";
		String totalInsertWhere = "";
		NodeGroup ng = null;
		
		for (int i=0; i < ngList.size(); i++) {
			ng = ngList.get(i);
			
			// pass prefixHash on to next nodegroup
			if(i > 0){
				ng.rebuildPrefixHash(prefixHash);	// add new elements, as needed.
			}
			prefixHash = ng.getPrefixHash();
			
			String seq = "__" + i;
			totalInsertHead  += ng.getInsertLeader(seq, oInfo);
			totalInsertWhere += ng.getInsertWhereBody(seq, oInfo);
				
		}
		
		if (totalInsertHead.length() == 0) {
			throw new NothingToInsertException("No data to insert");
		}
		// NOTE: the last NodeGroup should have all the prefixes of all the needed groups.
		//       this way, we only need to get it's prefixes. 
		String query =  ng.generateSparqlPrefix() + " INSERT { GRAPH <" + endpoint.getGraph() + "> {\n" + totalInsertHead + "} }\n WHERE {" + totalInsertWhere + " } ";

		return query;
	}
/**
	 * Generate insert for a group of nodegroups, which must be identical except for their instance data
	 * @param ngList - WARNING: will add to prefixHash as side-effect  (We'll miss you, Justin)
	 * @param oInfo
	 * @return sparql insert statement
	 * @throws Exception
	 */
Generate insert for a group of nodegroups, which must be identical except for their instance data
@param ngList - WARNING: will add to prefixHash as side-effect  (We'll miss you, Justin)
@param oInfo
@return sparql insert statement
@throws Exception
Generate insert for a group of nodegroups which must be identical except for their instance data @param ngList - WARNING : will add to prefixHash as side - effect ( We ' ll miss you Justin ) @param oInfo @return sparql insert statement @throws Exception
public static String generateCombinedSparqlInsert(ArrayList<NodeGroup> ngList, OntologyInfo oInfo, SparqlEndpointInterface endpoint) throws Exception {
		HashMap<String, String> prefixHash = new HashMap<String, String>();
		String totalInsertHead = "";
		String totalInsertWhere = "";
		NodeGroup ng = null;
		for (int i=0; i < ngList.size(); i++) {
			ng = ngList.get(i);
			if(i > 0){
				ng.rebuildPrefixHash(prefixHash);	
			}
			prefixHash = ng.getPrefixHash();
			String seq = "__" + i;
			totalInsertHead  += ng.getInsertLeader(seq, oInfo);
			totalInsertWhere += ng.getInsertWhereBody(seq, oInfo);
		}
		if (totalInsertHead.length() == 0) {
			throw new NothingToInsertException("No data to insert");
		}
		String query =  ng.generateSparqlPrefix() + " INSERT { GRAPH <" + endpoint.getGraph() + "> {\n" + totalInsertHead + "} }\n WHERE {" + totalInsertWhere + " } ";
		return query;
	}
public static String generateCombinedSparqlInsert ( ArrayList < NodeGroup > ngList , OntologyInfo oInfo , SparqlEndpointInterface endpoint ) throws Exception { HashMap < String , String > prefixHash = new HashMap < String , String > ( ) ; String totalInsertHead = "" ; String totalInsertWhere = "" ; NodeGroup ng = null ; for ( int i = 0 ; i < ngList . size ( ) ; i ++ ) { ng = ngList . get ( i ) ; if ( i > 0 ) { ng . rebuildPrefixHash ( prefixHash ) ; } prefixHash = ng . getPrefixHash ( ) ; String seq = "__" + i ; totalInsertHead += ng . getInsertLeader ( seq , oInfo ) ; totalInsertWhere += ng . getInsertWhereBody ( seq , oInfo ) ; } if ( totalInsertHead . length ( ) == 0 ) { throw new NothingToInsertException ( "No data to insert" ) ; } String query = ng . generateSparqlPrefix ( ) + " INSERT { GRAPH <" + endpoint . getGraph ( ) + "> {\n" + totalInsertHead + "} }\n WHERE {" + totalInsertWhere + " } " ; return query ; }
Generate insert for a group of nodegroups, which must be identical except for their instance data
 @param ngList - WARNING: will add to prefixHash as side-effect  (We'll miss you, Justin)
 @param oInfo
 @return sparql insert statement
 @throws Exception
Generate insert for a group of nodegroups which must be identical except for their instance data @param ngList - WARNING : will add to prefixHash as side - effect ( We ' ll miss you Justin ) @param oInfo @return sparql insert statement @throws Exception
// pass prefixHash on to next nodegroup // add new elements, as needed. // NOTE: the last NodeGroup should have all the prefixes of all the needed groups. //       this way, we only need to get it's prefixes. 