Federated SPARQL query on Stardog Studio (Cloud)

Hi,

Previously, I used the command "SERVICE http://IPAddress:5820/db/query" to query a database while using Stardog Studio (local host). How can I query it at Stardog Studio Cloud?

Thank you

Hi Naeima,

With Stardog Cloud, you can use SERVICE https://[your SDC endpoint].stardog.cloud:5820/db/query.

Best,
Steve

1 Like

Brilliant; Many thanks, Steve.
How about the username and password?
SELECT * {SERVICE http://hamednh@cardiff.ac.uk:password@123@https://sd00000097.stardog.cloud:5820/GPS/query
{ ?p ?o}}

It returned an error. "Fail to run query..
Best,
Naeima

Hi Naeima,

Per the docs:

If the endpoint you’re referencing with the SERVICE keyword requires HTTP authentication, credentials are stored in a password file called services.sdpass located in STARDOG_HOME directory. The default Service implementation assumes HTTP BASIC authentication; for services that use DIGEST auth, or a different authentication mechanism altogether, you’ll need to implement a custom Service

Best,
Steve

1 Like

Thanks, Steve, I think that was the case with Stardog Studio's local host, accessed via the IP address. I am not sure how it will work from cloud to cloud. I will keep trying.

Best,
Naeima

Hi Naeima,

Apologies, my previous message was incorrect (as you intuited). Since you're using SDC, you don't have access to your STARDOG_HOME directory. Given that, will you try the passthrough mechanism (docs)?

In addition to authenticating with a password file, Stardog can reuse credentials of current user via passthrough mechanism. This needs to be explicitly enabled with service.sparql.credentials.passthrough.regex database option, and the service endpoint must match the specified regex.

The folowing will enable passthrough for all services:

$ stardog-admin metadata set service.sparql.credentials.passthrough.regex='.*' my_db_name

Best,
Steve

1 Like

Excellent, I will try this out.

Many thanks, Steve.
Naeima