You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Exception has occurred: CLR/VDS.RDF.Parsing.RdfParseException
Exception thrown: 'VDS.RDF.Parsing.RdfParseException' in dotNetRDF.dll: '[Line 4 Column 40 to Line 7 Column 44] Unexpected Token 'Date' encountered, expected a Property Value describing one of the properties of an Object Node'
at VDS.RDF.Parsing.RdfJsonParser.Error(JsonParserContext context, String message, PositionInfo startPos)
at VDS.RDF.Parsing.RdfJsonParser.ParseObject(JsonParserContext context, INode subj, INode pred)
at VDS.RDF.Parsing.RdfJsonParser.ParseObjectList(JsonParserContext context, INode subj, INode pred)
at VDS.RDF.Parsing.RdfJsonParser.ParsePredicateObjectList(JsonParserContext context, INode subj)
at VDS.RDF.Parsing.RdfJsonParser.ParseTriples(JsonParserContext context)
at VDS.RDF.Parsing.RdfJsonParser.ParseGraphObject(JsonParserContext context)
at VDS.RDF.Parsing.RdfJsonParser.Parse(IRdfHandler handler, TextReader input)
at VDS.RDF.Parsing.RdfJsonParser.Load(IRdfHandler handler, TextReader input)
at VDS.RDF.Parsing.StringParser.Parse(IGraph g, String data, IRdfReader reader)
This appears to be because the underlying Newtonsoft.JSON parser has converted the ISO 8601 date string in the value property into a C# Date object, and our RdfJsonParser only expects string values.
This behaviour of the Newstonsoft parser can be disabled via the DateParseHandling property on the parser (by setting the property value to DateParseHandling.None).
This PR disables the default date/time string parsing in Newtonsoft JsonTextReader. This is done in the constructor for CommentIgnoringJsonTextReader (which is shared by both the RDF/JSON parser and the SPARQL JSON parser.
Closes#130
The RdfJsonParser class does not properly handle the case of a literal string that is formatted as an ISO 8601 date/time string. This code:
Leads to the following exception:
This appears to be because the underlying Newtonsoft.JSON parser has converted the ISO 8601 date string in the
value
property into a C#Date
object, and our RdfJsonParser only expects string values.This behaviour of the Newstonsoft parser can be disabled via the
DateParseHandling
property on the parser (by setting the property value toDateParseHandling.None
).Originally reported via this SO question
The text was updated successfully, but these errors were encountered: