HTTP Server API

SemanticSpacetime.serveFunction
serve(store::AbstractSSTStore; port::Int=8080, host::String="127.0.0.1",
      verbose::Bool=true, resources::String="/tmp") -> Any

Start a Genie-based HTTP server exposing the SST graph via a JSON API.

Endpoints (backward compatible)

  • GET /health — health check ({"status":"ok"})
  • GET /search?q=<query> — text search across nodes
  • GET /node/:class/:cptr — get node details by NodePtr
  • GET /links/:class/:cptr — get links for a node
  • GET /cone/:class/:cptr?direction=forward&depth=5&limit=100 — cone search
  • GET /graph — graph summary (node/link counts, centrality)

New endpoints (Go parity)

  • GET|POST /searchN4L?name=<query> — unified search dispatch
  • GET /api/search?q=<query> — text search
  • GET /api/orbit/:class/:cptr — node orbit with neighbour rings
  • GET /api/cone/:class/:cptr — causal cone as WebPath traces
  • GET /api/paths?from_class=&from_cptr=&to_class=&to_cptr= — path solving
  • GET /api/chapters — list chapters
  • GET /api/contexts — list contexts
  • GET /api/stats — graph statistics
  • GET /api/pagemap?chapter=X — page-map view
  • GET /api/stories?name=X — story/sequence following

Arguments

  • store: any AbstractSSTStore (MemoryStore or SSTConnection)
  • port: TCP port to listen on (default 8080)
  • host: host address (default "127.0.0.1")
  • verbose: print startup message
  • resources: directory for resources (default "/tmp")

Returns

A server handle. Call stop_server() to shut down.

Example

store = MemoryStore()
serve(store; port=9090)
# ... server is running ...
stop_server()
SemanticSpacetime.handle_search_dispatchFunction
handle_search_dispatch(store, search, line) -> Dict

Dispatch a parsed SearchParameters to the appropriate handler, mirroring the Go HandleSearch logic.

Web Types

SemanticSpacetime.WebConePathsType
WebConePaths

JSON-serializable response for causal cone queries, containing the origin node, its ST type, and a nested vector of WebPath traces.

SemanticSpacetime.PageViewType
PageView

JSON-serializable response for page-map / notes display, containing a title, context string, and note lines as WebPath vectors.

SemanticSpacetime.SearchResponseType
SearchResponse

JSON-serializable wrapper for search results, carrying the response type, content, ambient context, intent, and search key.

SemanticSpacetime.json_node_eventFunction
json_node_event(store::AbstractSSTStore, nptr::NodePtr, xyz::Coords,
                orbits::Vector{Vector{Orbit}}) -> NodeEvent

Build a NodeEvent from a node pointer by looking up the node data in the store and combining it with the supplied coordinates and orbits.

SemanticSpacetime.link_web_pathsFunction
link_web_paths(store::MemoryStore, cone::Vector{Vector{Link}};
               chapter::String="", context::Vector{String}=String[],
               limit::Int=100) -> Vector{Vector{WebPath}}

Convert a vector of cone link-paths to WebPath format, resolving node names, arrow types, and context strings from the store.

SemanticSpacetime.json_pageFunction
json_page(store::MemoryStore, maplines::Vector{PageMap}) -> Dict

Build a PageView-like dictionary from page map lines for JSON rendering.

SemanticSpacetime.package_responseFunction
package_response(store::AbstractSSTStore, search::SearchParameters,
                 response_type::String, content::String) -> Dict

Wrap a search result with ambient context metadata, mirroring the Go PackageResponse function.