import stardog
from pathlib import Path
# specify our endpoint, username, and password
# default values are provided, be sure to change if necessary
conn_details = {
'endpoint': 'https://sd-<XXX>106.stardog.cloud:5820',
'username': '<MAIL>',
'password': '<SSO PASS>'
}
with stardog.Admin(**conn_details) as admin:
db = admin.new_database('db')
with stardog.Connection('db', **conn_details) as conn:
conn.begin()
conn.add(stardog.content.File('sample.ttl'))
conn.commit()
results = conn.select('select * { ?a ?p ?o }')
db.drop()
Return>
Traceback (most recent call last):
File "/home/kali/Desktop/Stardog/python-client/create_db.py", line 12, in <module>
with stardog.Admin(**conn_details) as admin:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/kali/Desktop/Stardog/python-client/env/lib/python3.11/site-packages/stardog/admin.py", line 53, in __init__
self.alive()
File "/home/kali/Desktop/Stardog/python-client/env/lib/python3.11/site-packages/stardog/admin.py", line 65, in alive
r = self.client.get("/admin/alive")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/kali/Desktop/Stardog/python-client/env/lib/python3.11/site-packages/stardog/http/client.py", line 59, in get
return self.__wrap(self.session.get(self.url + path, **kwargs))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/kali/Desktop/Stardog/python-client/env/lib/python3.11/site-packages/stardog/http/client.py", line 75, in __wrap
raise exceptions.StardogException(
stardog.exceptions.StardogException: [401] :
The endpoint and the credentials are correct.