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

Key: SES-917
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Jeen Broekstra
Reporter: Luciano Blasetti
Votes: 0
Watchers: 0
Operations

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

Predicates having the word "database" cause an exception evaulating a query

Created: 20/Jan/12 11:22 PM   Updated: 01/Feb/12 12:23 AM
Component/s: Web interface
Affects Version/s: 2.6.2
Fix Version/s: 2.6.4

Environment: JBoss AS 7.1
Issue Links:
Duplicate
 
This issue is duplicated by:
SES-918 Predicates having the word "database"... Major Resolved
SES-922 CLONE -Predicates having the word "da... Major Resolved


 Description   
Start with a clean installation, create a repository (also a simple in-memory one) and add the following simple turtle (from openrdf-workbench):
@prefix myns: <http://mysite/property/> .
<http://mysite/uri/914196a6-e878-41ca-9aa2-5a0ac1f8ab93>
      a myns:ResourceType ;
      myns:collection <http:/mysite/collections/collection1> ;
      myns:database <http:/mysite/databases/database1> .

Now try to execute, from the openrdf-workbench, the sparql query:

PREFIX myns:<http://mysite/property/>
select * where {?s myns:database <http:/mysite/databases/database1>. }

You'll obtain a: javax.servlet.ServletException: org.openrdf.repository.http.HTTPQueryEvaluationException: Server responded with an unsupported file format: application/sparql-results+xml....

If you try renaming the property 'database' to 'db' or whatever, or if run a query specifying the other predicate used in the example (collection) all works fine.



 All   Comments   Change History      Sort Order:
Comment by Jeen Broekstra [31/Jan/12 09:38 PM]
Fixed in SVN. Fix will be available in next Sesame release.

Comment by Jeen Broekstra [31/Jan/12 08:40 PM]
Turns out the code from QueryParserUtil.removeSPARQLQueryProlog is duplicated in the HTTPRepositoryConnection class: it has its own private method that performs the same task (and thus has the same regex bug).

Comment by Jeen Broekstra [31/Jan/12 08:38 PM]
Turns out the fix was only half the problem. My bad for not testing the actual workbench.

root cause

org.openrdf.repository.RepositoryException: Server responded with an unsupported file format: application/sparql-results+xml
org.openrdf.http.client.HTTPClient.getRDF(HTTPClient.java:1166)
org.openrdf.http.client.HTTPClient.sendGraphQuery(HTTPClient.java:517)
org.openrdf.http.client.HTTPClient.sendGraphQuery(HTTPClient.java:492)
org.openrdf.repository.http.HTTPGraphQuery.evaluate(HTTPGraphQuery.java:41)
org.openrdf.workbench.commands.QueryServlet.evaluateGraphQuery(QueryServlet.java:231)
org.openrdf.workbench.commands.QueryServlet.service(QueryServlet.java:152)

Comment by Luciano Blasetti [30/Jan/12 02:50 PM]
Hi Jeen,
the problem seems to not be solved. I've just tested the versione 2.6.3 and it continues throwing a "Server responded with an unsupported file format: application/sparql-results+xml"

Comment by Jeen Broekstra [23/Jan/12 01:44 AM]
Issue is caused by a bug in the regular expression that strips off the base declaration, in QueryParserUtil.removeSPARQLQueryProlog. Regex is too greedy, matching with everything in the query ending with "base>". This causes the query parser to throw an error.

Comment by Jeen Broekstra [21/Jan/12 08:24 AM]
Confirmed, and is not specific to JBoss, also happens in Tomcat 6.0.