sparqlGraphLibrary/src/main/java/com/ge/research/semtk/belmont/NodeGroup.java
public static NodeGroup createConstructAllConnected(String classUri, String instanceUri, SparqlConnection conn, OntologyInfo oInfo, PredicateStats stats) throws Exception {
		NodeGroup ng = new NodeGroup();
		ng.setSparqlConnection(conn);
		// add main node and set instance constraint
		Node newNode = ng.addNode(classUri, oInfo); 
		newNode.addValueConstraint(ValueConstraint.buildBestListConstraint(newNode, instanceUri, conn.getDefaultQueryInterface()));
		ng.setIsReturnedAllProps(newNode, true, PropertyItem.OPT_MINUS_OPTIONAL);
		ng.addAllConnectedNodes(newNode, true, NodeItem.OPTIONAL_TRUE, oInfo, stats);
		ng.setQueryType(AutoGeneratedQueryTypes.CONSTRUCT);
		return ng;
	}
/**
	 * Create a CONSTRUCT nodegroup to find everything connected to piece of instance data.
	 * Always uses predicate stats to build a nodegroup of only existing data.
	 * 
	 * @param classUri - class of the instance data
	 * @param instanceUri - uri of the instance data
	 * @param conn - query conn to optimize the constraint
	 * @param oInfo - oinfo with the model
	 * @param stats - predicate stats
	 * @return
	 * @throws Exception
	 */
Create a CONSTRUCT nodegroup to find everything connected to piece of instance data.
Always uses predicate stats to build a nodegroup of only existing data.


Create a CONSTRUCT nodegroup to find everything connected to piece of instance data . Always uses predicate stats to build a nodegroup of only existing data .
public static NodeGroup createConstructAllConnected(String classUri, String instanceUri, SparqlConnection conn, OntologyInfo oInfo, PredicateStats stats) throws Exception {
		NodeGroup ng = new NodeGroup();
		ng.setSparqlConnection(conn);
		Node newNode = ng.addNode(classUri, oInfo); 
		newNode.addValueConstraint(ValueConstraint.buildBestListConstraint(newNode, instanceUri, conn.getDefaultQueryInterface()));
		ng.setIsReturnedAllProps(newNode, true, PropertyItem.OPT_MINUS_OPTIONAL);
		ng.addAllConnectedNodes(newNode, true, NodeItem.OPTIONAL_TRUE, oInfo, stats);
		ng.setQueryType(AutoGeneratedQueryTypes.CONSTRUCT);
		return ng;
	}
public static NodeGroup createConstructAllConnected ( String classUri , String instanceUri , SparqlConnection conn , OntologyInfo oInfo , PredicateStats stats ) throws Exception { NodeGroup ng = new NodeGroup ( ) ; ng . setSparqlConnection ( conn ) ; Node newNode = ng . addNode ( classUri , oInfo ) ; newNode . addValueConstraint ( ValueConstraint . buildBestListConstraint ( newNode , instanceUri , conn . getDefaultQueryInterface ( ) ) ) ; ng . setIsReturnedAllProps ( newNode , true , PropertyItem . OPT_MINUS_OPTIONAL ) ; ng . addAllConnectedNodes ( newNode , true , NodeItem . OPTIONAL_TRUE , oInfo , stats ) ; ng . setQueryType ( AutoGeneratedQueryTypes . CONSTRUCT ) ; return ng ; }
Create a CONSTRUCT nodegroup to find everything connected to piece of instance data.
Create a CONSTRUCT nodegroup to find everything connected to piece of instance data .
// add main node and set instance constraint