Skip to content

Instantly share code, notes, and snippets.

@rvesse
Created December 18, 2013 09:38
Show Gist options
  • Save rvesse/8019694 to your computer and use it in GitHub Desktop.
Save rvesse/8019694 to your computer and use it in GitHub Desktop.
Shows how to use a GenericUpdateProcessor to get approximated SPARQL Updates even if using a version of dotNetRDF/Stardog that does not provide native SPARQL Update support for Stardog. There is no downside to this method since when used with versions of dotNetRDF/Stardog that do provide native SPARQL Update it delegates to that implementation o…
// Assume we already have a StardogConnector in the variable Stardog
// Firstly need to parse our updates
SparqlUpdateCommandSet updates = new SparqlUpdateParser().ParseFromString(@"
INSERT DATA { GRAPH <http://example.org/graph> { <http://s> <http://p> <http://o } }
");
// Then we can create an update processor and execute the updates
GenericUpdateProcessor processor = new GenericUpdateProcessor(stardog);
processor.ProcessCommandSet(updates);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment