Connect python to Stardog Cloud instance (free or otherwise)

Hi, what are the options to connect Python to a Stardog cloud instance?. The examples I see require a connection string to the Stardog server. Which one to use for the cloud?

Thanks!

This category is for requesting help or asking questions about Stardog Cloud (https://stardog.com/cloud).

Hi Angel,

When you log in to the Stardog Cloud portal (https://cloud.stardog.com/), you will see a list of connections. Each connection lists its associated endpoint, which is what you will use to connect to the instance. A Stardog Cloud endpoint will be of the form https://sd-12345678.stardog.cloud:5820.

Stardog provides a Python helper library called pystardog (GitHub - stardog-union/pystardog: Python bindings for the Stardog Knowledge Graph platform) that assists with accessing your Stardog server programmatically.

1 Like

Hi Paul: Thanks for the help!

Hi! I came to the forum with that same question in mind and I have an issue. When trying to connect to the instance via pystardog I keep on getting 401s. I wonder if this could be due to the sign in not being SSO? I noticed the pre-configured connection in the dashboard uses SSO to connect to the server.

Just found a fix :slight_smile: I went into Stardog Studio and updated the password for the user. I assume the user is created without a password by default as it is anyway logged in externally. Once the password is set everything works as expected

It sounds like you updated the password for the primary user associated with the instance. The primary user is the owner of the instance and has full admin permissions within the instance. The primary user's associated username will be the same as the email address you use when logging in to Stardog Cloud.

I'm not sure what account you are using with pystardog, but best practice is to create a new (non-admin) user and assign it only those permissions that it needs to perform its work.

Indeed I used the primary account. Also agree that it would be better to create a dedicated account for external access, I'll update my tutorial in this direction.

Hi, I am getting a StardogException: [401] :
can anyone help here?

1 Like

Hi, I got the same problem, how did you solve it?