Closed muratseyhan closed 8 years ago
On closer inspection, I'm not actually able to repeat this. Using the same SPARQL request as pasted above:
tjohnson@claude:~$ curl -v --request PATCH -d @sparql-patch.txt http:/tent-Type:application/sparql-update"
* Trying ::1...
* Connected to localhost (::1) port 4567 (#0)
> PATCH / HTTP/1.1
> Host: localhost:4567
> User-Agent: curl/7.48.0
> Accept: */*
> Content-Type:application/sparql-update
> Content-Length: 125
>
* upload completely sent off: 125 out of 125 bytes
< HTTP/1.1 200 OK
< Content-Type: text/turtle
< Link: <http://www.w3.org/ns/ldp#Resource>;rel="type",<http://www.w3.org/ns/ldp#RDFSource>;rel="type",<http://www.w3.org/ns/ldp#BasicContainer>;rel="type"
< Allow: GET, POST, PUT, DELETE, PATCH, OPTIONS, HEAD
< Accept-Post: application/n-triples, text/plain, application/n-quads, text/x-nquads, application/ld+json, application/x-ld+json, application/rdf+json, text/html, application/xhtml+xml, image/svg+xml, text/n3, text/rdf+n3, application/rdf+n3, text/turtle, text/rdf+turtle, application/turtle, application/x-turtle, application/rdf+xml, text/csv, text/tab-separated-values, application/csvm+json, application/trig, application/x-trig, application/trix
< Accept-Patch: text/ldpatch,application/sparql-update
< Etag: W/"2016-06-26T16:27:51.814496814+00:00"
< Last-Modified: Sun, 26 Jun 2016 16:27:51 GMT
< Vary: Accept
< X-Content-Type-Options: nosniff
< Server: WEBrick/1.3.1 (Ruby/2.3.1/2016-04-26)
< Date: Sun, 26 Jun 2016 16:27:51 GMT
< Content-Length: 167
< Connection: Keep-Alive
<
@prefix dc11: <http://purl.org/dc/elements/1.1/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
<http://example/egbook> dc11:title "This is an example title" .
* Connection #0 to host localhost left intact
Are you able to cook up a failing test?
In the meanwhile, I'm going to work on the Rack::Lint
ticket (#58), in hopes that will surface the problem.
I think I have this fixed thoroughly in #59. Thanks for the issue report!
I'll get a release with the changes out later today.
Thanks for your quick reaction! I will check out the fix. I wonder why we got different behavior.
patch
methods inRDFSource
andContainer
pass aRack::Lint::InputWrapper
object to eitherLD::Patch.parse
orSPARQL.execute
depending on the Content-Type. These methods don't supportRack::Lint::InputWrapper
, and both fail to execute the valid queries properly.LD Patch requests have no effect on the resource graph (while they should), and SPARQL Update requests cause the following error.
Where
/home/user/example_patch_sparql.txt
has the following content:Simply passing
env['rack.input'].read
instead ofenv['rack.input']
seems to resolve the issue, since both methods support strings.