From: Rob V. <rv...@do...> - 2010-02-12 13:13:09
|
Hi Yes you need some escapes of specific escapable characters as well as escaping backslashes. I've added your test case to my unit tests and it appears to work fine. I will add in the overload of the constructor you wanted, one thing to be aware of is that I'm having a lot of issues with Virtuoso support at the moment which I am attempting to get fixed with the help of the people at OpenLink so currently the Virtuoso support in the library in the repository is partially broken. Thanks, Rob From: Aleksandr A. Zaripov [mailto:za...@tp...] Sent: 12 February 2010 12:33 To: Rob Vesse Subject: HA: [dotNetRDF-bugs] Chars escaping bug Hi After some experiments I understand, that the value.Replace("\\", "\\\\"); is not correct solution because it don't cover case with \". But the first solution works fine. So, I attach example ontology, which should not be successfully inserted without this fixes: if (value.Contains("\"")) value = value.Replace("\"", "\\\""); if (value.Contains("\n")) value = value.Replace("\n", "\\n"); if (value.Contains("\r")) value = value.Replace("\r", "\\r"); if (value.Contains("\t")) value = value.Replace("\t", "\\t"); p.s. Could you overload the constructor VirtuosoManager(String connectionString). A need to specify some parameters except of server, port, user, etc. С уважением, Зарипов Александр za...@tp... -----Исходное сообщение----- От: Rob Vesse [mailto:rv...@do...] Отправлено: Пт, 12.02.2010 15:33 Кому: 'dotNetRDF Bug Report tracking and resolution' Копия: Aleksandr A. Zaripov Тема: RE: [dotNetRDF-bugs] Chars escaping bug Hi Aleksandr You are probably right about that, do you have some test cases I can use to confirm that your fix works as expected? Thanks, Rob Vesse From: Aleksandr A. Zaripov [mailto:za...@tp...] Sent: 12 February 2010 08:00 To: dot...@li... Subject: [dotNetRDF-bugs] Chars escaping bug Hello There are bug with literal nodes, which contain multiline strings (eg. "\r\n"). The code in BaseWriterContext class (lines 391-394) does not works correctly. The string if (value.Contains("\\n")) value = value.Replace("\\n", "\\\\n"); should be if (value.Contains("\"")) value = value.Replace("\"", "\\\""); but I think that the more universal solution is value.Replace("\\", "\\\\"); С уважением, Зарипов Александр za...@tp... |