kapps_triplestore_interface.utils.graph_db_credentials#

class kapps_triplestore_interface.utils.graph_db_credentials.GraphDBCredentials(base_url: str, username: str, password: str, repository: str)[source]#

Bases: object

Immutable credentials for connecting to a GraphDB instance.

Contains the base URL, user credentials, and target repository used by the client to authenticate and perform SPARQL operations.

Parameters:
  • base_url (str) – Base URL of the GraphDB instance (e.g., “http://localhost:7200”).

  • username (str) – Username for GraphDB authentication.

  • password (str) – Password for GraphDB authentication.

  • repository (str) – Repository identifier to target within the instance.

base_url: str#
username: str#
password: str#
repository: str#
classmethod from_env() → GraphDBCredentials[source]#

Build credentials from environment variables.

The following environment variables must be set: GRAPHDB_USERNAME, GRAPHDB_PASSWORD, GRAPHDB_URL, and GRAPHDB_REPOSITORY.

Returns:

A credentials instance populated from the environment.

Return type:

GraphDBCredentials

Raises:

ValueError – If any of the required environment variables are missing.