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

Key: SES-980
Type: Bug Bug
Status: Resolved Resolved
Resolution: Won't Fix
Priority: Major Major
Assignee: Jeen Broekstra
Reporter: Paul Hermans
Votes: 0
Watchers: 0
Operations

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

CLONE -'+' char gets lost in CONSTRUCT Query

Created: 15/Apr/12 04:31 PM   Updated: 01/May/12 10:00 PM
Component/s: SPARQL
Affects Version/s: 2.6.5, 2.6.3, 2.6.4
Fix Version/s: 2.6.6

Issue Links:
Followup
This issue is followup of:
SES-924 '+' char gets lost in CONSTRUCT Query Major Resolved
 


 Description   
CONSTRUCT query containing:
CONSTRUCT {
    <http://standaarden.overheid.nl/owms/terms/OWMSdataset> <http://rdfs.org/ns/void#Feature> _:b0 .
    _:b0 dcterms:format "text/rdf+n3" .
    <http://standaarden.overheid.nl/owms/terms/OWMSdataset> <http://rdfs.org/ns/void#Feature> _:b1 .
    _:b1 dcterms:format "application/rdf+xml" .....}

OUTPUT:
<rdf:Description rdf:nodeID="node16le471qqx1">
<dcterms:format>text/rdf n3</dcterms:format>
</rdf:Description>
<rdf:Description rdf:nodeID="node16le471qqx2">
<dcterms:format>application/rdf xml</dcterms:format>
</rdf:Description>

WHERE the '+' has been lost.

 All   Comments   Change History      Sort Order:
Comment by Paul Hermans [15/Apr/12 04:38 PM]
I still have this issue with version 2.6.5

Doing a HTTP POST against http://localhost:8080/openrdf-sesame/repositories/OWMS
with CONSTRUCT query.

+ is lost
Response from curl, missing "+" indicated with <--------

{
overheid:OWMSdataset a void:Dataset ;
dcterms:creator overheid:ICTU ;
dcterms:description "De dataset van de Nederlandse overheid"@nl ;
dcterms:license <http://www.gnu.org/copuleft/fdl.html> ;
dcterms:title "OWMS dataset" ;
void:Feature _:node16qqueel9x25 .

_:node16qqueel9x25 dcterms:format "text/rdf n3" . <---------

overheid:OWMSdataset void:Feature _:node16qqueel9x26 .

_:node16qqueel9x26 dcterms:format "application/rdf xml" . <--------

overheid:OWMSdataset void:exampleResource <http://standaarden.overheid.nl/owms/terms/Schiermonnikoog_(gemeente)> , overheid:omgevingsvergunning , overheid:ROM_Rijnmond ;
void:statItem _:node16qqueel9x27 .

_:node16qqueel9x27 rdf:value "6471"^^xsd:integer ;
scovo:dimension void:numberOfResources , dcterms:Agent .

overheid:OWMSdataset void:statItem _:node16qqueel9x32 .

_:node16qqueel9x32 rdf:value "3500"^^xsd:integer ;
scovo:dimension void:numberOfResources , skos:Concept .

overheid:OWMSdataset void:statItem _:node16qqueel9x31 .

_:node16qqueel9x31 rdf:value "3912"^^xsd:integer ;
scovo:dimension void:numberOfResources , dcterms:Location .

overheid:OWMSdataset void:statItem _:node16qqueel9x30 .

_:node16qqueel9x30 rdf:value "42527"^^xsd:integer ;
scovo:dimension void:numberOfTriples .

overheid:OWMSdataset void:statItem _:node16qqueel9x29 .

_:node16qqueel9x29 rdf:value "4550"^^xsd:integer ;
scovo:dimension void:numberOfDistinctSubjects .

overheid:OWMSdataset void:statItem _:node16qqueel9x28 .

_:node16qqueel9x28 rdf:value "6240"^^xsd:integer ;
scovo:dimension void:numberOfDistinctObjects .

overheid:OWMSdataset void:uriRegexPattern "http://standaarden.overheid.nl/owms/terms/. " ; <---------------
void:vocabulary <http://www.w3.org/2008/05/skos-xl#> , <http://www.w3.org/1999/02/22-rdf-syntax-ns#> , <http://www.w3.org/2000/01/rdf-schema#> , <http://xmlns.com/foaf/0.1/> , <http://www.w3.org/2004/02/skos/core#> , <http://purl.org/dc/terms/> , <http://www.w3.org/2001/XMLSchema#> , <http://standaarden.overheid.nl/owms/terms/> , <http://www.w3.org/2002/07/owl#> .
}

Same happens in REST Client for Firefox, HTTP Client, cREst for Chrome

Comment by Jeen Broekstra [17/Apr/12 05:14 AM]
Thanks for additional details, will take another look at this ASAP.

Comment by Jeen Broekstra [30/Apr/12 07:28 AM]
This is not a bug in Sesame, but a mistake in the way the client sends the data to Sesame.

From your comments, I see you are using curl to send the query to Sesame, so I assume you do something like this:

curl -d "query=CONSTRUCT {?X ?P ?Y ; <foo:bar> \"text/rdf+n3\" } WHERE {?X ?P ?Y}" http://localhost:8080/openrdf-sesame/repositories/test

However, the server expects the post-data to be urlencoded, otherwise the + character (which is a special character) is not preserved when sent to the server. This can be achieved (in curl) by using the --data-urlencoded switch instead:

curl --data-urlencode "query=CONSTRUCT {?X ?P ?Y ; <foo:bar> \"text/rdf+n3\" } WHERE {?X ?P ?Y}" http://localhost:8080/openrdf-sesame/repositories/test

Alternatively, you can of course urlencode the problematic characters manually:

curl -d "query=CONSTRUCT {?X ?P ?Y ; <foo:bar> \"text/rdf%2Bn3\" } WHERE {?X ?P ?Y}" http://localhost:8080/openrdf-sesame/repositories/test

See the <a href="http://curl.haxx.se/docs/manpage.html#--data-urlencode">curl manual page</a> for more info.

Comment by Jeen Broekstra [30/Apr/12 07:36 AM]
Reopening because I need to doublecheck that the problem doesn't occur when using sesame's own http client directly.

Comment by Jeen Broekstra [30/Apr/12 10:00 AM]
Confirmed that Sesame HTTP client (and Sesame console and workbench) handle this correctly as well.

Comment by Paul Hermans [01/May/12 10:47 AM]
Yes indeed.
My own fault. Mea culpa.
Apologies for having posted this.

Comment by Jeen Broekstra [01/May/12 10:00 PM]
No problem, glad we got it sorted :)