jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r1613101 - /jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/TDB.java
Date Thu, 24 Jul 2014 13:03:40 GMT
Author: andy
Date: Thu Jul 24 13:03:40 2014
New Revision: 1613101

URL: http://svn.apache.org/r1613101
Log:
Sync OntModel and InfGraph specially

Modified:
    jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/TDB.java

Modified: jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/TDB.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/TDB.java?rev=1613101&r1=1613100&r2=1613101&view=diff
==============================================================================
--- jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/TDB.java (original)
+++ jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/TDB.java Thu Jul 24 13:03:40 2014
@@ -29,9 +29,12 @@ import org.slf4j.LoggerFactory ;
 
 import com.hp.hpl.jena.graph.Graph ;
 import com.hp.hpl.jena.graph.Node ;
+import com.hp.hpl.jena.ontology.OntModel ;
+import com.hp.hpl.jena.ontology.impl.OntModelImpl ;
 import com.hp.hpl.jena.query.ARQ ;
 import com.hp.hpl.jena.query.Dataset ;
 import com.hp.hpl.jena.rdf.model.Model ;
+import com.hp.hpl.jena.reasoner.InfGraph ;
 import com.hp.hpl.jena.sparql.SystemARQ ;
 import com.hp.hpl.jena.sparql.core.DatasetGraph ;
 import com.hp.hpl.jena.sparql.core.assembler.AssemblerUtils ;
@@ -127,11 +130,28 @@ public class TDB {
 
     /** Sync a TDB-backed Model. Do nothing if not TDB-backed. */
     public static void sync(Model model) {
+        if ( model instanceof OntModelImpl ) {
+            OntModelImpl ontModel = (OntModelImpl)model ;
+            sync(ontModel.getBaseGraph()) ;
+            return ;
+        }
+        // This never happens (there is only one OntModel implementation)
+        if ( model instanceof OntModel ) {
+            OntModel ontModel = (OntModel)model ;
+            sync(ontModel.getBaseModel()) ;
+            return ;
+        }
+
         sync(model.getGraph()) ;
     }
 
     /** Sync a TDB-backed Graph. Do nothing if not TDB-backed. */
     public static void sync(Graph graph) {
+        if ( graph instanceof InfGraph ) {
+            InfGraph infGraph = (InfGraph)graph ;
+            sync(infGraph.getRawGraph()) ;
+            return ;
+        }
         syncObject(graph) ;
     }
 



Mime
View raw message