If you have control of the HTTP headers being sent, you can simply include Accept: application/sparql-results+json and you'll get the query results in a JSON format. If you do not, Stardog Studio allows you to run a query and then export the results out to a JSON file.