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
It is a valid string serialization of a javascript object and as such usable with javascript's JSON.parse(). Specifically, it is a serialization of the object
{text: 'Hello "world"!'}
As a regular string, the serialization is also a valid value for a TextualBody of a web annotation. Using the wap-servers webapp, we can easily create the following annotation:
As we can see, the value of the TextualBody has changed. Every instance of " is now only escaped once. Incidentally, this also means that the string is no longer a valid JSON serialization.
Let's instead use SPARQL to query the same annotation:
So we can see that the correct, unchanged string is still available in the triple store. However, accessing it via HTTP modifies the string, breaking the escaping in the process.
Similarly, string escaping is broken when an annotation contains escaped newlines. I would imagine that every kind of escaping is liable to be affected, but " and \n are the ones we are encountering in practice.
Expected behavior
String values should get retrieved without modification.
Thanks for your consideration. Please let me know if you need more details.
The text was updated successfully, but these errors were encountered:
Current behavior
Consider a string as the following:
"{\"text\":\"Hello \\\"world\\\"!\"}"
It is a valid string serialization of a javascript object and as such usable with javascript's
JSON.parse()
. Specifically, it is a serialization of the objectAs a regular string, the serialization is also a valid
value
for aTextualBody
of a web annotation. Using the wap-servers webapp, we can easily create the following annotation:Let us assume the resulting annotation has the URI "http://localhost:8889/wap/TestContainer/a218953d-192b-4074-96d2-be3f33d07ec2". Accessing it in the browser (and choosing "raw" output) yields the following:
As we can see, the value of the TextualBody has changed. Every instance of
"
is now only escaped once. Incidentally, this also means that the string is no longer a valid JSON serialization.Let's instead use SPARQL to query the same annotation:
Store the above query as
query.sparql
and use e.g.The result is
So we can see that the correct, unchanged string is still available in the triple store. However, accessing it via HTTP modifies the string, breaking the escaping in the process.
Similarly, string escaping is broken when an annotation contains escaped newlines. I would imagine that every kind of escaping is liable to be affected, but
"
and\n
are the ones we are encountering in practice.Expected behavior
String values should get retrieved without modification.
Thanks for your consideration. Please let me know if you need more details.
The text was updated successfully, but these errors were encountered: