sparqlGraphLibrary/src/main/java/com/ge/research/semtk/sparqlX/dispatch/DispatchServiceManager.java
private void addReturns(NodeGroup ng) throws Exception {
		
		if (this.mneParams == null) return;
		
		// in rare case that nodegroup does not have the EdcSourceClass in the mneumonic
		// add it so that the returns' paths pass through it
		ng.getOrAddNode(this.edcSourceClass, oInfo, true);
		
		String [] classURI = this.mneParams.getColumn(0);
		String [] keyName  = this.mneParams.getColumn(1);
		String [] sparqlID = this.mneParams.getColumn(2);
		 
		for (int i=0; i < classURI.length; i++) {
			String uri = classURI[i];
			
			// add the node if needed
			Node snode = ng.getOrAddNode(uri, oInfo, true);
			
			//**** Return the class if requested - Java version empty keyName  ****//
			if (keyName[i].length() < 1) {
				// change sparql id if it is wrong
				String targetID = '?' + sparqlID[i];
				if (! snode.getSparqlID().equals(targetID)) {
					String newID = ng.changeSparqlID(snode, targetID);
					if (!newID.equals(targetID)) {
						throw new Exception("Internal error: tried to build sparqlID return '"
								+ targetID
								+ "' but got '"
								+ newID
								+ "'.\nReserved sparqlID may be in use in nodegroup.");
					}
				}
				// set returned: no harm if it is already returned
				snode.setIsReturned(true);
			}
			
			//**** Set properties to return ****//
			else {
				
				// return uri->keyName as "sparqlID"
				
				String targetID = '?' + sparqlID[i];

				// look up the property
				PropertyItem prop = snode.getPropertyByKeyname(keyName[i]);
				if (prop == null) {
					throw new Exception("Internal error in initNodeGroup(): can't find property '"
							+ keyName[i]
							+ "' of '"
							+ classURI[i] + "'");
				}

				// change sparqlID if it is wrong
				if (! prop.getSparqlID().equals(targetID)) {
					String newID = ng.changeSparqlID(prop, targetID);
					if (! newID.equals(targetID)) {
						throw new Exception("Internal error: tried to build sparqlID return '"
								+ targetID
								+ "' but got '"
								+ newID + "'.  \nSame sparqlID is used twice.");
					}
				}

				// set returned: no harm if it is already returned
				prop.setIsReturned(true);
				prop.setOptMinus(PropertyItem.OPT_MINUS_NONE);
			}
			
		}
	}
/**
	 * Add in nodes from this.mneParams
	 * @throws Exception
	 */
Add in nodes from this.mneParams
@throws Exception
Add in nodes from this . mneParams @throws Exception
private void addReturns(NodeGroup ng) throws Exception {
		if (this.mneParams == null) return;
		ng.getOrAddNode(this.edcSourceClass, oInfo, true);
		String [] classURI = this.mneParams.getColumn(0);
		String [] keyName  = this.mneParams.getColumn(1);
		String [] sparqlID = this.mneParams.getColumn(2);
		for (int i=0; i < classURI.length; i++) {
			String uri = classURI[i];
			Node snode = ng.getOrAddNode(uri, oInfo, true);
			if (keyName[i].length() < 1) {
				String targetID = '?' + sparqlID[i];
				if (! snode.getSparqlID().equals(targetID)) {
					String newID = ng.changeSparqlID(snode, targetID);
					if (!newID.equals(targetID)) {
						throw new Exception("Internal error: tried to build sparqlID return '"
								+ targetID
								+ "' but got '"
								+ newID
								+ "'.\nReserved sparqlID may be in use in nodegroup.");
					}
				}
				snode.setIsReturned(true);
			}
			else {
				String targetID = '?' + sparqlID[i];
				PropertyItem prop = snode.getPropertyByKeyname(keyName[i]);
				if (prop == null) {
					throw new Exception("Internal error in initNodeGroup(): can't find property '"
							+ keyName[i]
							+ "' of '"
							+ classURI[i] + "'");
				}
				if (! prop.getSparqlID().equals(targetID)) {
					String newID = ng.changeSparqlID(prop, targetID);
					if (! newID.equals(targetID)) {
						throw new Exception("Internal error: tried to build sparqlID return '"
								+ targetID
								+ "' but got '"
								+ newID + "'.  \nSame sparqlID is used twice.");
					}
				}
				prop.setIsReturned(true);
				prop.setOptMinus(PropertyItem.OPT_MINUS_NONE);
			}
		}
	}
private void addReturns ( NodeGroup ng ) throws Exception { if ( this . mneParams == null ) return ; ng . getOrAddNode ( this . edcSourceClass , oInfo , true ) ; String [ ] classURI = this . mneParams . getColumn ( 0 ) ; String [ ] keyName = this . mneParams . getColumn ( 1 ) ; String [ ] sparqlID = this . mneParams . getColumn ( 2 ) ; for ( int i = 0 ; i < classURI . length ; i ++ ) { String uri = classURI [ i ] ; Node snode = ng . getOrAddNode ( uri , oInfo , true ) ; if ( keyName [ i ] . length ( ) < 1 ) { String targetID = '?' + sparqlID [ i ] ; if ( ! snode . getSparqlID ( ) . equals ( targetID ) ) { String newID = ng . changeSparqlID ( snode , targetID ) ; if ( ! newID . equals ( targetID ) ) { throw new Exception ( "Internal error: tried to build sparqlID return '" + targetID + "' but got '" + newID + "'.\nReserved sparqlID may be in use in nodegroup." ) ; } } snode . setIsReturned ( true ) ; } else { String targetID = '?' + sparqlID [ i ] ; PropertyItem prop = snode . getPropertyByKeyname ( keyName [ i ] ) ; if ( prop == null ) { throw new Exception ( "Internal error in initNodeGroup(): can't find property '" + keyName [ i ] + "' of '" + classURI [ i ] + "'" ) ; } if ( ! prop . getSparqlID ( ) . equals ( targetID ) ) { String newID = ng . changeSparqlID ( prop , targetID ) ; if ( ! newID . equals ( targetID ) ) { throw new Exception ( "Internal error: tried to build sparqlID return '" + targetID + "' but got '" + newID + "'.  \nSame sparqlID is used twice." ) ; } } prop . setIsReturned ( true ) ; prop . setOptMinus ( PropertyItem . OPT_MINUS_NONE ) ; } } }
Add in nodes from this.mneParams
 @throws Exception
Add in nodes from this . mneParams @throws Exception
// in rare case that nodegroup does not have the EdcSourceClass in the mneumonic // add it so that the returns' paths pass through it // add the node if needed //**** Return the class if requested - Java version empty keyName  ****// // change sparql id if it is wrong // set returned: no harm if it is already returned //**** Set properties to return ****// // return uri->keyName as "sparqlID" // look up the property // change sparqlID if it is wrong // set returned: no harm if it is already returned