Adapting B* generated Sparql to custom implementation

Apr 4, 2014 at 9:30 AM
Edited Apr 4, 2014 at 9:31 AM

After some changes in unit test code I managed to run SimpleContextTests against Virtuoso (33 pass and 8 fail).
First problem is that Virtuoso doesn't support multiple queries in a request that have "WITH"
WITH <graph>DELETE {  }INSERT {  }WHERE { } 
WITH <graph>DELETE {  }INSERT {  }WHERE { } 
and while they decide if it's a bug and maybe fix it I need to solve this so I changed some SparqlUpdatableStore code to:
foreach (var deletePattern in deletePatterns.Where(p=>IsGraphTargeted(p) && !IsGrounded(p)))
//deleteCmds.AppendFormat("WITH <{0}> DELETE {{ {1} }} WHERE {{ {1} }};",
// deletePattern.Graph, FormatDeletePattern(deletePattern, ref propId));
 deleteCmds.AppendFormat("DELETE {{ GRAPH <{0}> {{ {1} }} }} 
WHERE {{ GRAPH <{0}> {{ {1} }} }};",
 deletePattern.Graph, FormatDeletePattern(deletePattern, ref propId));
Now it solves the problem but obviously existing EF is correct, I just need an workarround in this special case that would work in future EF releases.

So I'm thinking maybe to expose "SparqlUpdatableStore" class through a context constructor so I can inject it...or maybe you have some other idea so we don't add more constructors.
The general point is that when using an external store there will probably be various scenarios where we need workarrounds for that particular implementation.