Curl request for sparql export error

I’m trying to run the following command, but I always get the error “The filename, directory name, or volume label syntax is incorrect.”

curl --request POST ‘http://localhost:8890/sparql/?’ --header ‘Accept-Encoding: gzip’ --data ‘format=text/csv’ --data-urlencode ‘query=SELECT ?s ?p ?o FROM http://localhost:8890/pathways WHERE { ?s ?p ?o } LIMIT 500’ --output ‘C:\Users\Sam\Documents\Development\RDFConverter\PATHWAYS.gz’

Any ideas about what is wrong? I’m new to Virtuoso. I can run the SPARQL from the web UI successfully.

From the error message you report he filename, directory name, or volume label syntax is incorrect , it would seem the directory specified in --output is not valid on Windows ie --output ‘C:\Users\Sam\Documents\Development\RDFConverter\PATHWAYS.gz’ as the curl query itself is valid and does return results.

Probably something to do with Window directory delimiter which is not like by curl on Windows. If you just specify the filename does the curl command then run and write to the current directory ?

I had started with just the file name and it caused the same error. Then I tried adding the full path. I’ll experiment some more this afternoon.