grlc icon indicating copy to clipboard operation
grlc copied to clipboard

default-graph in endpoint url

Open rapw3k opened this issue 3 years ago • 1 comments

Hi! we need to allow possibility of indicating which graph to use in the query.

As our triplestore is virtuoso, its very easy to say this using "default-graph-uri" parameter as below:

  • https://www.foodie-cloud.org/sparql?default-graph-uri=https://w3id.org/cybele/datasets/

so, for those queries in json format, we add this whole string by default, and if the user wants he can change the graph

"grlc": {
    "summary": "xyz",
    "endpoint": "https://www.foodie-cloud.org/sparql?default-graph-uri=https://w3id.org/cybele/datasets/",
...

and this works fine, e.g., http://grlc.io/api-git/rapw3k/cybele/#/json/get_allDatasetsIDs

However, for queries in sparql format (.rq), this does not seem to work. We use the same whole string by default in the decorator:

#+ endpoint: "https://www.foodie-cloud.org/sparql?default-graph-uri=https://w3id.org/cybele/datasets/"

See for example (use monnit as keyword):

  • http://grlc.io/api-git/rapw3k/cybele/#/json/get_getByKeyword
  • http://grlc.io/api-git/rapw3k/cybele/#/json/get_getByKeyword_test

They are exactly the same, except that the first one uses simple endpoint (no default-graph-uri). When executed the first one returns the result, the second one does not return anything. any idea how we can allow user to specify graph ?

rapw3k avatar Apr 28 '21 10:04 rapw3k

Hi @rapw3k,

I'm trying the example that you mention. From what I can see in debug mode is that the query is being sent to this endpoint:

DEBUG:Sending query to SPARQL endpoint: https://www.foodie-cloud.org/sparql?default-graph-uri=https://w3id.org/cybele/dataset/

Isn't that the expected behaviour? I'm not sure if this is still an issue (I know, it has been open for some time now...). If it is no longer an issue, perhaps we can close it?

c-martinez avatar Sep 23 '21 19:09 c-martinez

Yes, i see now this is fine, thanks

rapw3k avatar Sep 07 '22 09:09 rapw3k