[Mulgara-svn] r1264 - trunk/src/jar/resolver/java/org/mulgara/resolver

pag at mulgara.org pag at mulgara.org
Tue Sep 23 04:28:21 UTC 2008


Author: pag
Date: 2008-09-22 21:28:20 -0700 (Mon, 22 Sep 2008)
New Revision: 1264

Modified:
   trunk/src/jar/resolver/java/org/mulgara/resolver/SetModelOperation.java
Log:
More flexible testing on source and destination graph URIs when inserting data

Modified: trunk/src/jar/resolver/java/org/mulgara/resolver/SetModelOperation.java
===================================================================
--- trunk/src/jar/resolver/java/org/mulgara/resolver/SetModelOperation.java	2008-09-23 04:26:38 UTC (rev 1263)
+++ trunk/src/jar/resolver/java/org/mulgara/resolver/SetModelOperation.java	2008-09-23 04:28:20 UTC (rev 1264)
@@ -127,12 +127,14 @@
       throw new IllegalStateException("SetModelOperation already executed.  Cannot reexecute.");
     }
 
-    long sourceModel = systemResolver.localize(new URIReferenceImpl(srcModelURI));
     long destinationModel = systemResolver.localize(new URIReferenceImpl(destModelURI));
+    try {
+      long sourceModel = systemResolver.localize(new URIReferenceImpl(srcModelURI, false));
+      if (destinationModel == sourceModel) throw new QueryException("Identical source and destination: " + destModelURI);
+    } catch (Exception e) {
+      // source and destinations cannot be equal, so ignore
+    }
 
-    if (destinationModel == sourceModel) {
-      throw new QueryException("Identical source and destination: " + destModelURI);
-    }
     // update the destination to the canonical form
     destinationModel = operationContext.getCanonicalModel(destinationModel);
 




More information about the Mulgara-svn mailing list