-
Notifications
You must be signed in to change notification settings - Fork 585
docs: GraphDB Client #3383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: v7/feat/graphdb
Are you sure you want to change the base?
docs: GraphDB Client #3383
Conversation
|
|
||
| ### Creating a client instance | ||
|
|
||
| The [`GraphDBClient`][rdflib.contrib.graphdb.client.GraphDBClient] class is the main entry point for interacting with the GraphDB REST API. To create an instance, pass the base URL of the GraphDB server to the constructor and optionally a username and password tuple for basic authentication. |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about this one, but is the idea to add a link to the class? Currently, this is poorly rendered IMO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is mkdocstring syntax to link to the class doc. Could you clarify what part is poorly rendered?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, tnx. Sorry, I was not looking at https://rdflib--3383.org.readthedocs.build/en/3383/graphdb/, I was looking at the file https://github.com/RDFLib/rdflib/blob/632e0f877c8ed0ed03b189d776ce5ba050931067/docs/graphdb.md from the browser.
|
|
||
| ```python | ||
| from rdflib.contrib.graphdb.client import GraphDBClient | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This example is very confusing. We pass "admin"/"root" twice and have two different clients. Can we provide an example, where we login a user, which is not the admin ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've changed the login example to a separate user in commit 78b938d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, if GraphDB security is enabled, one must use the admin user to create a client in order to login the other user? This looks very fishy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any user who wants to retrieve a GDB token can use this method. How they use the token is up to them, but I’ve provided a simple example showing how it can also be used with the GraphDBClient.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated the doc example in commit 60e82f4 - hopefully this makes it clearer.
docs/graphdb.md
Outdated
|
|
||
| ```python | ||
| size_info = client.repos.size("my-repo") | ||
| print(f"Size: {size_info.size}") |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fixed in bff4aef
docs/graphdb.md
Outdated
|
|
||
| ##### Querying an agent | ||
|
|
||
| To send a natural language query to an agent: |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’ve updated it (in commit bd4b4a3) to use more general LLM language and specified sparql_query in the example. I’ve avoided re-listing the possible tool types here since they are already documented in the GraphDB docs, and I’d prefer to keep this aligned with the upstream source rather than duplicate it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think "To send a query to an agent:" is accurate. I prefer to phrase it as in the GraphDB documents Call agent query method/assistant tool. Also the query in the example must be a valid SPARQL query, for example ask {?s ?p ?o}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks for the pointers. I've updated the text to reflect your suggestions in 935c91a.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As requested, TTYG is now removed in commit dd1bd30.
Summary of changes
This PR adds user docs for the PR #3372.
The preview link is at: https://rdflib--3383.org.readthedocs.build/en/3383/graphdb/
Checklist
the same change.
./examples.so maintainers can fix minor issues and keep your PR up to date.