sparqlGraphLibrary/src/main/java/com/ge/research/semtk/belmont/NodeGroup.java
private JSONObject resolveSparqlIdCollisions(JSONObject jobj, HashMap<String, String> changedHash) {
		// loop through a json object and resolve any SparqlID name collisions
		// with this node group.
		JSONObject retval = jobj;
		
		HashSet<String> tempHash = this.getAllVariableNames();
		
		if (tempHash.isEmpty()) {
			return retval;
		}
	
		JSONArray nodeArr = (JSONArray)jobj.get(JSON_KEY_NODELIST);
		// loop through the nodes in the JSONArray
		for(int k = 0; k < nodeArr.size(); k += 1){
			JSONObject jnode = (JSONObject) nodeArr.get(k);
			
			jnode = BelmontUtil.updateSparqlIdsForJSON(jnode, "SparqlID", changedHash, tempHash);
			
			// iterate over property objects
			JSONArray propArr = (JSONArray) jnode.get("propList");
			
			for (int j = 0; j < propArr.size(); ++j) {
				JSONObject prop = (JSONObject) propArr.get(j);
				prop = BelmontUtil.updateSparqlIdsForJSON(prop, "SparqlID", changedHash, tempHash);
			}
			
			// and the node list			
			JSONArray nodeItemArr = (JSONArray) jnode.get("nodeList");
			
			for (int j = 0; j < nodeItemArr.size(); ++j) {
				JSONObject node = (JSONObject) nodeItemArr.get(j);
				JSONArray nodeConnections = (JSONArray)node.get("SnodeSparqlIDs");
				for(int m = 0; m < nodeConnections.size(); m += 1){
					// this should update the values we care about
					BelmontUtil.updateSparqlIdsForJSON(nodeConnections, m, changedHash, tempHash);
				}
			}
		}
		
		return retval;
	}
/**
	 * This seems to only be used when adding more json to a nodegroup.
	 * It is retained for backwards compatibility
	 * Paul sep-2020
	 * @param jobj
	 * @param changedHash
	 * @return
	 */
This seems to only be used when adding more json to a nodegroup.
It is retained for backwards compatibility
Paul sep-2020
@param jobj
@param changedHash
@return
This seems to only be used when adding more json to a nodegroup . It is retained for backwards compatibility Paul sep - 2020 @param jobj @param changedHash @return
private JSONObject resolveSparqlIdCollisions(JSONObject jobj, HashMap<String, String> changedHash) {
		JSONObject retval = jobj;
		HashSet<String> tempHash = this.getAllVariableNames();
		if (tempHash.isEmpty()) {
			return retval;
		}
		JSONArray nodeArr = (JSONArray)jobj.get(JSON_KEY_NODELIST);
		for(int k = 0; k < nodeArr.size(); k += 1){
			JSONObject jnode = (JSONObject) nodeArr.get(k);
			jnode = BelmontUtil.updateSparqlIdsForJSON(jnode, "SparqlID", changedHash, tempHash);
			JSONArray propArr = (JSONArray) jnode.get("propList");
			for (int j = 0; j < propArr.size(); ++j) {
				JSONObject prop = (JSONObject) propArr.get(j);
				prop = BelmontUtil.updateSparqlIdsForJSON(prop, "SparqlID", changedHash, tempHash);
			}
			JSONArray nodeItemArr = (JSONArray) jnode.get("nodeList");
			for (int j = 0; j < nodeItemArr.size(); ++j) {
				JSONObject node = (JSONObject) nodeItemArr.get(j);
				JSONArray nodeConnections = (JSONArray)node.get("SnodeSparqlIDs");
				for(int m = 0; m < nodeConnections.size(); m += 1){
					BelmontUtil.updateSparqlIdsForJSON(nodeConnections, m, changedHash, tempHash);
				}
			}
		}
		return retval;
	}
private JSONObject resolveSparqlIdCollisions ( JSONObject jobj , HashMap < String , String > changedHash ) { JSONObject retval = jobj ; HashSet < String > tempHash = this . getAllVariableNames ( ) ; if ( tempHash . isEmpty ( ) ) { return retval ; } JSONArray nodeArr = ( JSONArray ) jobj . get ( JSON_KEY_NODELIST ) ; for ( int k = 0 ; k < nodeArr . size ( ) ; k += 1 ) { JSONObject jnode = ( JSONObject ) nodeArr . get ( k ) ; jnode = BelmontUtil . updateSparqlIdsForJSON ( jnode , "SparqlID" , changedHash , tempHash ) ; JSONArray propArr = ( JSONArray ) jnode . get ( "propList" ) ; for ( int j = 0 ; j < propArr . size ( ) ; ++ j ) { JSONObject prop = ( JSONObject ) propArr . get ( j ) ; prop = BelmontUtil . updateSparqlIdsForJSON ( prop , "SparqlID" , changedHash , tempHash ) ; } JSONArray nodeItemArr = ( JSONArray ) jnode . get ( "nodeList" ) ; for ( int j = 0 ; j < nodeItemArr . size ( ) ; ++ j ) { JSONObject node = ( JSONObject ) nodeItemArr . get ( j ) ; JSONArray nodeConnections = ( JSONArray ) node . get ( "SnodeSparqlIDs" ) ; for ( int m = 0 ; m < nodeConnections . size ( ) ; m += 1 ) { BelmontUtil . updateSparqlIdsForJSON ( nodeConnections , m , changedHash , tempHash ) ; } } } return retval ; }
This seems to only be used when adding more json to a nodegroup.
This seems to only be used when adding more json to a nodegroup .
// loop through a json object and resolve any SparqlID name collisions // with this node group. // loop through the nodes in the JSONArray // iterate over property objects // and the node list			 // this should update the values we care about