# Federated SPARQL query on Stardog Studio (Cloud)

**URL:** <https://community.stardog.com/t/federated-sparql-query-on-stardog-studio-cloud/4259>\
**Category:** Stardog Studio\
**Created:** [February 18, 2023, 5:42pm UTC](https://community.stardog.com/t/federated-sparql-query-on-stardog-studio-cloud/4259 "2023-02-18T17:42:07Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Naeima123](https://avatars.discourse-cdn.com/v4/letter/n/a183cd/32.png) [@Naeima123](https://community.stardog.com/u/Naeima123)\
**Post date:** [February 18, 2023, 5:42pm UTC](https://community.stardog.com/t/federated-sparql-query-on-stardog-studio-cloud/4259/1 "2023-02-18T17:42:07Z")

</div>

Hi,

Previously, I used the command "SERVICE [http://IPAddress:5820/db/query](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

---

<div class="post-metadata">

**Author:** ![StevePlace](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/steveplace/32/1989_2.png) [@StevePlace](https://community.stardog.com/u/StevePlace)\
**Post date:** [February 21, 2023, 4:35pm UTC](https://community.stardog.com/t/federated-sparql-query-on-stardog-studio-cloud/4259/2 "2023-02-21T16:35:50Z")

</div>

Hi Naeima,

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

Best,  
Steve

---

<div class="post-metadata">

**Author:** ![Naeima123](https://avatars.discourse-cdn.com/v4/letter/n/a183cd/32.png) [@Naeima123](https://community.stardog.com/u/Naeima123)\
**Post date:** [February 21, 2023, 5:28pm UTC](https://community.stardog.com/t/federated-sparql-query-on-stardog-studio-cloud/4259/3 "2023-02-21T17:28:27Z")

</div>

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](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

---

<div class="post-metadata">

**Author:** ![StevePlace](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/steveplace/32/1989_2.png) [@StevePlace](https://community.stardog.com/u/StevePlace)\
**Post date:** [February 21, 2023, 5:43pm UTC](https://community.stardog.com/t/federated-sparql-query-on-stardog-studio-cloud/4259/4 "2023-02-21T17:43:22Z")

</div>

Hi Naeima,

Per [the docs](https://docs.stardog.com/query-stardog/#http-authentication):

> If the endpoint you’re referencing with the `SERVICE` keyword requires HTTP authentication, credentials are stored in a [password file](https://docs.stardog.com/operating-stardog/security/managing-users-and-roles#using-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

---

<div class="post-metadata">

**Author:** ![Naeima123](https://avatars.discourse-cdn.com/v4/letter/n/a183cd/32.png) [@Naeima123](https://community.stardog.com/u/Naeima123)\
**Post date:** [February 21, 2023, 5:57pm UTC](https://community.stardog.com/t/federated-sparql-query-on-stardog-studio-cloud/4259/5 "2023-02-21T17:57:42Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![StevePlace](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/steveplace/32/1989_2.png) [@StevePlace](https://community.stardog.com/u/StevePlace)\
**Post date:** [February 21, 2023, 6:12pm UTC](https://community.stardog.com/t/federated-sparql-query-on-stardog-studio-cloud/4259/6 "2023-02-21T18:12:24Z")

</div>

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](https://docs.stardog.com/query-stardog/#http-credentials-passthrough))?

> 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](https://docs.stardog.com/operating-stardog/database-administration/database-configuration#servicesparqlcredentialspassthroughregex) database option, and the service endpoint must match the specified regex.

> The folowing will enable passthrough for all services:

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

```

Best,  
Steve

---

<div class="post-metadata">

**Author:** ![Naeima123](https://avatars.discourse-cdn.com/v4/letter/n/a183cd/32.png) [@Naeima123](https://community.stardog.com/u/Naeima123)\
**Post date:** [February 21, 2023, 6:17pm UTC](https://community.stardog.com/t/federated-sparql-query-on-stardog-studio-cloud/4259/7 "2023-02-21T18:17:45Z")

</div>

Excellent, I will try this out.

Many thanks, Steve.  
Naeima
