What is the SPARQL query to check if a graph exists and return a message?

荒凉一梦 提交于 2019-12-11 07:46:41

问题


I want to check if the graph exists in my Fuseki server and if it does, it should return a message like

The graph exists


回答1:


You can do this with an ASK query. For example, to check that a named graph http://example.org/graph1 exists, you can do this:

ASK WHERE { GRAPH <http://example.org/graph1> { ?s ?p ?o } }

It will return true if it exists, false otherwise.



来源:https://stackoverflow.com/questions/27080839/what-is-the-sparql-query-to-check-if-a-graph-exists-and-return-a-message

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