Questions about Cloud + GraphDB

淺唱寂寞╮ 提交于 2019-12-10 22:58:39

问题


I'm working on a project and i need a triple-store database in cloud, which support SPARQL queries.

  1. 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."}

  2. 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 id
  • wikidata — 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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!