science_live.core.endpoints
#
Nanopub Endpoint Management#
Manages connections to nanopublication servers and provides a unified interface for SPARQL queries and nanopub retrieval.
Module Contents#
Classes#
Abstract base class for nanopub data sources |
|
Standard nanopub network endpoint implementation |
|
Test nanopub endpoint with mock data |
|
Manages multiple nanopub endpoints with failover support |
API#
- class science_live.core.endpoints.NanopubEndpoint[source]#
Bases:
abc.ABC
Abstract base class for nanopub data sources
- abstractmethod async execute_sparql(query: str) Dict[str, Any] [source]#
Execute a SPARQL query against the endpoint
- class science_live.core.endpoints.StandardNanopubEndpoint(base_url: str, timeout: int = 30)[source]#
Bases:
science_live.core.endpoints.NanopubEndpoint
Standard nanopub network endpoint implementation
Initialization
- class science_live.core.endpoints.MockNanopubEndpoint(base_url: str = 'https://test.nanopub.org', simulate_delay: bool = True, delay_range: Tuple[float, float] = (0.01, 0.05))[source]#
Bases:
science_live.core.endpoints.NanopubEndpoint
Test nanopub endpoint with mock data
Initialization
- async execute_sparql(query: str) Dict[str, Any] [source]#
Return mock SPARQL results with simulated delay
- class science_live.core.endpoints.EndpointManager[source]#
Manages multiple nanopub endpoints with failover support
Initialization
- register_endpoint(name: str, endpoint: science_live.core.endpoints.NanopubEndpoint, is_default: bool = False)[source]#
Register a nanopub endpoint
- get_endpoint(name: Optional[str] = None) science_live.core.endpoints.NanopubEndpoint [source]#
Get endpoint by name or return default