sparqlGraphLibrary/src/test/java/com/ge/research/semtk/load/test/DataLoaderTest_IT.java
public void doTypedString(boolean cacheFlag) throws Exception {
		// setup
		TestGraph.clearGraph();
				
		// ==== pre set some data =====
		TestGraph.uploadOwlResource(this, "/loadTestDuraBattery.owl");
		SparqlGraphJson sgJson0 = TestGraph.getSparqlGraphJsonFromFile("src/test/resources/loadTestDuraBattery.json");
		Dataset ds0 = new CSVDataset("src/test/resources/loadTestDuraBatteryFirst4Data.csv", false);
		DataLoader dl0 = new DataLoader(sgJson0, ds0, TestGraph.getUsername(), TestGraph.getPassword());
		loadData(dl0, "doLookupBatteryIdAddDesc PRELOAD", cacheFlag);
		
		Table err0 = dl0.getLoadingErrorReport();
		if (err0.getNumRows() > 0) {
			fail(err0.toCSVString());
		}

		// run raw SPARQL to retrieve typed string in a FILTER clause
		Table t2 = TestGraph.runQuery(
				"prefix XMLSchema:<http://www.w3.org/2001/XMLSchema#> " +
						"SELECT * FROM <"+ TestGraph.getSei().getGraph() + "> " + 
						"WHERE { ?s ?p ?o .  FILTER ( str(?o) = \"onlycolor\") }"
				);
		assertEquals("FILTER clause did not retrieve literal string when cacheFlag=" + (cacheFlag?"true":"false"), 1, t2.getNumRows());

				
		// run raw SPARQL to retrieve typed string in a VALUES clause
		Table t = TestGraph.runQuery(
				"prefix XMLSchema:<http://www.w3.org/2001/XMLSchema#> " +
				"SELECT * FROM <"+ TestGraph.getSei().getGraph() + "> " + 
				"WHERE { ?s ?p ?o .  VALUES ?o {\"onlycolor\"^^XMLSchema:string } }"
				); 
		
		// now we know/accept that cache insert will indeed strip the type off strings
		System.out.println(
				"VALUES clause " + (t.getNumRows() == 0 ? "DID NOT ":"DID ") + 
				" retrieve literal string with FROM when cacheFlag=" + (cacheFlag?"true":"false") );
		
	}
/**
	 * Insert a few lines
	 * Try to retrieve a typed literal string "onlycolor"^^XMLSchema:string
	 * (Make sure type isn't lost during cache process)
	 */
Insert a few lines
Try to retrieve a typed literal string "onlycolor"^^XMLSchema:string
(Make sure type isn't lost during cache process)
Insert a few lines Try to retrieve a typed literal string " onlycolor " ^^XMLSchema : string ( Make sure type isn ' t lost during cache process )
public void doTypedString(boolean cacheFlag) throws Exception {
		TestGraph.clearGraph();
		TestGraph.uploadOwlResource(this, "/loadTestDuraBattery.owl");
		SparqlGraphJson sgJson0 = TestGraph.getSparqlGraphJsonFromFile("src/test/resources/loadTestDuraBattery.json");
		Dataset ds0 = new CSVDataset("src/test/resources/loadTestDuraBatteryFirst4Data.csv", false);
		DataLoader dl0 = new DataLoader(sgJson0, ds0, TestGraph.getUsername(), TestGraph.getPassword());
		loadData(dl0, "doLookupBatteryIdAddDesc PRELOAD", cacheFlag);
		Table err0 = dl0.getLoadingErrorReport();
		if (err0.getNumRows() > 0) {
			fail(err0.toCSVString());
		}
		Table t2 = TestGraph.runQuery(
				"prefix XMLSchema:<http://www.w3.org/2001/XMLSchema#> " +
						"SELECT * FROM <"+ TestGraph.getSei().getGraph() + "> " + 
						"WHERE { ?s ?p ?o .  FILTER ( str(?o) = \"onlycolor\") }"
				);
		assertEquals("FILTER clause did not retrieve literal string when cacheFlag=" + (cacheFlag?"true":"false"), 1, t2.getNumRows());
		Table t = TestGraph.runQuery(
				"prefix XMLSchema:<http://www.w3.org/2001/XMLSchema#> " +
				"SELECT * FROM <"+ TestGraph.getSei().getGraph() + "> " + 
				"WHERE { ?s ?p ?o .  VALUES ?o {\"onlycolor\"^^XMLSchema:string } }"
				); 
		System.out.println(
				"VALUES clause " + (t.getNumRows() == 0 ? "DID NOT ":"DID ") + 
				" retrieve literal string with FROM when cacheFlag=" + (cacheFlag?"true":"false") );
	}
public void doTypedString ( boolean cacheFlag ) throws Exception { TestGraph . clearGraph ( ) ; TestGraph . uploadOwlResource ( this , "/loadTestDuraBattery.owl" ) ; SparqlGraphJson sgJson0 = TestGraph . getSparqlGraphJsonFromFile ( "src/test/resources/loadTestDuraBattery.json" ) ; Dataset ds0 = new CSVDataset ( "src/test/resources/loadTestDuraBatteryFirst4Data.csv" , false ) ; DataLoader dl0 = new DataLoader ( sgJson0 , ds0 , TestGraph . getUsername ( ) , TestGraph . getPassword ( ) ) ; loadData ( dl0 , "doLookupBatteryIdAddDesc PRELOAD" , cacheFlag ) ; Table err0 = dl0 . getLoadingErrorReport ( ) ; if ( err0 . getNumRows ( ) > 0 ) { fail ( err0 . toCSVString ( ) ) ; } Table t2 = TestGraph . runQuery ( "prefix XMLSchema:<http://www.w3.org/2001/XMLSchema#> " + "SELECT * FROM <" + TestGraph . getSei ( ) . getGraph ( ) + "> " + "WHERE { ?s ?p ?o .  FILTER ( str(?o) = \"onlycolor\") }" ) ; assertEquals ( "FILTER clause did not retrieve literal string when cacheFlag=" + ( cacheFlag ? "true" : "false" ) , 1 , t2 . getNumRows ( ) ) ; Table t = TestGraph . runQuery ( "prefix XMLSchema:<http://www.w3.org/2001/XMLSchema#> " + "SELECT * FROM <" + TestGraph . getSei ( ) . getGraph ( ) + "> " + "WHERE { ?s ?p ?o .  VALUES ?o {\"onlycolor\"^^XMLSchema:string } }" ) ; System . out . println ( "VALUES clause " + ( t . getNumRows ( ) == 0 ? "DID NOT " : "DID " ) + " retrieve literal string with FROM when cacheFlag=" + ( cacheFlag ? "true" : "false" ) ) ; }
Insert a few lines
 Try to retrieve a typed literal string "onlycolor"^^XMLSchema:string
 (Make sure type isn't lost during cache process)
Insert a few lines Try to retrieve a typed literal string " onlycolor " ^^XMLSchema : string ( Make sure type isn ' t lost during cache process )
// setup // ==== pre set some data ===== // run raw SPARQL to retrieve typed string in a FILTER clause // run raw SPARQL to retrieve typed string in a VALUES clause // now we know/accept that cache insert will indeed strip the type off strings