sparqlGraphLibrary/src/test/java/com/ge/research/semtk/belmont/test/QueryGenTest_IT.java
private static void testCatHasChildrenConstruct(NodeGroup ng) throws Exception {
		// make sure oInfo is associated
		ng.noInflateNorValidate(TestGraph.getOInfo());
		String sparql = ng.generateSparqlConstruct();
		
		// run construct:  subject to virtuoso incomplete results problem.  assume away if needed
		JSONArray graph = TestGraph.getSei().executeQueryToGraph(sparql);
		assertEquals("JSON-LD has wrong number of elements", 8, graph.size());
		assertEquals("Not all items have @types", 8, countAttributes(graph, "@type", null));
		assertEquals("Not all items have @id", 8, countAttributes(graph, "@id", null));
		assertEquals("Missing name attributes", 8, countAttributes(graph, "name", null));
		assertEquals("Missing hasKitties attributes", 3, countAttributes(graph, "hasKitties", null));
		assertEquals("Missing hasDemons attributes", 2, countAttributes(graph, "hasDemons", null));
		assertEquals("Missing scaryName attributes", 1, countAttributes(graph, "scaryName", null));

		
		// try without oInfo
		ng.getSparqlConnection().setOwlImportsEnabled(false);
		ng.noInflateNorValidate(null);
		sparql = ng.generateSparqlConstruct();
		
		// run construct:  subject to virtuoso incomplete results problem.  assume away if needed
		graph = TestGraph.getSei().executeQueryToGraph(sparql);
		
		// no oInfo will not use sub properties, so results are empty
		// if this is fixed, then you'd get the same results as above.
		assertEquals("JSON-LD has wrong number of elements", 0, graph.size());
	}
/**
	 * Test the nodegroup construct returns with and without oInfo
	 * @param ng
	 * @throws Exception
	 */
Test the nodegroup construct returns with and without oInfo
@param ng
@throws Exception
Test the nodegroup construct returns with and without oInfo @param ng @throws Exception
private static void testCatHasChildrenConstruct(NodeGroup ng) throws Exception {
		ng.noInflateNorValidate(TestGraph.getOInfo());
		String sparql = ng.generateSparqlConstruct();
		JSONArray graph = TestGraph.getSei().executeQueryToGraph(sparql);
		assertEquals("JSON-LD has wrong number of elements", 8, graph.size());
		assertEquals("Not all items have @types", 8, countAttributes(graph, "@type", null));
		assertEquals("Not all items have @id", 8, countAttributes(graph, "@id", null));
		assertEquals("Missing name attributes", 8, countAttributes(graph, "name", null));
		assertEquals("Missing hasKitties attributes", 3, countAttributes(graph, "hasKitties", null));
		assertEquals("Missing hasDemons attributes", 2, countAttributes(graph, "hasDemons", null));
		assertEquals("Missing scaryName attributes", 1, countAttributes(graph, "scaryName", null));
		ng.getSparqlConnection().setOwlImportsEnabled(false);
		ng.noInflateNorValidate(null);
		sparql = ng.generateSparqlConstruct();
		graph = TestGraph.getSei().executeQueryToGraph(sparql);
		assertEquals("JSON-LD has wrong number of elements", 0, graph.size());
	}
private static void testCatHasChildrenConstruct ( NodeGroup ng ) throws Exception { ng . noInflateNorValidate ( TestGraph . getOInfo ( ) ) ; String sparql = ng . generateSparqlConstruct ( ) ; JSONArray graph = TestGraph . getSei ( ) . executeQueryToGraph ( sparql ) ; assertEquals ( "JSON-LD has wrong number of elements" , 8 , graph . size ( ) ) ; assertEquals ( "Not all items have @types" , 8 , countAttributes ( graph , "@type" , null ) ) ; assertEquals ( "Not all items have @id" , 8 , countAttributes ( graph , "@id" , null ) ) ; assertEquals ( "Missing name attributes" , 8 , countAttributes ( graph , "name" , null ) ) ; assertEquals ( "Missing hasKitties attributes" , 3 , countAttributes ( graph , "hasKitties" , null ) ) ; assertEquals ( "Missing hasDemons attributes" , 2 , countAttributes ( graph , "hasDemons" , null ) ) ; assertEquals ( "Missing scaryName attributes" , 1 , countAttributes ( graph , "scaryName" , null ) ) ; ng . getSparqlConnection ( ) . setOwlImportsEnabled ( false ) ; ng . noInflateNorValidate ( null ) ; sparql = ng . generateSparqlConstruct ( ) ; graph = TestGraph . getSei ( ) . executeQueryToGraph ( sparql ) ; assertEquals ( "JSON-LD has wrong number of elements" , 0 , graph . size ( ) ) ; }
Test the nodegroup construct returns with and without oInfo
 @param ng
 @throws Exception
Test the nodegroup construct returns with and without oInfo @param ng @throws Exception
// make sure oInfo is associated // run construct:  subject to virtuoso incomplete results problem.  assume away if needed // try without oInfo // run construct:  subject to virtuoso incomplete results problem.  assume away if needed // no oInfo will not use sub properties, so results are empty // if this is fixed, then you'd get the same results as above.