sparqlGraphLibrary/src/main/java/com/ge/research/semtk/sparqlX/dispatch/DispatchServiceManager.java
private void calcServiceMnemonic() throws Exception {
		
		if (this.serviceMnemonic != null && ! this.serviceMnemonic.equals(DispatchServiceManager.UNSET)) {
			return;
		}
		
		// get trigger nodes
		ArrayList<Node> valNodes = this.nodegroup.getNodesBySuperclassURI(EDC_VALUE, this.oInfo);
		ArrayList<Node> srcNodes = this.nodegroup.getNodesBySuperclassURI(EDC_SOURCE, this.oInfo);
		String valURI = null;
		String srcURI = null;

		// get value URI (only allow 1)
		if(valNodes.size() == 1){
			valURI = valNodes.get(0).getFullUriName(); 
		}else if(valNodes.size() > 1){
			String valNodeURIList = "";
			for(Node valNode : valNodes){
				valNodeURIList += valNode.getUri(true) + ", ";  // local name
			}
			throw new Exception("Nodegroup has more than one EDC value node: " + valNodeURIList.substring(0, valNodeURIList.length()-2));
		}else{ 
			// no value node
			this.serviceMnemonic = null;
			return;
		}
		
		// get source URI, if any (allow 1 or 0)
		if(srcNodes.size() == 1){
			srcURI = srcNodes.get(0).getFullUriName();
		}else if(srcNodes.size() > 1){	
			String srcNodeURIList = "";
			for(Node srcNode : srcNodes){
				srcNodeURIList += srcNode.getUri(true) + ", ";  // local name
			}
			throw new Exception("Nodegroup has more than one EDC source node: " + srcNodeURIList.substring(0, srcNodeURIList.length()-2));
		} 
		
		// get fill list of possible trigger superclasses from the oInfo
		HashSet<String> valClasses = oInfo.getSuperclassNames(valURI);
		valClasses.add(valURI);
		
		HashSet<String> srcClasses = null;
		if (srcURI != null) {
			srcClasses =  oInfo.getSuperclassNames(srcURI);
			srcClasses.add(srcURI);
		}
		
		// extract the serviceMnemonic from the results
		this.serviceMnemonic = null;
		this.edcSourceClass = null;
		int match = -1;
		for (int row = 0; row < DispatchServiceManager.edcTypeCache.getNumRows(); row ++) {
			if (valClasses.contains(DispatchServiceManager.edcTypeCache.getCell(row, "triggerValueClassname"))) {
				if (srcClasses == null || srcClasses.contains(DispatchServiceManager.edcTypeCache.getCell(row, "triggerSourceClassname"))) {
					if (match == -1) {
						this.serviceMnemonic = DispatchServiceManager.edcTypeCache.getCell(row, "mnemonic");
						this.edcSourceClass = DispatchServiceManager.edcTypeCache.getCell(row, "triggerSourceClassname");
					} else {
						throw new Exception("Found multiple matching mnemonics for nodegroup");
					}
				}
			}
		}
	}
/**
	 * Query for service mnemonic.  ONLY QUERIES ONCE IN THIS OBJECT'S LIFETIME.
	 * @return
	 * @throws Exception
	 */
Query for service mnemonic.  ONLY QUERIES ONCE IN THIS OBJECT'S LIFETIME.
@return
@throws Exception
Query for service mnemonic . ONLY QUERIES ONCE IN THIS OBJECT ' S LIFETIME . @return @throws Exception
private void calcServiceMnemonic() throws Exception {
		if (this.serviceMnemonic != null && ! this.serviceMnemonic.equals(DispatchServiceManager.UNSET)) {
			return;
		}
		ArrayList<Node> valNodes = this.nodegroup.getNodesBySuperclassURI(EDC_VALUE, this.oInfo);
		ArrayList<Node> srcNodes = this.nodegroup.getNodesBySuperclassURI(EDC_SOURCE, this.oInfo);
		String valURI = null;
		String srcURI = null;
		if(valNodes.size() == 1){
			valURI = valNodes.get(0).getFullUriName(); 
		}else if(valNodes.size() > 1){
			String valNodeURIList = "";
			for(Node valNode : valNodes){
				valNodeURIList += valNode.getUri(true) + ", ";  
			}
			throw new Exception("Nodegroup has more than one EDC value node: " + valNodeURIList.substring(0, valNodeURIList.length()-2));
		}else{ 
			this.serviceMnemonic = null;
			return;
		}
		if(srcNodes.size() == 1){
			srcURI = srcNodes.get(0).getFullUriName();
		}else if(srcNodes.size() > 1){	
			String srcNodeURIList = "";
			for(Node srcNode : srcNodes){
				srcNodeURIList += srcNode.getUri(true) + ", ";  
			}
			throw new Exception("Nodegroup has more than one EDC source node: " + srcNodeURIList.substring(0, srcNodeURIList.length()-2));
		} 
		HashSet<String> valClasses = oInfo.getSuperclassNames(valURI);
		valClasses.add(valURI);
		HashSet<String> srcClasses = null;
		if (srcURI != null) {
			srcClasses =  oInfo.getSuperclassNames(srcURI);
			srcClasses.add(srcURI);
		}
		this.serviceMnemonic = null;
		this.edcSourceClass = null;
		int match = -1;
		for (int row = 0; row < DispatchServiceManager.edcTypeCache.getNumRows(); row ++) {
			if (valClasses.contains(DispatchServiceManager.edcTypeCache.getCell(row, "triggerValueClassname"))) {
				if (srcClasses == null || srcClasses.contains(DispatchServiceManager.edcTypeCache.getCell(row, "triggerSourceClassname"))) {
					if (match == -1) {
						this.serviceMnemonic = DispatchServiceManager.edcTypeCache.getCell(row, "mnemonic");
						this.edcSourceClass = DispatchServiceManager.edcTypeCache.getCell(row, "triggerSourceClassname");
					} else {
						throw new Exception("Found multiple matching mnemonics for nodegroup");
					}
				}
			}
		}
	}
private void calcServiceMnemonic ( ) throws Exception { if ( this . serviceMnemonic != null && ! this . serviceMnemonic . equals ( DispatchServiceManager . UNSET ) ) { return ; } ArrayList < Node > valNodes = this . nodegroup . getNodesBySuperclassURI ( EDC_VALUE , this . oInfo ) ; ArrayList < Node > srcNodes = this . nodegroup . getNodesBySuperclassURI ( EDC_SOURCE , this . oInfo ) ; String valURI = null ; String srcURI = null ; if ( valNodes . size ( ) == 1 ) { valURI = valNodes . get ( 0 ) . getFullUriName ( ) ; } else if ( valNodes . size ( ) > 1 ) { String valNodeURIList = "" ; for ( Node valNode : valNodes ) { valNodeURIList += valNode . getUri ( true ) + ", " ; } throw new Exception ( "Nodegroup has more than one EDC value node: " + valNodeURIList . substring ( 0 , valNodeURIList . length ( ) - 2 ) ) ; } else { this . serviceMnemonic = null ; return ; } if ( srcNodes . size ( ) == 1 ) { srcURI = srcNodes . get ( 0 ) . getFullUriName ( ) ; } else if ( srcNodes . size ( ) > 1 ) { String srcNodeURIList = "" ; for ( Node srcNode : srcNodes ) { srcNodeURIList += srcNode . getUri ( true ) + ", " ; } throw new Exception ( "Nodegroup has more than one EDC source node: " + srcNodeURIList . substring ( 0 , srcNodeURIList . length ( ) - 2 ) ) ; } HashSet < String > valClasses = oInfo . getSuperclassNames ( valURI ) ; valClasses . add ( valURI ) ; HashSet < String > srcClasses = null ; if ( srcURI != null ) { srcClasses = oInfo . getSuperclassNames ( srcURI ) ; srcClasses . add ( srcURI ) ; } this . serviceMnemonic = null ; this . edcSourceClass = null ; int match = - 1 ; for ( int row = 0 ; row < DispatchServiceManager . edcTypeCache . getNumRows ( ) ; row ++ ) { if ( valClasses . contains ( DispatchServiceManager . edcTypeCache . getCell ( row , "triggerValueClassname" ) ) ) { if ( srcClasses == null || srcClasses . contains ( DispatchServiceManager . edcTypeCache . getCell ( row , "triggerSourceClassname" ) ) ) { if ( match == - 1 ) { this . serviceMnemonic = DispatchServiceManager . edcTypeCache . getCell ( row , "mnemonic" ) ; this . edcSourceClass = DispatchServiceManager . edcTypeCache . getCell ( row , "triggerSourceClassname" ) ; } else { throw new Exception ( "Found multiple matching mnemonics for nodegroup" ) ; } } } } }
Query for service mnemonic.
Query for service mnemonic .
// get trigger nodes // get value URI (only allow 1) // local name // no value node // get source URI, if any (allow 1 or 0) // local name // get fill list of possible trigger superclasses from the oInfo // extract the serviceMnemonic from the results