kasei / perlrdf

Deprecated in favor of the Attean package
26 stars 25 forks source link

RDF::Endpoint returns something wrong #169

Closed yayamamo closed 4 years ago

yayamamo commented 4 years ago

I use Plack 1.0047 and RDF::Endpont 0.10 on Perl 5.32.0 (macOS Catalina / CentOS7). When launching plackup endpoint.psgi and accessing by curl http://localhost:5000/, I got the following response.

curl: (18) transfer closed with 160 bytes remaining to read (Catalina) curl: (18) transfer closed with 46 bytes remaining to read (CentOS7)

Is this an expected behavior? I assume I get a service description.

kasei commented 4 years ago

This is not expected behavior. I will try to replicate it locally and find out why this is happening.

kasei commented 4 years ago

Ah. So this may just be a case of poor documentation. To get the service description (and to query the endpoint), you should be using http://localhost:5000/sparql, not http://localhost:5000/. Let me know if that resolves your issues and I'll try to update the docs to be more explicit.

yayamamo commented 4 years ago

Thank you for your quick response. Now I can get Service Description, but it seems a request comes to the server twice while I issue it once.

% curl -H 'Accept: application/rdf+xml' -X GET http://localhost:5000/sparql This single command makes the following log at the server.

127.0.0.1 - - [14/Oct/2020:14:07:15 +0900] "GET /sparql HTTP/1.1" 200 6170 "-" "curl/7.64.1"
127.0.0.1 - - [14/Oct/2020:14:07:15 +0900] "GET /sparql HTTP/1.1" 200 6170 "-" "curl/7.64.1"
kasei commented 4 years ago

The example endpoint.psgi file shows how to configure the AccessLog. However, the plackup tool also configures an access log by default. If you intend to use plackup, you can replace the builder { … } block at the end of that file with just $app.

yayamamo commented 4 years ago

Thank you. It works.