History | Log In     View a printable version of the current page. Get help!  
Issue Details [XML]

Key: SES-858
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Jeen Broekstra
Reporter: Johann Petrak
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Sesame

Transaction XML parser drops newlines at end of literal

Created: 14/Oct/11 04:06 PM   Updated: 11/Nov/11 04:56 AM
Component/s: HTTP Server, HTTPRepository
Affects Version/s: 2.5.1
Fix Version/s: 2.6.1

File Attachments: 1. Zip Archive sesame_bug_nl.zip (2.21 Mb)

Environment: Ubuntu Linux 11.04 32 bit, java 1.6.0_22
Issue Links:
Followup
 
This issue is followed up by:
SES-879 Rio RDF/XML writer/parser round-trip ... Major Open
Related
This issue is related to:
SES-539 XML Literal normalization Minor Closed
 


 Description   
When a string literal ends with a newline, the newline is dropped when a triple with that literal is added to a remote repository using connection.add. Also, the newline seems to get dropped for the connection.remove method.

The effect is that for a remote repository, 1) literals that end with a newline loose that newline character when added with connection.add 2) literal that already have a newline at the end cannot be removed using connection.remove.



 All   Comments   Change History      Sort Order:
Comment by Johann Petrak [14/Oct/11 04:35 PM]
A directory with a minimal testcase illustrating the bug.

Unzip and modify build.xml: adapt the arguments of the java "runserver" task to point to a server and existing repository the content of which can be deleted.

"ant runlocal": this will show that all literals are correctly stored, found and removed.

"ant runserver": this will show that the literal added from the program has its trailing newline stripped and that it is impossible to remove a literal with a trialing newline from the repository.

Comment by Jeen Broekstra [31/Oct/11 01:01 AM]
This seems to be an issue with either the RDF parser or writer used to (de)serialize the result, as it does not occur when using a local repository. I have ran a few tests and at first glance it seems specific to the RDF/XML parser, which is odd, because that format should (by default) not be used when communicating between client and server.

Comment by Jeen Broekstra [31/Oct/11 02:52 AM]
Issue seems to be caused by the underlying SAX parser that is used both by the Rio RDF/XML parser and by the transaction XML format reader/writer. The latter is what causes the problem observed by Johann. I haven't quite figured out _why_ but it seems it automatically removes a (trailing) newline.

Comment by Jeen Broekstra [11/Nov/11 04:45 AM]
Updated this to a problem specific to the Transactional XML parser (the fact that the RDF/XML parser also trims newlines is not actually a bug, AFAICT).

The problem occurs because the SimpleSAXParser used by the Transactional XML parser trims whitespaces (which includes newlines) when receiving a transaction document from the client.

Comment by Jeen Broekstra [11/Nov/11 04:56 AM]
Issue in TransactionReader (and therefore specific issue in handling of Repositoryconnection.add and remove over HTTP) is fixed. Created a followup issue for a similar problem in the RDF/XML parser/writer (which does not directly affect the HTTPRepositoryConnection, so is not as urgent).