sparqlGraphLibrary/src/main/java/com/ge/research/semtk/belmont/Node.java
public JSONObject toJson(ArrayList<PropertyItem> dontDeflatePropItems) {
		// return a JSON object of things needed to serialize
		JSONObject ret = new JSONObject();
		JSONArray jPropList = new JSONArray();
		JSONArray jNodeList = new JSONArray();
		
		// NOTE removed optional subclassNames
		
		// add properties
		for (int i = 0; i < this.props.size(); i++) { 
			PropertyItem p = this.props.get(i);
			// if compressFlag, then only add property if returned or constrained
			if (dontDeflatePropItems == null || p.isUsed() || dontDeflatePropItems.contains(p)) {
				jPropList.add(p.toJson());
			}
		}
		
		// add nodes
		for (int i = 0; i < this.nodes.size(); i++) {
			// if we're deflating, only add connected nodes
			if (dontDeflatePropItems == null || this.nodes.get(i).isUsed()) {
				jNodeList.add(this.nodes.get(i).toJson());
			}
		}
		
		// defaults to true
		if (this.isConstructed == false) {
			ret.put("isConstructed", false);
		}
		ret.put("propList", jPropList);
		ret.put("nodeList", jNodeList);
		ret.put("fullURIName", this.fullURIname);
		ret.put("valueConstraint", this.constraints != null ? this.constraints.toString(): "");
		
		this.addReturnableJson(ret);
		
		ret.put("instanceValue", this.instanceValue);
		ret.put("deletionMode", this.deletionMode.name());
		
		return ret;
	}
/**
	 *
	 * @param dontDeflatePropItems - list of PropertyItems which should not be deflated
	 * @return
	 */
@param dontDeflatePropItems - list of PropertyItems which should not be deflated
@return
@param dontDeflatePropItems - list of PropertyItems which should not be deflated @return
public JSONObject toJson(ArrayList<PropertyItem> dontDeflatePropItems) {
		JSONObject ret = new JSONObject();
		JSONArray jPropList = new JSONArray();
		JSONArray jNodeList = new JSONArray();
		for (int i = 0; i < this.props.size(); i++) { 
			PropertyItem p = this.props.get(i);
			if (dontDeflatePropItems == null || p.isUsed() || dontDeflatePropItems.contains(p)) {
				jPropList.add(p.toJson());
			}
		}
		for (int i = 0; i < this.nodes.size(); i++) {
			if (dontDeflatePropItems == null || this.nodes.get(i).isUsed()) {
				jNodeList.add(this.nodes.get(i).toJson());
			}
		}
		if (this.isConstructed == false) {
			ret.put("isConstructed", false);
		}
		ret.put("propList", jPropList);
		ret.put("nodeList", jNodeList);
		ret.put("fullURIName", this.fullURIname);
		ret.put("valueConstraint", this.constraints != null ? this.constraints.toString(): "");
		this.addReturnableJson(ret);
		ret.put("instanceValue", this.instanceValue);
		ret.put("deletionMode", this.deletionMode.name());
		return ret;
	}
public JSONObject toJson ( ArrayList < PropertyItem > dontDeflatePropItems ) { JSONObject ret = new JSONObject ( ) ; JSONArray jPropList = new JSONArray ( ) ; JSONArray jNodeList = new JSONArray ( ) ; for ( int i = 0 ; i < this . props . size ( ) ; i ++ ) { PropertyItem p = this . props . get ( i ) ; if ( dontDeflatePropItems == null || p . isUsed ( ) || dontDeflatePropItems . contains ( p ) ) { jPropList . add ( p . toJson ( ) ) ; } } for ( int i = 0 ; i < this . nodes . size ( ) ; i ++ ) { if ( dontDeflatePropItems == null || this . nodes . get ( i ) . isUsed ( ) ) { jNodeList . add ( this . nodes . get ( i ) . toJson ( ) ) ; } } if ( this . isConstructed == false ) { ret . put ( "isConstructed" , false ) ; } ret . put ( "propList" , jPropList ) ; ret . put ( "nodeList" , jNodeList ) ; ret . put ( "fullURIName" , this . fullURIname ) ; ret . put ( "valueConstraint" , this . constraints != null ? this . constraints . toString ( ) : "" ) ; this . addReturnableJson ( ret ) ; ret . put ( "instanceValue" , this . instanceValue ) ; ret . put ( "deletionMode" , this . deletionMode . name ( ) ) ; return ret ; }
@param dontDeflatePropItems - list of PropertyItems which should not be deflated
 @return
@param dontDeflatePropItems - list of PropertyItems which should not be deflated @return
// return a JSON object of things needed to serialize // NOTE removed optional subclassNames // add properties // if compressFlag, then only add property if returned or constrained // add nodes // if we're deflating, only add connected nodes // defaults to true