sparqlGraphLibrary/src/main/java/com/ge/research/semtk/ontologyTools/OntologyInfo.java
private boolean pathToNgHasInstance(NodeGroup ng, OntologyPath path, SparqlConnection conn) throws Exception {
		
		if (CONSOLE_LOG) { LocalLogger.logToStdOut(path.asString()); }
		ArrayList<Node> anchorList = ng.getNodesBySubclassURI(path.getEndClassName(), this);
		
		
		// path connects, check as connected to ng at each possible point
		for (Node anchorNode : anchorList) {
			LocalLogger.logToStdOut("==> " + anchorNode.getSparqlID());
			// add node with given path
			NodeGroup ngTemp = NodeGroup.deepCopy(ng);
			ngTemp.setSparqlConnection(conn);
			Node connectPointTemp = ngTemp.getNodeBySparqlID(anchorNode.getSparqlID());
			Node nodeAdded = ngTemp.addPath(path, connectPointTemp, this);

			if (this.ngHasInstance(ngTemp, nodeAdded, conn)) {
				return true;
			}
		}
		return false;
		
	}
/** 
	 * Does a ng with new path have any instance data in conn.
	 * Runs directly without any other services.
	 * TODO potential time-out issue?
	 * @param ng - potentially linked to end of path.  
	 * @param anchorNode
	 * @param oInfo
	 * @param path
	 * @param conn
	 * @return
	 * @throws Exception
	 */
Does a ng with new path have any instance data in conn.
Runs directly without any other services.
TODO potential time-out issue.
@param ng - potentially linked to end of path.
Does a ng with new path have any instance data in conn . Runs directly without any other services . TODO potential time - out issue . @param ng - potentially linked to end of path .
private boolean pathToNgHasInstance(NodeGroup ng, OntologyPath path, SparqlConnection conn) throws Exception {
		if (CONSOLE_LOG) { LocalLogger.logToStdOut(path.asString()); }
		ArrayList<Node> anchorList = ng.getNodesBySubclassURI(path.getEndClassName(), this);
		for (Node anchorNode : anchorList) {
			LocalLogger.logToStdOut("==> " + anchorNode.getSparqlID());
			NodeGroup ngTemp = NodeGroup.deepCopy(ng);
			ngTemp.setSparqlConnection(conn);
			Node connectPointTemp = ngTemp.getNodeBySparqlID(anchorNode.getSparqlID());
			Node nodeAdded = ngTemp.addPath(path, connectPointTemp, this);
			if (this.ngHasInstance(ngTemp, nodeAdded, conn)) {
				return true;
			}
		}
		return false;
	}
private boolean pathToNgHasInstance ( NodeGroup ng , OntologyPath path , SparqlConnection conn ) throws Exception { if ( CONSOLE_LOG ) { LocalLogger . logToStdOut ( path . asString ( ) ) ; } ArrayList < Node > anchorList = ng . getNodesBySubclassURI ( path . getEndClassName ( ) , this ) ; for ( Node anchorNode : anchorList ) { LocalLogger . logToStdOut ( "==> " + anchorNode . getSparqlID ( ) ) ; NodeGroup ngTemp = NodeGroup . deepCopy ( ng ) ; ngTemp . setSparqlConnection ( conn ) ; Node connectPointTemp = ngTemp . getNodeBySparqlID ( anchorNode . getSparqlID ( ) ) ; Node nodeAdded = ngTemp . addPath ( path , connectPointTemp , this ) ; if ( this . ngHasInstance ( ngTemp , nodeAdded , conn ) ) { return true ; } } return false ; }
Does a ng with new path have any instance data in conn.
Does a ng with new path have any instance data in conn .
// path connects, check as connected to ng at each possible point // add node with given path