From: Peter K. <pk...@ka...> - 2014-12-10 04:06:02
|
Hi Folks, In playing around testing against WinRT/WP 8.1 (CORE-429 ), I’ve found what I think is a bug somewhere in the portable version of the TriXWriter/Parser stack (or possibly in the SPARQL engine), but I don’t really know where to go poking to fix it. I’m querying against a TripleStore with two named graphs. This works fine, but when calling “new LeviathanQueryProcessor(myTripleStore)”, a new default graph (with a null Uri) is added to the store. Then, when I go to save the store using TriXWriter, it writes “<graph />” as the third graph element. This seems to be correct behavior to me, or at least potentially correct. Unfortunately, when I go to load the file, I see: VDS.RDF.Parsing.RdfParseException was unhandled by user code HResult=-2146233088 Message=[Source XML] Unexpected </TriX> encountered, either <triple> elements or a </graph> was expected Source=dotNetRDF EndLine=-1 EndPosition=-1 HasPositionInformation=false StartLine=-1 StartPosition=-1 StackTrace: at VDS.RDF.Parsing.TriXParser.TryParseGraph(XmlReader reader, IRdfHandler handler) at VDS.RDF.Parsing.TriXParser.TryParseGraphset(XmlReader reader, IRdfHandler handler) at VDS.RDF.Parsing.TriXParser.Load(IRdfHandler handler, TextReader input) at VDS.RDF.Parsing.TriXParser.Load(ITripleStore store, TextReader input) at TripleNote.Store.<LoadStore>d__14.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() at TripleNote.Store.<test>d__0.MoveNext() InnerException: I’m guessing this is where the problem lies, and that the correct behavior is to check if we’ve got a blank element in the TriXParser.TryParseGraph. The questions are: 1. Should LeviathanQueryProcessor add a default graph to the TripleStore? 2. Should an empty graph be written by the TriXWriter? 3. Should an empty graph be accepted by the TriXParser? I think yes. 4. If so, should it result in an empty graph in the TripleStore? This would require a change to IRdfHandler to handle this case. Incidentally, while I’m not testing it in any organized manner, all of this is working in WinRT and WP8.1 WinRT apps (a universal app, actually), including reading, writing, querying, and asserting triples. Peter Sent from Windows Mail |