Thanks for the explanation Andy. I'm still a bit confused about what is meant by the default graph though TBH... I thought starting Fuseki with "tdb:unionDefaultGraph true" might mean that queries and updates would work without specifying the graph name? It certainly seems to be true of queries (Elda just works with no change) - but perhaps this is because only the WHERE clause is affected by this configuration?
As for updates.. if we use the Fuseki command line s-post tool this also appears to work but only if we specify the graph name to update as a parameter (i.e. the named graph URI and not "default") so I guess this is somehow modifying the underlying update? As we have written our own Fuseki client to use the SPARQL protocol it seems we need to modify the updates that go through here to include WITH.. but we will bite the bullet as you suggest :) Cheers Rob On Wed, Jul 30, 2014 at 6:12 PM, Andy Seaborne <[email protected]> wrote: > On 30/07/14 16:10, Rob Walpole wrote: > >> Hi Andy, >> >> >> What's the problem with using WITH? >>> >> >> >> The problem is that we are want to switch our default dataset from one >> using a single unnamed graph as the default graph to one using two named >> graphs as the default graph. We have figured out how to do the data part >> of >> the switch but we already have a lot of SPARQL update queries in various >> places which we wanted to avoid having to modify. >> > > I'd bite the bullet and change them -- it's style thing but hacking the > protocol to effectively modify operation makes for long-term confusion > where someone maintaining one of those updates isn't aware of the layer > that modifies the operation via the protocol. > > Doing updates really does presume knowing the physical dataset. Your > updates using USING were successfully changing the (empty!) default graph. > > > I was hoping that the >> using-named-graph-uri query parameter would just do this - but I >> understand >> from your explanation and re-reading the spec that it only affects the >> WHERE clause. This seems slightly odd as the spec implies to me it is an >> alternative to WITH... >> >> """ >> The RDF Dataset for an update operation may be specified either in the >> operation string itself using the USING,USING NAMED, and/or WITH keywords, >> or it may be specified via the using-graph-uri and using-named-graph-uri >> parameters. >> >> """ >> >> ..but I guess it just cannot be used with a WITH. >> > > USING etc behaves like FROM -- in TDB, that means pick out of the dataset > but in a different implementation it may be pick off the web. WITH always > picks from the dataset -- it is syntactic sugar for teh 2*GRAPH form. > > WITH is a different mechanism - it does specify a dataset for the update, > one where the default graph is different for both access (WHERE) and change > (DELETE, INSERT). > > But WITH is not a form of USING - each has it's own use and they are > different. > > What's sort of missing is a protocol argument "with-graph-uri". > > Andy > > > >> Cheers >> Rob >> >> > -- Rob Walpole Email [email protected] Tel. +44 (0)7969 869881 Skype: RobertWalpolehttp://www.linkedin.com/in/robwalpole
