jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r1202208 - in /incubator/jena/Jena2/TDB/trunk: ./ .settings/ src/main/java/com/hp/hpl/jena/tdb/migrate/ src/main/java/com/hp/hpl/jena/tdb/store/ src/test/java/com/hp/hpl/jena/tdb/migrate/ src/test/java/com/hp/hpl/jena/tdb/store/
Date Tue, 15 Nov 2011 14:27:43 GMT
Author: andy
Date: Tue Nov 15 14:27:42 2011
New Revision: 1202208

URL: http://svn.apache.org/viewvc?rev=1202208&view=rev
Log:
Allow for synthetic graph (union, explicitly named default) in GRAPH.

Modified:
    incubator/jena/Jena2/TDB/trunk/.classpath
    incubator/jena/Jena2/TDB/trunk/.settings/org.eclipse.jdt.core.prefs
    incubator/jena/Jena2/TDB/trunk/src/main/java/com/hp/hpl/jena/tdb/migrate/DynamicDatasets.java
    incubator/jena/Jena2/TDB/trunk/src/main/java/com/hp/hpl/jena/tdb/store/DatasetGraphTDB.java
    incubator/jena/Jena2/TDB/trunk/src/test/java/com/hp/hpl/jena/tdb/migrate/TestGraphUnionRead.java
    incubator/jena/Jena2/TDB/trunk/src/test/java/com/hp/hpl/jena/tdb/store/TestDatasetTDB.java

Modified: incubator/jena/Jena2/TDB/trunk/.classpath
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/TDB/trunk/.classpath?rev=1202208&r1=1202207&r2=1202208&view=diff
==============================================================================
--- incubator/jena/Jena2/TDB/trunk/.classpath (original)
+++ incubator/jena/Jena2/TDB/trunk/.classpath Tue Nov 15 14:27:42 2011
@@ -1,42 +1,24 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-  <classpathentry excluding="**/.svn/" kind="src" path="src/main/java"/>
-  <classpathentry excluding="**/.svn/" kind="src" path="src/test/java"/>
-  <classpathentry excluding="**/.svn/" kind="src" path="src-dev"/>
-  <classpathentry excluding="**/.svn/" kind="src" path="src-examples"/>
-  <classpathentry excluding="**/*.java" kind="src" path="resources"/>
-  <classpathentry excluding="**/*.java" kind="src" path="resources2"/>
-
-  <classpathentry kind="var" 
-		  path="M2_REPO/org/apache/jena/jena-arq/2.8.9-incubating-SNAPSHOT/jena-arq-2.8.9-incubating-SNAPSHOT.jar"

-		  sourcepath="M2_REPO/org/apache/jena/jena-arq/2.8.9-incubating-SNAPSHOT/jena-arq-2.8.9-incubating-SNAPSHOT-sources.jar"/>
-
-  <classpathentry kind="var"
-		  path="M2_REPO/org/apache/jena/jena-arq/2.8.9-incubating-SNAPSHOT/jena-arq-2.8.9-incubating-SNAPSHOT-tests.jar"

-		  sourcepath="M2_REPO/org/apache/jena/jena-arq/2.8.9-incubating-SNAPSHOT/jena-arq-2.8.9-incubating-SNAPSHOT-test-sources.jar"/>
-
-  <classpathentry kind="var" 
-		  path="M2_REPO/org/apache/jena/jena-iri/0.9.0-incubating-SNAPSHOT/jena-iri-0.9.0-incubating-SNAPSHOT.jar"
-		  sourcepath="M2_REPO/org/apache/jena/jena-iri/0.9.0-incubating-SNAPSHOT/jena-iri-0.9.0-incubating-SNAPSHOT-sources.jar"/>
-
-  <classpathentry kind="var" 
-		  path="M2_REPO/org/apache/jena/jena-core/2.6.5-incubating-SNAPSHOT/jena-core-2.6.5-incubating-SNAPSHOT-tests.jar"

-		  sourcepath="M2_REPO/org/apache/jena/jena-core/2.6.5-incubating-SNAPSHOT/jena-core-2.6.5-incubating-SNAPSHOT-test-sources.jar"/>
-
-  <classpathentry kind="var" 
-		  path="M2_REPO/org/apache/jena/jena-core/2.6.5-incubating-SNAPSHOT/jena-core-2.6.5-incubating-SNAPSHOT.jar"

-		  sourcepath="M2_REPO/org/apache/jena/jena-core/2.6.5-incubating-SNAPSHOT/jena-core-2.6.5-incubating-SNAPSHOT-sources.jar"/>
-
-
-  <classpathentry kind="var" path="M2_REPO/com/ibm/icu/icu4j/3.4.4/icu4j-3.4.4.jar" sourcepath="M2_REPO/com/ibm/icu/icu4j/3.4.4/icu4j-3.4.4-sources.jar"/>
-
-  <classpathentry kind="var" path="M2_REPO/junit/junit/4.9/junit-4.9.jar" sourcepath="M2_REPO/junit/junit/4.9/junit-4.9-sources.jar"/>
-  <classpathentry kind="var" path="M2_REPO/log4j/log4j/1.2.16/log4j-1.2.16.jar" sourcepath="M2_REPO/log4j/log4j/1.2.16/log4j-1.2.16-sources.jar"/>
-  <classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-api/1.6.1/slf4j-api-1.6.1.jar"
sourcepath="M2_REPO/org/slf4j/slf4j-api/1.6.1/slf4j-api-1.6.1-sources.jar"/>
-  <classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-log4j12/1.6.1/slf4j-log4j12-1.6.1.jar"
sourcepath="M2_REPO/org/slf4j/slf4j-log4j12/1.6.1/slf4j-log4j12-1.6.1-sources.jar"/>
-  <classpathentry kind="var" path="M2_REPO/stax/stax-api/1.0.1/stax-api-1.0.1.jar"/>
-  <classpathentry kind="var" path="M2_REPO/org/codehaus/woodstox/wstx-asl/3.2.9/wstx-asl-3.2.9.jar"
sourcepath="M2_REPO/org/codehaus/woodstox/wstx-asl/3.2.9/wstx-asl-3.2.9-sources.jar"/>
-  <classpathentry kind="var" path="M2_REPO/xerces/xercesImpl/2.7.1/xercesImpl-2.7.1.jar"/>
-  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
-  <classpathentry kind="output" path="classes"/>
+	<classpathentry excluding="**/.svn/" kind="src" path="src/main/java"/>
+	<classpathentry excluding="**/.svn/" kind="src" path="src/test/java"/>
+	<classpathentry excluding="**/.svn/" kind="src" path="src-dev"/>
+	<classpathentry excluding="**/.svn/" kind="src" path="src-examples"/>
+	<classpathentry excluding="**/*.java" kind="src" path="resources"/>
+	<classpathentry excluding="**/*.java" kind="src" path="resources2"/>
+	<classpathentry kind="var" path="M2_REPO/org/apache/jena/jena-arq/2.8.9-incubating-SNAPSHOT/jena-arq-2.8.9-incubating-SNAPSHOT.jar"
sourcepath="M2_REPO/org/apache/jena/jena-arq/2.8.9-incubating-SNAPSHOT/jena-arq-2.8.9-incubating-SNAPSHOT-sources.jar"/>
+	<classpathentry kind="var" path="M2_REPO/org/apache/jena/jena-arq/2.8.9-incubating-SNAPSHOT/jena-arq-2.8.9-incubating-SNAPSHOT-tests.jar"
sourcepath="M2_REPO/org/apache/jena/jena-arq/2.8.9-incubating-SNAPSHOT/jena-arq-2.8.9-incubating-SNAPSHOT-test-sources.jar"/>
+	<classpathentry kind="var" path="M2_REPO/org/apache/jena/jena-iri/0.9.0-incubating-SNAPSHOT/jena-iri-0.9.0-incubating-SNAPSHOT.jar"
sourcepath="M2_REPO/org/apache/jena/jena-iri/0.9.0-incubating-SNAPSHOT/jena-iri-0.9.0-incubating-SNAPSHOT-sources.jar"/>
+	<classpathentry kind="var" path="M2_REPO/org/apache/jena/jena-core/2.6.5-incubating-SNAPSHOT/jena-core-2.6.5-incubating-SNAPSHOT-tests.jar"
sourcepath="M2_REPO/org/apache/jena/jena-core/2.6.5-incubating-SNAPSHOT/jena-core-2.6.5-incubating-SNAPSHOT-test-sources.jar"/>
+	<classpathentry kind="var" path="M2_REPO/org/apache/jena/jena-core/2.6.5-incubating-SNAPSHOT/jena-core-2.6.5-incubating-SNAPSHOT.jar"
sourcepath="M2_REPO/org/apache/jena/jena-core/2.6.5-incubating-SNAPSHOT/jena-core-2.6.5-incubating-SNAPSHOT-sources.jar"/>
+	<classpathentry kind="var" path="M2_REPO/com/ibm/icu/icu4j/3.4.4/icu4j-3.4.4.jar" sourcepath="M2_REPO/com/ibm/icu/icu4j/3.4.4/icu4j-3.4.4-sources.jar"/>
+	<classpathentry kind="var" path="M2_REPO/junit/junit/4.9/junit-4.9.jar" sourcepath="M2_REPO/junit/junit/4.9/junit-4.9-sources.jar"/>
+	<classpathentry kind="var" path="M2_REPO/log4j/log4j/1.2.16/log4j-1.2.16.jar" sourcepath="M2_REPO/log4j/log4j/1.2.16/log4j-1.2.16-sources.jar"/>
+	<classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-api/1.6.1/slf4j-api-1.6.1.jar"
sourcepath="M2_REPO/org/slf4j/slf4j-api/1.6.1/slf4j-api-1.6.1-sources.jar"/>
+	<classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-log4j12/1.6.1/slf4j-log4j12-1.6.1.jar"
sourcepath="M2_REPO/org/slf4j/slf4j-log4j12/1.6.1/slf4j-log4j12-1.6.1-sources.jar"/>
+	<classpathentry kind="var" path="M2_REPO/stax/stax-api/1.0.1/stax-api-1.0.1.jar"/>
+	<classpathentry kind="var" path="M2_REPO/org/codehaus/woodstox/wstx-asl/3.2.9/wstx-asl-3.2.9.jar"
sourcepath="M2_REPO/org/codehaus/woodstox/wstx-asl/3.2.9/wstx-asl-3.2.9-sources.jar"/>
+	<classpathentry kind="var" path="M2_REPO/xerces/xercesImpl/2.7.1/xercesImpl-2.7.1.jar"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="output" path="classes"/>
 </classpath>

Modified: incubator/jena/Jena2/TDB/trunk/.settings/org.eclipse.jdt.core.prefs
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/TDB/trunk/.settings/org.eclipse.jdt.core.prefs?rev=1202208&r1=1202207&r2=1202208&view=diff
==============================================================================
--- incubator/jena/Jena2/TDB/trunk/.settings/org.eclipse.jdt.core.prefs (original)
+++ incubator/jena/Jena2/TDB/trunk/.settings/org.eclipse.jdt.core.prefs Tue Nov 15 14:27:42
2011
@@ -1,4 +1,4 @@
-#Sun Jun 26 19:12:16 BST 2011
+#Tue Nov 15 09:17:36 GMT 2011
 eclipse.preferences.version=1
 encoding//src/main/java=UTF-8
 encoding//src/test/java=UTF-8

Modified: incubator/jena/Jena2/TDB/trunk/src/main/java/com/hp/hpl/jena/tdb/migrate/DynamicDatasets.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/TDB/trunk/src/main/java/com/hp/hpl/jena/tdb/migrate/DynamicDatasets.java?rev=1202208&r1=1202207&r2=1202208&view=diff
==============================================================================
--- incubator/jena/Jena2/TDB/trunk/src/main/java/com/hp/hpl/jena/tdb/migrate/DynamicDatasets.java
(original)
+++ incubator/jena/Jena2/TDB/trunk/src/main/java/com/hp/hpl/jena/tdb/migrate/DynamicDatasets.java
Tue Nov 15 14:27:42 2011
@@ -125,6 +125,14 @@ public class DynamicDatasets
 
         private Graph unionGraph = null ;
         
+        @Override
+        public boolean containsGraph(Node graphNode)
+        {
+            if ( Quad.isUnionGraph(graphNode) ) return true ;
+            if ( Quad.isDefaultGraphExplicit(graphNode)) return true ;
+            return super.containsGraph(graphNode) ;
+        }
+        
         // See also the GraphOps
         @Override
         public Graph getGraph(Node graphNode)

Modified: incubator/jena/Jena2/TDB/trunk/src/main/java/com/hp/hpl/jena/tdb/store/DatasetGraphTDB.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/TDB/trunk/src/main/java/com/hp/hpl/jena/tdb/store/DatasetGraphTDB.java?rev=1202208&r1=1202207&r2=1202208&view=diff
==============================================================================
--- incubator/jena/Jena2/TDB/trunk/src/main/java/com/hp/hpl/jena/tdb/store/DatasetGraphTDB.java
(original)
+++ incubator/jena/Jena2/TDB/trunk/src/main/java/com/hp/hpl/jena/tdb/store/DatasetGraphTDB.java
Tue Nov 15 14:27:42 2011
@@ -173,11 +173,19 @@ public class DatasetGraphTDB extends Dat
     
     @Override
     // Empty graphs don't "exist" 
-    public boolean containsGraph(Node graphNode) { return _containsGraph(graphNode) ; }
+    public boolean containsGraph(Node graphNode)
+    { 
+        if ( Quad.isDefaultGraphExplicit(graphNode) || Quad.isUnionGraph(graphNode)  )
+            return true ;
+        return _containsGraph(graphNode) ; 
+    }
 
     @Override
     protected boolean _containsGraph(Node graphNode)
     {
+        // Have to look explicitly, which is a bit of a nuisance.
+        // But does not normally happen for GRAPH <g> because that's rewritten to quads.
+        // Only pattern with complex paths go via GRAPH. 
         Iterator<Tuple<NodeId>> x = quadTable.getNodeTupleTable().findAsNodeIds(graphNode,
null, null, null) ;
         if ( x == null )
             return false ; 

Modified: incubator/jena/Jena2/TDB/trunk/src/test/java/com/hp/hpl/jena/tdb/migrate/TestGraphUnionRead.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/TDB/trunk/src/test/java/com/hp/hpl/jena/tdb/migrate/TestGraphUnionRead.java?rev=1202208&r1=1202207&r2=1202208&view=diff
==============================================================================
--- incubator/jena/Jena2/TDB/trunk/src/test/java/com/hp/hpl/jena/tdb/migrate/TestGraphUnionRead.java
(original)
+++ incubator/jena/Jena2/TDB/trunk/src/test/java/com/hp/hpl/jena/tdb/migrate/TestGraphUnionRead.java
Tue Nov 15 14:27:42 2011
@@ -113,8 +113,17 @@ public class TestGraphUnionRead extends 
         assertEquals(2, x) ;
     }
 
-    static <T> List<T> list(T...x)
+    static <T> List<T> list(/* Java 7 @SuppressWarnings("unchecked")*/ T...x)
     {
+        // Warning: "Potential heap pollution via varargs parameter x"
+        // Presumably because x is passed into a method. 
         return Arrays.asList(x) ;
+        
+        // Avoid warning - copy.
+//        List<T> array = new ArrayList<T>(x.length) ;
+//        for ( T t : x )
+//            array.add(t) ;
+//        return array ;
+        
     }
 }

Modified: incubator/jena/Jena2/TDB/trunk/src/test/java/com/hp/hpl/jena/tdb/store/TestDatasetTDB.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/TDB/trunk/src/test/java/com/hp/hpl/jena/tdb/store/TestDatasetTDB.java?rev=1202208&r1=1202207&r2=1202208&view=diff
==============================================================================
--- incubator/jena/Jena2/TDB/trunk/src/test/java/com/hp/hpl/jena/tdb/store/TestDatasetTDB.java
(original)
+++ incubator/jena/Jena2/TDB/trunk/src/test/java/com/hp/hpl/jena/tdb/store/TestDatasetTDB.java
Tue Nov 15 14:27:42 2011
@@ -18,18 +18,18 @@
 
 package com.hp.hpl.jena.tdb.store;
 
-import org.junit.Test;
+import org.junit.Test ;
 import org.openjena.atlas.junit.BaseTest ;
 
-import com.hp.hpl.jena.query.*;
-import com.hp.hpl.jena.rdf.model.Model;
-import com.hp.hpl.jena.rdf.model.ModelFactory;
-import com.hp.hpl.jena.rdf.model.Property;
-import com.hp.hpl.jena.rdf.model.Resource;
-import com.hp.hpl.jena.sparql.core.Quad;
-import com.hp.hpl.jena.tdb.TDB;
-import com.hp.hpl.jena.tdb.TDBFactory;
-import com.hp.hpl.jena.util.FileManager;
+import com.hp.hpl.jena.query.* ;
+import com.hp.hpl.jena.rdf.model.Model ;
+import com.hp.hpl.jena.rdf.model.ModelFactory ;
+import com.hp.hpl.jena.rdf.model.Property ;
+import com.hp.hpl.jena.rdf.model.Resource ;
+import com.hp.hpl.jena.sparql.core.Quad ;
+import com.hp.hpl.jena.tdb.TDB ;
+import com.hp.hpl.jena.tdb.TDBFactory ;
+import com.hp.hpl.jena.util.FileManager ;
 
 /** Tests of datasets, prefixes, special URIs etc (see also {@link com.hp.hpl.jena.sparql.graph.GraphsTests}
*/
 public class TestDatasetTDB extends BaseTest



Mime
View raw message