g3-toolkit API Reference
    Preparing search index...

    Class RestAdapter

    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

    Properties

    id: "rest"

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

    name: string

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

    Methods

    • Re-query the configured endpoint with the node id as the filter. DEPTH IS REJECTED ABOVE 1 rather than ignored.

      How many hops a REST response covers is decided by the endpoint and by the adopter's mapResponse, neither of which this adapter can see or parameterize. There is no traversal contract to bind a hop count to, so a supplied depth cannot be honored, and returning whatever the endpoint happens to send while accepting depth: 3 misreports the result. An adopter whose API does take a depth should encode it in url or mapResponse and call with 1.

      Parameters

      • nodeId: string
      • depth: number = 1

      Returns Promise<UGM>

      AdapterArgumentError when depth resolves above 1.