g3-toolkit API Reference
    Preparing search index...

    Class SparqlAdapter

    Interface that all data source adapters implement.

    ARGUMENT SAFETY. nodeId, depth and edgeTypes typically come from host state (a node click, a search result, a server payload), so the remote adapters treat them as untrusted: values are bound through the protocol's own mechanism where one exists, and validated by ./query-safety where it does not. A value that cannot be placed safely raises AdapterArgumentError before any request is sent. query(q) is the exception and is NOT sanitized: its argument is query text by definition, so hosts must not build it from untrusted input.

    Implements

    Index

    Constructors

    • Parameters

      • endpointUrl: string
      • OptionalfetchFn: {
            (input: URL | RequestInfo, init?: RequestInit): Promise<Response>;
            (input: string | URL | Request, init?: RequestInit): Promise<Response>;
        }
          • (input: URL | RequestInfo, init?: RequestInit): Promise<Response>
          • Parameters

            • input: URL | RequestInfo
            • Optionalinit: RequestInit

            Returns Promise<Response>

          • (input: string | URL | Request, init?: RequestInit): Promise<Response>
          • Parameters

            • input: string | URL | Request
            • Optionalinit: RequestInit

            Returns Promise<Response>

      • Optionaloptions: { middleware?: Middleware[]; timeoutMs?: number }

      Returns SparqlAdapter

    Properties

    id: "sparql"

    Short identifier (e.g., "sparql", "cypher", "holonic").

    name: "SPARQL Endpoint"

    Human-readable name (e.g., "SPARQL Endpoint").

    Methods

    • Expand the neighborhood of a node at the given depth. Returns a UGM containing the discovered subgraph.

      DEPTH IS HONORED OR REJECTED, never ignored. An implementation that cannot express the requested hop count throws AdapterArgumentError with argument: "depth" before issuing a request, so a host learns at the call site instead of receiving a shallower subgraph that looks complete. Of the shipped adapters, SparqlAdapter, CypherAdapter and GremlinAdapter honor any depth in [1, MAX_TRAVERSAL_DEPTH]; HolonicAdapter and RestAdapter honor 1 and reject the rest, each for a reason recorded on the method.

      Parameters

      • nodeId: string
      • depth: number
      • OptionaledgeTypes: string[]

        Optional filter to specific edge types.

      Returns Promise<UGM>

      AdapterArgumentError when depth is not a finite number, or when the implementation cannot honor the value.