jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r1347107 - /jena/Scratch/AFS/Jena-Dev/trunk/src/dev/Jena250_TestStoreRelease.java
Date Wed, 06 Jun 2012 20:41:13 GMT
Author: andy
Date: Wed Jun  6 20:41:13 2012
New Revision: 1347107

URL: http://svn.apache.org/viewvc?rev=1347107&view=rev
Log: (empty)

Modified:
    jena/Scratch/AFS/Jena-Dev/trunk/src/dev/Jena250_TestStoreRelease.java

Modified: jena/Scratch/AFS/Jena-Dev/trunk/src/dev/Jena250_TestStoreRelease.java
URL: http://svn.apache.org/viewvc/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/Jena250_TestStoreRelease.java?rev=1347107&r1=1347106&r2=1347107&view=diff
==============================================================================
--- jena/Scratch/AFS/Jena-Dev/trunk/src/dev/Jena250_TestStoreRelease.java (original)
+++ jena/Scratch/AFS/Jena-Dev/trunk/src/dev/Jena250_TestStoreRelease.java Wed Jun  6 20:41:13
2012
@@ -27,6 +27,8 @@ public class Jena250_TestStoreRelease {
 	final private static String URI_PREDICATE = "http://jazz.net/xmlns/foundation/1.0/test3";

 	final private static String VERSION_PREDICATE = "http://jazz.net/xmlns/foundation/1.0/test4";

 
+	final static boolean UnionGraphMode = false ;
+	
 	/**
 	 * @param args
 	 */
@@ -39,7 +41,13 @@ public class Jena250_TestStoreRelease {
 			throw new RuntimeException("file mode is not direct, but " + SystemTDB.fileMode()); //$NON-NLS-1$
 		}
 
-		TDB.getContext().set(TDB.symUnionDefaultGraph, true);
+		
+		System.out.println("File mode = "+SystemTDB.fileMode().toString()) ;
+		
+		if ( UnionGraphMode )
+		    TDB.getContext().set(TDB.symUnionDefaultGraph, true);
+		
+		System.out.println("UnionDefaultGraph = "+TDB.getContext().isTrue(TDB.symUnionDefaultGraph))
;
 	
 //		if (args.length == 0) {
 //			throw new RuntimeException("provide a location"); //$NON-NLS-1$
@@ -86,6 +94,10 @@ public class Jena250_TestStoreRelease {
 		this.saveSomeTriples();
 		
 		System.out.println("Releasing the store at location: " + this.location.getDirectoryPath());
+		
+		
+		StoreConnection.make(location).getBaseDataset().sync();
+		
 		StoreConnection.release(this.location);
 	}
 
@@ -162,11 +174,11 @@ public class Jena250_TestStoreRelease {
 	}
 
 	private int storeSize() {
-		String queryStr = "SELECT (COUNT(?s) as ?c)\n" + 
-				"WHERE { \n" + 
-				"  ?s ?p ?o ." + 
-				"}  \n";
-
+	    
+	    String queryStr = UnionGraphMode ?
+               "SELECT (COUNT(?s) as ?c) { ?s ?p ?o . }" :
+               "SELECT (COUNT(?s) as ?c) {  { ?s ?p ?o .} UNION { GRAPH ?g { ?s ?p ?o } }
}" ; 
+	    
 		return this.storeOperation(queryStr, new QueryActivity<Integer>() {
 
 		    // AFS : properly close 



Mime
View raw message