From: Nagaraju, I. <Ind...@Ho...> - 2015-04-06 06:59:15
|
Hi, We were using the below shown code to add a graph into Stardog (version 2.2.4). The dotNetRdf version used here is 1.0.6. This was working fine and we were able to add the graph. using (StardogConnector stardogServer = new StardogConnector("http://localhost:5820", databaseName, username, password)) { IGraph graph = new Graph(); graph.BaseUri = new Uri(graphName); var configuration = new StreamReader(@"C:\data\test.ttl").ReadToEnd(); graph.LoadFromString(configuration); // Save to Stardog stardogServer.SaveGraph(graph); } Now we have upgraded Stardog to version 3.0 and tried to use the same code to add the graph. We are getting an error - Unable to save a Named Graph to the Store as this requires deleting any existing Named Graph with this name which failed, see inner exception for more detail. Here are the list of things that we tried to resolve the issue: * Tried with upgrading to latest dotNetRdf available (1.0.8) with no luck in getting this work * Found out that for Stardog 2.2.4 a graph add request was going while for Stardog 3.0 a graph clear request is been sent in both the versions of dotNetRdf (1.0.6 and 1.0.8) Request generated for Stardog 2.2.4: POST http://localhost:5820/testdb/82bbd2f0-5de9-492b-8615-8b5c43269618/add HTTP/1.1 Accept: */* SD-Connection-String: Content-Type: application/x-trig Authorization: Basic YWRtaW46YWRtaW4= Host: localhost:5820 Content-Length: 53102 Expect: 100-continue <http://www.example.com> { ... } Request generated for Stardog 3.0: POST http://localhost.:5820/testdb/34204d26-9209-46f7-b2db-0f901b0fa3e6/clear/?graph-uri=http%3a%2f%2fwww.example.com& HTTP/1.1 Accept: */* SD-Connection-String: Content-Type: application/x-www-form-urlencoded Authorization: Basic YWRtaW46YWRtaW4= Host: localhost.:5820 * Made sure that there is no graph existing already in the database with this name. * Found that this error comes when graph.BaseUri is not null. We forced the BaseUri to be null and tried, this resulted in an add graph request, but received an error - HTTP/1.1 406 Not Acceptable * Same code works fine even now when used with 2.2.4 version of Stardog. * Contacted Stardog team for help and they mentioned that the issue is with the client library that we are using to connect to it (i.e. dotNetRdf). Could you let us know what we are missing here and if this is a defect, could this be part of next version of dotNetRdf? Regards, Indresh |