connectionUtils/src/main/java/com/ge/research/semtk/sparqlX/SparqlConnection.java
public void fromJson(JSONObject jObj) throws Exception {
		
		if(jObj.entrySet().size() == 1 && jObj.containsKey("sparqlConn")){
			throw new Exception("Cannot create SparqlConnection object because the JSON is wrapped in \"sparqlConn\"");
		}
		
		this.name = (String) jObj.get("name");
		this.domain = (String) jObj.get("domain");
		this.domain = (this.domain == null) ? "" : this.domain;
		
		this.modelInterfaces = new ArrayList<SparqlEndpointInterface>();
		
		this.dataInterfaces = new ArrayList<SparqlEndpointInterface>();
		
		if (jObj.containsKey("dsURL")) {
			
			// super-duper-backwards compatible read
		
			// If any field doesn't exist, presume it exists in the other connection
			this.addModelInterface(	(String)(jObj.get("type")), 
								    (String)(jObj.containsKey("onURL") ? jObj.get("onURL") : jObj.get("dsURL")),
								    (String)(jObj.containsKey("onDataset") ? jObj.get("onDataset") : jObj.get("dsDataset"))
							        );
			this.addDataInterface(	(String)(jObj.get("type")), 
									(String)(jObj.containsKey("dsURL") ? jObj.get("dsURL") : jObj.get("onURL")),
									(String)(jObj.containsKey("dsDataset") ? jObj.get("dsDataset")  : jObj.get("onDataset"))
									);
		} else {
			// normal read
			
			// read model interfaces
	    	for (int i=0; i < ((JSONArray)(jObj.get("model"))).size(); i++) {
	    		JSONObject m = (JSONObject)((JSONArray)jObj.get("model")).get(i);
	    		this.addModelInterface(SparqlEndpointInterface.getInstance(m));
	    	}
	    	// read data interfaces
	    	for (int i=0; i < ((JSONArray)(jObj.get("data"))).size(); i++) {
	    		JSONObject d = (JSONObject)((JSONArray)jObj.get("data")).get(i);
	    		this.addDataInterface(SparqlEndpointInterface.getInstance(d));
	    	}
		}
		
		this.enableOwlImports = (Boolean) jObj.getOrDefault(KEY_ENABLE_OWL_IMPORTS, false);
		
		// no deprecated field-handling
	}
/**
	 * Instantiate empty object from json
	 * @param jObj
	 * @throws Exception
	 */
Instantiate empty object from json
@param jObj
@throws Exception
Instantiate empty object from json @param jObj @throws Exception
public void fromJson(JSONObject jObj) throws Exception {
		if(jObj.entrySet().size() == 1 && jObj.containsKey("sparqlConn")){
			throw new Exception("Cannot create SparqlConnection object because the JSON is wrapped in \"sparqlConn\"");
		}
		this.name = (String) jObj.get("name");
		this.domain = (String) jObj.get("domain");
		this.domain = (this.domain == null) ? "" : this.domain;
		this.modelInterfaces = new ArrayList<SparqlEndpointInterface>();
		this.dataInterfaces = new ArrayList<SparqlEndpointInterface>();
		if (jObj.containsKey("dsURL")) {
			this.addModelInterface(	(String)(jObj.get("type")), 
								    (String)(jObj.containsKey("onURL") ? jObj.get("onURL") : jObj.get("dsURL")),
								    (String)(jObj.containsKey("onDataset") ? jObj.get("onDataset") : jObj.get("dsDataset"))
							        );
			this.addDataInterface(	(String)(jObj.get("type")), 
									(String)(jObj.containsKey("dsURL") ? jObj.get("dsURL") : jObj.get("onURL")),
									(String)(jObj.containsKey("dsDataset") ? jObj.get("dsDataset")  : jObj.get("onDataset"))
									);
		} else {
	    	for (int i=0; i < ((JSONArray)(jObj.get("model"))).size(); i++) {
	    		JSONObject m = (JSONObject)((JSONArray)jObj.get("model")).get(i);
	    		this.addModelInterface(SparqlEndpointInterface.getInstance(m));
	    	}
	    	for (int i=0; i < ((JSONArray)(jObj.get("data"))).size(); i++) {
	    		JSONObject d = (JSONObject)((JSONArray)jObj.get("data")).get(i);
	    		this.addDataInterface(SparqlEndpointInterface.getInstance(d));
	    	}
		}
		this.enableOwlImports = (Boolean) jObj.getOrDefault(KEY_ENABLE_OWL_IMPORTS, false);
	}
public void fromJson ( JSONObject jObj ) throws Exception { if ( jObj . entrySet ( ) . size ( ) == 1 && jObj . containsKey ( "sparqlConn" ) ) { throw new Exception ( "Cannot create SparqlConnection object because the JSON is wrapped in \"sparqlConn\"" ) ; } this . name = ( String ) jObj . get ( "name" ) ; this . domain = ( String ) jObj . get ( "domain" ) ; this . domain = ( this . domain == null ) ? "" : this . domain ; this . modelInterfaces = new ArrayList < SparqlEndpointInterface > ( ) ; this . dataInterfaces = new ArrayList < SparqlEndpointInterface > ( ) ; if ( jObj . containsKey ( "dsURL" ) ) { this . addModelInterface ( ( String ) ( jObj . get ( "type" ) ) , ( String ) ( jObj . containsKey ( "onURL" ) ? jObj . get ( "onURL" ) : jObj . get ( "dsURL" ) ) , ( String ) ( jObj . containsKey ( "onDataset" ) ? jObj . get ( "onDataset" ) : jObj . get ( "dsDataset" ) ) ) ; this . addDataInterface ( ( String ) ( jObj . get ( "type" ) ) , ( String ) ( jObj . containsKey ( "dsURL" ) ? jObj . get ( "dsURL" ) : jObj . get ( "onURL" ) ) , ( String ) ( jObj . containsKey ( "dsDataset" ) ? jObj . get ( "dsDataset" ) : jObj . get ( "onDataset" ) ) ) ; } else { for ( int i = 0 ; i < ( ( JSONArray ) ( jObj . get ( "model" ) ) ) . size ( ) ; i ++ ) { JSONObject m = ( JSONObject ) ( ( JSONArray ) jObj . get ( "model" ) ) . get ( i ) ; this . addModelInterface ( SparqlEndpointInterface . getInstance ( m ) ) ; } for ( int i = 0 ; i < ( ( JSONArray ) ( jObj . get ( "data" ) ) ) . size ( ) ; i ++ ) { JSONObject d = ( JSONObject ) ( ( JSONArray ) jObj . get ( "data" ) ) . get ( i ) ; this . addDataInterface ( SparqlEndpointInterface . getInstance ( d ) ) ; } } this . enableOwlImports = ( Boolean ) jObj . getOrDefault ( KEY_ENABLE_OWL_IMPORTS , false ) ; }
Instantiate empty object from json
 @param jObj
 @throws Exception
Instantiate empty object from json @param jObj @throws Exception
// super-duper-backwards compatible read // If any field doesn't exist, presume it exists in the other connection // normal read // read model interfaces // read data interfaces // no deprecated field-handling