Open namedgraph opened 1 year ago
What’s your python version?On Aug 6, 2023, at 4:39 PM, Martynas Jusevičius @.***> wrote:
Just installed awscurl on EC2 (Ubuntu) and trying to access the Neptune DB endpoint, but
awscurl 'https://xxxxxxxxxxxcluster.cluster-ro-cnol6sn9sq5j.us-east-1.neptune.amazonaws.com:8182/sparql' \
-X POST \
--data-binary \
-d 'query=ASK {}' \
--region us-east-1 \
--service neptune-db
this gives me an error:
Traceback (most recent call last):
File "/home/ubuntu/.local/bin/awscurl", line 8, in
Am I missing something? :) Also, is intentional that the --data-binary option does not take an argument? Because it does in plain curl.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>
$ python3 --version
Python 3.10.12
Interesting Btw, why are using binary, your example has a readable string (in the -d parameter)?On Aug 6, 2023, at 4:39 PM, Martynas Jusevičius @.***> wrote:
Just installed awscurl on EC2 (Ubuntu) and trying to access the Neptune DB endpoint, but
awscurl 'https://xxxxxxxxxxxcluster.cluster-ro-cnol6sn9sq5j.us-east-1.neptune.amazonaws.com:8182/sparql' \
-X POST \
--data-binary \
-d 'query=ASK {}' \
--region us-east-1 \
--service neptune-db
this gives me an error:
Traceback (most recent call last):
File "/home/ubuntu/.local/bin/awscurl", line 8, in
Am I missing something? :) Also, is intentional that the --data-binary option does not take an argument? Because it does in plain curl.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>
I was just following the examples from Using RDF and SPARQL to access the graph in Amazon Neptune and replacing curl
with awscurl
:)
If I remove the --data-binary
arg
awscurl 'https://octopustriplestorecluster.cluster-ro-cnol6sn9sq5j.us-east-1.neptune.amazonaws.com:8182/sparql' \
-X POST \
-d 'query=ASK {}' \
--region us-east-1 \
--service neptune-db
I get a Neptune error:
{"requestId":"2ec4e671-f734-5519-03fd-6971f5229051","detailedMessage":"Missing 'query' or 'update' parameter for POST request","code":"MissingParameterException"}
Hmm, I’d have to try that. Meantime could you check if this is your issue, and see if workaround in the end works for you:How to escape AMP query parameter right? · Issue #169 · okigan/awscurlgithub.comOn Aug 6, 2023, at 5:08 PM, Martynas Jusevičius @.***> wrote: I was just following the examples from Using RDF and SPARQL to access the graph in Amazon Neptune and replacing curl with awscurl :) If I remove the --data-binary arg awscurl 'https://octopustriplestorecluster.cluster-ro-cnol6sn9sq5j.us-east-1.neptune.amazonaws.com:8182/sparql' \ -X POST \ -d 'query=ASK {}' \ --region us-east-1 \ --service neptune-db I get a Neptune error: {"requestId":"2ec4e671-f734-5519-03fd-6971f5229051","detailedMessage":"Missing 'query' or 'update' parameter for POST request","code":"MissingParameterException"}
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>
This works!
awscurl 'https://xxxxxxxxxxxxcluster.cluster-ro-cnol6sn9sq5j.us-east-1.neptune.amazonaws.com:8182/sparql' \
-X POST \
-d 'query=ASK {}' \
--region us-east-1 \
--service neptune-db \
--header 'Content-Type: application/x-www-form-urlencoded'
@okigan what about --data-binary
? Why does it differ from plain curl?
The following works for me for to send a CONSTRUCT query and requesting response as N-Triples (using URL from your example for consistency):
awscurl "https://xxxxxxxxxxxxcluster.cluster-ro-cnol6sn9sq5j.us-east-1.neptune.amazonaws.com:8182/sparql" \
--service neptune-db \
--data @query.rq \
-H "Content-Type: application/sparql-query" \
-H "Accept: application/n-triples"
Note that with query via POST with URL-encoded parameters the content type header of the HTTP request must be set to application/x-www-form-urlencoded
. Perhaps awscurl does not automatically add that header using -d
and --data
, you could run in verbose mode to check that.
Just installed
awscurl
on EC2 (Ubuntu) and trying to access the Neptune DB endpoint, butthis gives me an error:
Am I missing something? :)
Also, is intentional that the
--data-binary
option does not take an argument? Because it does in plain curl.