问题
I'm working on a project and i need a triple-store database in cloud, which support SPARQL queries.
GraphDB looks good and works fine in my desktop computer (localhost). But, when I try to use it in the cloud (CloudDB), REST requisitions doesn't work.
Problem: I'm trying to query my repository using REST, by
curl -X GET --header 'Accept: application/sparql-results+xml'
.Repository ID:
hermesiot
Query:
select * where {?s ?p ?o .} limit 100
Results:
Response Code:
404
Response Body:
{"message":"Database not found."}
How to deploy GraphDB in cloud solutions, like Azure or another free solutions?
Many thanks :)
回答1:
According to the official example, your query should be of this kind:
curl --header 'Accept: application/sparql-results+xml' \
--data "query=SELECT+*+{?s+?p+?o.}" \
--user s472kd733007:bhrfk1aa8o0qlj7 \
'https://rdf.s4.ontotext.com/4032537848/wikidata/repositories/fast'
However, the query above does not work for me, whereas the query below does:
curl --header 'Accept: application/sparql-results+xml' \
--data "query=SELECT+*+{?s+?p+?o.}" \
--user s472kd733007:bhrfk1aa8o0qlj7 \
'http://awseb-e-m-awsebloa-11laimnu18r2i-2106042490.eu-west-1.elb.amazonaws.com/4032537848/wikidata/repositories/fast'
In the queries above:
s472kd733007
— API key,bhrfk1aa8o0qlj7
— API key secret,4032537848
— user idwikidata
— database name,fast
— repository id,http://awseb-e-m-awsebloa-...eu-west-1.elb.amazonaws.com
— AWS instance address.
Visit tabs in your dashboard in order to obtain applicable values of these parameters.
As for update queries, see e. g. this answer. Your query should be:
curl --header 'Accept: application/sparql-results+xml' \
--data "update=INSERT+DATA+{owl:Nothing+owl:Nothing+owl:Nothing}" \
--user s472kd733007:bhrfk1aa8o0qlj7 \
'http://awseb-e-m-awsebloa-11laimnu18r2i-2106042490.eu-west-1.elb.amazonaws.com/4032537848/wikidata/repositories/fast/statements'
Please note that endpoint address in this request is different.
来源:https://stackoverflow.com/questions/46312393/questions-about-cloud-graphdb