graphdb
Modules:
-
client–GraphDB client module.
-
exceptions–GraphDB exceptions.
-
models– -
util–
Classes:
-
GraphDBClient–GraphDB Client
GraphDBClient
GraphDBClient(base_url: str, auth: tuple[str, str] | str | None = None, timeout: float | Timeout = 30.0, **kwargs: Any)
Bases: RDF4JClient
GraphDB Client
This client and its inner management objects perform HTTP requests via httpx and may raise httpx-specific exceptions. Errors documented by GraphDB in its OpenAPI specification are mapped to specific exceptions in this library where applicable. Error mappings are documented on each management method. The underlying httpx client is reused across requests, and connection pooling is handled automatically by httpx.
Parameters:
-
(base_urlstr) –The base URL of the GraphDB server.
-
(authtuple[str, str] | str | None, default:None) –Authentication credentials. Can be a tuple (username, password) for basic auth, or a string for token-based auth (e.g., “GDB
“) which is added as the Authorization header. -
(timeoutfloat | Timeout, default:30.0) –Request timeout in seconds or an httpx.Timeout for fine-grained control (default: 30.0).
-
(kwargsAny, default:{}) –Additional keyword arguments to pass to the httpx.Client.
Methods:
-
login–Authenticate with GraphDB and obtain a GDB token.
Attributes:
-
cluster(ClusterGroupManagement) – -
graphdb_repositories(RepositoryManagement) – -
monitoring(MonitoringManagement) – -
recovery(RecoveryManagement) – -
repositories(RepositoryManager) –Server-level repository management operations (GraphDB-specific).
-
security(SecurityManagement) – -
users(UserManagement) –
Source code in rdflib/contrib/graphdb/client.py
repositories
property
repositories: RepositoryManager
Server-level repository management operations (GraphDB-specific).
login
login(username: str, password: str) -> AuthenticatedUser
Authenticate with GraphDB and obtain a GDB token.
Parameters:
-
(usernamestr) –The username to authenticate with.
-
(passwordstr) –The password to authenticate with.
Returns:
-
AuthenticatedUser–An AuthenticatedUser instance containing user details and the GDB token.
Raises:
-
UnauthorisedError–If the credentials are invalid.
-
BadRequestError–If the request body is invalid.
-
ResponseFormatError–If the response cannot be parsed.