I'm trying to issue a complicated query against a fuseki server that I'm running locally through a browser but it keeps crashing- is it possible to do it through a python script? If so- how?
Asked
Active
Viewed 3,529 times
4
-
3What keeps crashing -- fuseki or your browser? Why do you think python will be a better choice? What have you tried along the python path? – TallTed May 18 '16 at 01:59
-
Likely also worth trying a different browser or two... – TallTed May 18 '16 at 18:52
2 Answers
8
You can use any suitable command line tool, for example curl
:
curl http://localhost:3030/your_service/sparql --data 'query=ASK { ?s ?p ?o . }'
If you want to use Python specifically, you can use SPARQLWrapper, or just the Requests package.
Example using Requests:
import requests
response = requests.post('http://localhost:3030/your_service/sparql',
data={'query': 'ASK { ?s ?p ?o . }'})
print(response.json())

evsheino
- 2,147
- 18
- 20
0
./s-query --service=http://localhost:3030/myDataset/query --query=/home/matthias/EIS/EDSA/27/18.05/queryFile.rq
With the above command it can also work.
Follow the ideas from the SOH - SPARQL over HTTP page, i.e.
SOH SPARQL Query
s-query --service=endpointURL 'query string'
s-query --service=endpointURL --query=queryFile.rq

smatthewenglish
- 2,831
- 4
- 36
- 72