Model Catalog Endpoints

class graphdatascience.procedure_surface.api.model.ModelCatalogEndpoints
abstract delete(model_name: str, fail_if_missing: bool = False) → ModelDeleteResult | None

Delete a persisted model from storage.

Parameters:
  • model_name (str) – Name of the model.

  • fail_if_missing (bool) – If True, a missing model will cause an error. If False, returns None when missing.

Returns:

The delete result.

Return type:

ModelDeleteResult | None

abstract drop(model_name: str, *, fail_if_missing: bool = True) → ModelDetails | None

Drop a model from the in-memory catalog.

Parameters:
  • model_name (str) – Name of the model.

  • fail_if_missing (bool) – If True, a missing model will cause an error. If False, returns None when missing.

Returns:

The model details after the drop operation when applicable.

Return type:

ModelDetails | None

abstract exists(model_name: str) → ModelExistsResult | None

Check whether a model exists.

Parameters:

model_name (str) – Name of the model.

Returns:

A result object when the model exists; otherwise None.

Return type:

ModelExistsResult | None

abstract get(model_name: str) → ModelDetails

Get a model catalog entry by name. To get the typed model object use gds.<algo>.get, such as gds.graph_sage.get

Parameters:

model_name (str) – Name of the model.

Returns:

The model details.

Return type:

ModelDetails

abstract list() → list[ModelDetails]

List all models in the model catalog.

Returns:

List of model catalog entries.

Return type:

list[ModelDetails]

abstract load(model_name: str) → ModelLoadResult

Load a persisted model into the session/catalog.

Parameters:

model_name (str) – Name of the model.

Returns:

The load result.

Return type:

ModelLoadResult

abstract publish(model_name: str) → ModelDetails

Publish a model so it becomes accessible to other users.

Parameters:

model_name (str) – Name of the model.

Returns:

The details of the published model.

Return type:

ModelDetails

abstract store(model_name: str, *, fail_if_unsupported: bool = False) → ModelStoreResult

Persist/store a model.

Parameters:
  • model_name (str) – Name of the model.

  • fail_if_unsupported (bool) – If True, unsupported models cause an error.

Returns:

The store result.

Return type:

ModelStoreResult

pydantic model graphdatascience.procedure_surface.api.model.ModelDeleteResult
field delete_millis: int
field model_name: str
pydantic model graphdatascience.procedure_surface.api.model.ModelExistsResult
field exists: bool
field model_name: str
field model_type: str
pydantic model graphdatascience.procedure_surface.api.model.ModelLoadResult
field load_millis: int
field model_name: str
pydantic model graphdatascience.procedure_surface.api.model.ModelStoreResult
field model_name: str
field store_millis: int
class graphdatascience.model.model_details.ModelDetails
class graphdatascience.model.model.Model
delete(fail_if_missing: bool = False) → ModelDeleteResult | None

Delete the persisted model from storage.

Parameters:

fail_if_missing (bool) – If True, an error is thrown if the model does not exist. If False, no error is thrown.

Returns:

The result of the delete operation.

Return type:

ModelDeleteResult | None

details() → ModelDetails

Get metadata about the model from the model catalog.

Returns:

The details of the model.

Return type:

ModelDetails

drop(fail_if_missing: bool = False) → ModelDetails | None

Drop the model.

Parameters:

fail_if_missing (bool) – If True, an error is thrown if the model does not exist. If False, no error is thrown.

Returns:

The result of the drop operation.

Return type:

ModelDetails | None

exists() → bool

Check whether the model exists.

Returns:

True if the model exists, False otherwise.

Return type:

bool

load() → ModelLoadResult

Load the persisted model into the in-memory catalog.

Returns:

The result of the load operation.

Return type:

ModelLoadResult

name() → str

Get the name of the model.

Returns:

The name of the model.

Return type:

str

publish() → ModelDetails

Publish the model so it becomes accessible to other users.

Returns:

The details of the published model.

Return type:

ModelDetails

store(fail_if_unsupported: bool = False) → ModelStoreResult

Persist the model to storage.

Parameters:

fail_if_unsupported (bool) – If True, an error is thrown if the model is not supported for storing.

Returns:

The result of the store operation.

Return type:

ModelStoreResult