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

Key: SES-800
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Jeen Broekstra
Reporter: Konstantin Pentchev
Votes: 0
Watchers: 0
Operations

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

Unimplemented/Unsupported method prepareQuery in org.openrdf.repository.http.HTTPRepositoryConnection

Created: 20/Jul/11 03:01 PM   Updated: 24/Aug/11 09:07 AM
Component/s: HTTPRepository
Affects Version/s: 2.4.2
Fix Version/s: 2.5.0


 Description   
Method prepareQuery in HTTPRepositoryConnection throws UnsupportedOperationException()
causes problem when connecting to a HTTPRepository, which itself is using a remote repository as store

 All   Comments   Change History      Sort Order:
Comment by Jeen Broekstra [20/Jul/11 10:51 PM]
This is actually not a new problem in Sesame 2.4, but has always been implemented (or rather, not implemented) this way.

prepareQuery is listed as an optional operation in the API, and in the HTTPRepository it's not implemented for performance-reasons: supporting this method requires determining the query type on the client side, which implies a parsing step. Not only is that expensive, but HTTPRepository currently has no dependency on the SPARQL parser.

I guess we might be able to implement this using a regular expression though. Need to have a think about it.




Change by Jeen Broekstra [21/Jul/11 12:00 AM]
Field Original Value New Value
Assignee Arjohn Kampman [ arjohn ] Jeen Broekstra [ jeen ]

Comment by Jeen Broekstra [21/Jul/11 12:36 AM]
I have checked in an implementation for this method in HTTPRepositoryConnection, using regular expressions and some other string manipulation tricks, but I am not convinced it's foolproof (even though it passes a few unit tests I came up with), and it's probably not very efficient. I have updated the javadoc to stress that the preferred way of preparing queries is still to use the more specific prepareTuple/Boolean/GraphQuery methods.

Change by Jeen Broekstra [21/Jul/11 12:36 AM]
Field Original Value New Value
Fix Version/s 2.4.3 [ 10580 ]

Change by Jeen Broekstra [21/Jul/11 12:36 AM]
Field Original Value New Value
Status Open [ 1 ] In Progress [ 3 ]

Comment by Jeen Broekstra [21/Jul/11 12:37 AM]
I would like some feedback from people on this fix before I mark it resolved.

Change by Jeen Broekstra [03/Aug/11 11:58 PM]
Field Original Value New Value
Status In Progress [ 3 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]

Change by Arjohn Kampman [24/Aug/11 09:07 AM]
Field Original Value New Value
Fix Version/s 2.5.0 [ 10550 ]
Fix Version/s 2.4.3 [ 10580 ]