Here's an extract from a script I've written to export via python with
basic auth in the past(it may not work perfectly as-is since I pulled it
out of a much larger script):

import json
> import requests
> from zipfile import ZipFile
> from zipfile import ZIP_DEFLATED

from http.client import HTTPConnection

user = "admin"
> password = "test"
> editorBaseURL = "http://localhost:8083/tbl/";;

editorSession = requests.session()

exportURL = editorBaseURL + "service/" + graphName +
> "/tbs/exportRDFFile?format=turtle"

ttlFile = editorSession.get(exportURL, auth=(user, password));


Hope it helps,

Pat

On Wed, Jun 21, 2023 at 10:58 AM Richard Cyganiak <[email protected]>
wrote:

> Hi Nick,
>
> Is this with EDG Studio or is it with edg.war on Tomcat? Which version of
> EDG?
>
> Has EDG been configured for HTTP Basic Authentication? In other words,
> when logging in to EDG in the browser, is the login form a browser popup
> dialog, as opposed to some kind of web form?
>
> The service URL looks a bit off. The {taxonomy_name} part should be the ID
> of the asset collection, without { } around it. You can find the URL by
> navigating to your asset collection in EDG, then going to the Reports tab,
> selecting Web Services Swagger UI, and finding exportRDFFile in the list.
>
> Hope that helps,
> Richard
>
>
>
>
> On 21 Jun 2023, at 15:05, Nick Sacoman <[email protected]>
> wrote:
>
> I currently am testing one of the API endpoints: specifically the
> exportRDFFile endpoint for a taxonomy. I've read the documentation and have
> configured BasicAuth with my Python request. I'm running into an error I
> will post below along with my code stub. I've tried this with all user
> accounts to no avail (it is on my localhost, I am the admin for more
> clarity). I would appreciate some pointers to get this cleared up.
>
> Code stub (Python3):
> `session = requests.Session()`
> `session.headers.update({"Connection": "Keep-alive"})`
> `res = session.get("
> http://localhost:8083/tbl/service/{taxonomy_name}/tbs/exportRDFFile?format=json-ld";,
> auth=HTTPBasicAuth("user", "password")).text`
>
> Response (res):
> "Cannot invoke org.topbraid.auth.TBUser.canUpdate(org.topbraid.auth.Asset)
> because the return value of org.topbraid.auth.user.TBUserFactory.getUser()
> is null."
>
> --
> The topics of this mailing list include TopBraid EDG and related
> technologies such as SHACL.
> To post to this group, send email to [email protected]
> ---
> You received this message because you are subscribed to the Google Groups
> "TopBraid Suite Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/topbraid-users/d1702a77-1f11-4b86-883e-fe083954d627n%40googlegroups.com
> <https://groups.google.com/d/msgid/topbraid-users/d1702a77-1f11-4b86-883e-fe083954d627n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
>
> --
> The topics of this mailing list include TopBraid EDG and related
> technologies such as SHACL.
> To post to this group, send email to [email protected]
> ---
> You received this message because you are subscribed to the Google Groups
> "TopBraid Suite Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/topbraid-users/8D1670EB-B186-4BA1-9075-093B6AAEC5BE%40topquadrant.com
> <https://groups.google.com/d/msgid/topbraid-users/8D1670EB-B186-4BA1-9075-093B6AAEC5BE%40topquadrant.com?utm_medium=email&utm_source=footer>
> .
>

-- 
The topics of this mailing list include TopBraid EDG and related technologies 
such as SHACL.
To post to this group, send email to [email protected]
--- 
You received this message because you are subscribed to the Google Groups 
"TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/topbraid-users/CA%2B5SJmGf%3D0U%2BNr4QBqwO8fUgYxq0bfCoWNVA%2BNyNwo1qTQwmbQ%40mail.gmail.com.

Reply via email to