sparqlGraphLibrary/src/test/java/com/ge/research/semtk/belmont/test/QueryGenTest_IT.java
private static int countAttributes(JSONArray graph, String keyContains, String valContains) {
		int ret = 0;
		// loop through the graph array of objects
		for (Object o : graph) {
			JSONObject j = (JSONObject) o;
			for (Object key : j.keySet()) {
				if (keyContains == null || ((String) key).contains(keyContains)   &&  (valContains == null || ((String) j.get(key)).contains(valContains))) {
					ret += 1;
				}
			}
		}
		return ret;
	}
/**
	 * Count the number of attributes of items in a Graph where key.contains(keyContains) and value.contains(valContains)
	 * Not recursive, checks each element in the graph array.
	 * @param graph
	 * @param keyContains
	 * @param valContains
	 * @return
	 */
Count the number of attributes of items in a Graph where key.contains(keyContains) and value.contains(valContains)
Not recursive, checks each element in the graph array.
Count the number of attributes of items in a Graph where key . contains ( keyContains ) and value . contains ( valContains ) Not recursive checks each element in the graph array .
private static int countAttributes(JSONArray graph, String keyContains, String valContains) {
		int ret = 0;
		for (Object o : graph) {
			JSONObject j = (JSONObject) o;
			for (Object key : j.keySet()) {
				if (keyContains == null || ((String) key).contains(keyContains)   &&  (valContains == null || ((String) j.get(key)).contains(valContains))) {
					ret += 1;
				}
			}
		}
		return ret;
	}
private static int countAttributes ( JSONArray graph , String keyContains , String valContains ) { int ret = 0 ; for ( Object o : graph ) { JSONObject j = ( JSONObject ) o ; for ( Object key : j . keySet ( ) ) { if ( keyContains == null || ( ( String ) key ) . contains ( keyContains ) && ( valContains == null || ( ( String ) j . get ( key ) ) . contains ( valContains ) ) ) { ret += 1 ; } } } return ret ; }
Count the number of attributes of items in a Graph where key.contains(keyContains) and value.contains(valContains)
 Not recursive, checks each element in the graph array.
Count the number of attributes of items in a Graph where key . contains ( keyContains ) and value . contains ( valContains ) Not recursive checks each element in the graph array .
// loop through the graph array of objects