# Introduction

Welcome to the Spatial Web SDK documentation! This GitBook provides guides and resources for developers working with the Spatial Web SDK.

## What is the Spatial Web SDK?

The Spatial Web SDK is a reference implementation to help developers build nodes for the Spatial Web, providing foundational libraries and tools for emerging IEEE Spatial Web standards.

## Version

The current version documented here is **0.7b0** ([spatial\_web\_sdk\_v0.7b0.zip](https://github.com/VersesTech/spatial-web-sdk/tree/main/sdk_release/spatial_web_sdk_v0.7b0.zip)).

## Getting Started

* Download the latest SDK bundle from the releases section.
* Use the navigation sidebar or [Table of Contents](https://github.com/VersesTech/spatial-web-sdk/blob/main/gitbook/spatial-web-sdk/SUMMARY.md) to explore guides and references.

For more details, see the sidebar or SUMMARY.md.

### Architecture of a spatial web node as provided by this SDK

Following is a very high level overview of the architecture of an instance of a spatial web node, as provided by this SDK:

{% @mermaid/diagram content="---
config:
theme: default
flowchart:
htmlLabels: true
title: HSTP and HSML System Architecture
----------------------------------------

flowchart TB
subgraph EXT\["🌐 External World"]
direction TB
WW\["HSTP Clients<br>(Spatial Web Nodes/ Web/ Mobile Apps)"]
OTHER\_NODES\["Other Spatial Web Nodes<br>(Peer Network)"]
EXTERNAL\_SERVICE\_A\["External Services<br>(APIs, Databases)"]
end
subgraph HTTP\_OPS\["🚀 Transport & Transaction Layer"]
direction TB
HTTP\["hstp.d HTTP Endpoint<br>(REST API)"]
CH\["HSTP Channels Manager<br>(WebSocket Pub/Sub)"]
OPS\["HSTP Operations Handlers<br>(Business Logic)"]
end
subgraph INTEGRATION\["🔧 Integration Layer"]
direction TB
HSTP\_CLIENT\["HSTP Client<br>(Outbound Requests)"]
HSML\_CLIENT\["HSML Client<br>(Data Query Interface)"]
end
subgraph DOMAINLOGIC\["🧠 Domain Logic Layer"]
direction TB
UDG\["UDG <br/>(Universal Domain Graph)<br/> proxy interface / implementation"]
ACT\_HANDLERS\["Activity Executors"]
OP\_HANDLERS\["Operation Executors"]
end
subgraph HSTP\_D\["📦 HSTP.d Process"]
direction TB
HTTP\_OPS
DOMAINLOGIC
INTEGRATION
end
subgraph HSML\["📊 HSML.d Process"]
direction TB
HSML\_HTTP\["hsml.d HTTP Endpoint<br>(Query Interface)"]
end
subgraph DATA\_LAYER\["💾 Data Storage Layer"]
direction LR
RDF\["Apache Jena Fuseki<br>(RDF Triple Store w/ SPARQL)"]
end
subgraph SPATIAL\_WEB\_NODE\["🏗️ Spatial Web Node Instance"]
direction TB
HSTP\_D
HSML
DATA\_LAYER
end
WW -- HTTP Requests --> HTTP
HTTP -. HTTP Responses .-> WW
WW <-. WebSocket Pub/Sub .-> CH
HTTP -- Route to --> OPS
OPS -. Responds via .-> HTTP
HTTP -- WebSocket Events --> CH
OP\_HANDLERS -- Delegates to --> ACT\_HANDLERS
ACT\_HANDLERS -. Results back to .-> OP\_HANDLERS
OPS -- Delegates to --> OP\_HANDLERS
OP\_HANDLERS -. Results back to .-> OPS
OP\_HANDLERS -. Uses .-> UDG & CH
ACT\_HANDLERS -- Calls --> EXTERNAL\_SERVICE\_A
ACT\_HANDLERS -. Uses .-> UDG & CH
UDG -. Uses .-> HSTP\_CLIENT & HSML\_CLIENT
HSTP\_CLIENT -- HSTP Request --> OTHER\_NODES
OTHER\_NODES -. HSTP Response .-> HSTP\_CLIENT
HSML\_CLIENT -- HTTP Request --> HSML\_HTTP
HSML\_HTTP -. HTTP Response .-> HSML\_CLIENT
HSML\_HTTP <-- SPARQL over HTTP --> RDF
WW:::externalWorld
OTHER\_NODES:::externalWorld
EXTERNAL\_SERVICE\_A:::externalWorld
HTTP:::transport
CH:::transport
OPS:::transport
HSTP\_CLIENT:::INTEGRATION
HSML\_CLIENT:::INTEGRATION
UDG:::DOMAINLOGIC
ACT\_HANDLERS:::DOMAINLOGIC
OP\_HANDLERS:::DOMAINLOGIC
HSML\_HTTP:::dataLayer
RDF:::dataLayer
HSTP\_D:::process
HSML:::process
classDef externalWorld fill:#e1f5fe,stroke:#0277bd,stroke-width:3px,color:#000
classDef transport fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px,color:#000
classDef DOMAINLOGIC fill:#e8f5e8,stroke:#2e7d32,stroke-width:2px,color:#000
classDef INTEGRATION fill:#fafafa,stroke:#fa8888,stroke-width:2px,color:#000
classDef dataLayer fill:#fff3e0,stroke:#ef6c00,stroke-width:2px,color:#000
classDef process fill:#fafafa,stroke:#424242,stroke-width:2px,color:#000
classDef deprecated fill:#ffebee,stroke:#c62828,stroke-width:2px,color:#000,stroke-dasharray: 5 5
style HTTP\_OPS fill:#FFFFFF
style DOMAINLOGIC fill:#FFFFFF
style INTEGRATION fill:#FFFFFF
style SPATIAL\_WEB\_NODE fill:#FFFFFF
style EXT fill:#FFFFFF" %}

### Future facing architecture of a spatial web node, including support for the actor pattern

Following is view of how we intend to build the actor model into spatial web nodes, in future versions of this SDK.

Note this is a VERY EARLY AND SIMPLE overview of what it may look like, and the design may change.

{% @mermaid/diagram content="---
config:
theme: default
flowchart:
htmlLabels: true
title: HSTP and HSML System Architecture w/ simple actor model
--------------------------------------------------------------

flowchart TB
subgraph EXT\["🌐 External World"]
direction TB
WW\["HSTP Clients<br>(Spatial Web Nodes/ Web/ Mobile Apps)"]
OTHER\_NODES\["Other Spatial Web Nodes<br>(Peer Network)"]
EXTERNAL\_SERVICE\_A\["External Services<br>(APIs, Databases)"]
end
subgraph HTTP\_OPS\["🚀 Transport & Transaction Layer"]
direction TB
HTTP\["hstp.d HTTP Endpoint<br>(REST API)"]
CH\["HSTP Channels Manager<br>(WebSocket Pub/Sub)"]
OPS\["HSTP Operations Handlers<br>(Business Logic)"]
end
subgraph INTEGRATION\["🔧 Integration Layer"]
direction TB
WM\["Wallet Manager<br>(⚠️ In Development)"]
FS\["Local Filesystem<br>(File Storage)"]
HSTP\_CLIENT\["HSTP Client<br>(Outbound Requests)"]
HSML\_CLIENT\["HSML Client<br>(Data Query Interface)"]
OP\_HANDLERS\["Operation Executors"]
end
subgraph HSTP\_D\["📦 HSTP.d Process"]
direction TB
HTTP\_OPS
DOMAINLOGIC
INTEGRATION
end
subgraph UDG\_D\["🕸️ UDG.d Process"]
direction TB
UDG\_API\["UDG API endpiont"]
end
subgraph ACTOR\_SUPERVISOR\["Actors Supervisor"]
TASKS\_SUPERVISOR\["Tasks Supervisor /Manager"]
end
subgraph ACTORS\_RUNTIME\["Actors runtime"]
ACTOR\_SYSTEM\_CHANNEL\_MANAGER\["Channels manager for actor system instance"]
QUEUE\_FOR\_INPUT\_CHANNELS\["Input channels queue"]
QUEUE\_FOR\_OUTPUT\_CHANNELS\["Output channels queue"]
mailbox1@{ label: "actor 1's mailbox" }
mailboxn@{ label: "actor N's mailbox" }
actor\_1\["actor 1"]
actor\_N\["actor N"]
end
subgraph ACTOR\_SYSTEM\["🎭 Actor Manager System"]
direction TB
ACTOR\_MANAGER\_API\["Actor Manager API<br>(queue /bus)"]
ACTOR\_SUPERVISOR
ACTORS\_RUNTIME
end
subgraph HSML\["📊 HSML.d Process"]
direction TB
HSML\_HTTP\["hsml.d HTTP Endpoint<br>(Query Interface)"]
end
subgraph DATA\_LAYER\["💾 Data Storage Layer"]
direction LR
RDF\["Apache Jena Fuseki<br>(RDF Triple Store w/ SPARQL)"]
end
subgraph SPATIAL\_WEB\_NODE\["🏗️ Spatial Web Node Instance"]
direction TB
HSTP\_D
HSML
DATA\_LAYER
UDG\_D
ACTOR\_SYSTEM
end
ACTOR\_MANAGER\_API -- Takes Activity requests --> ACTOR\_SUPERVISOR
QUEUE\_FOR\_INPUT\_CHANNELS -- puts messages --> mailbox1 & mailboxn
mailbox1 -- pulls messages --> actor\_1
mailboxn -- pulls messages --> actor\_N
actor\_1 -- posts to channel via --> QUEUE\_FOR\_OUTPUT\_CHANNELS
actor\_N -- posts to channel via --> QUEUE\_FOR\_OUTPUT\_CHANNELS
ACTOR\_SYSTEM\_CHANNEL\_MANAGER -. manages .-> QUEUE\_FOR\_INPUT\_CHANNELS & QUEUE\_FOR\_OUTPUT\_CHANNELS
QUEUE\_FOR\_INPUT\_CHANNELS -. queries .-> ACTOR\_SYSTEM\_CHANNEL\_MANAGER
QUEUE\_FOR\_OUTPUT\_CHANNELS -. queries .-> ACTOR\_SYSTEM\_CHANNEL\_MANAGER
EXTERNAL\_SERVICE\_A -- sends messages --> QUEUE\_FOR\_INPUT\_CHANNELS
WW -- sends messages --> QUEUE\_FOR\_INPUT\_CHANNELS
OTHER\_NODES -- sends messages --> QUEUE\_FOR\_INPUT\_CHANNELS
QUEUE\_FOR\_OUTPUT\_CHANNELS -- sends messages --> EXTERNAL\_SERVICE\_A & WW & OTHER\_NODES
WW -- HTTP Requests --> HTTP
HTTP -. HTTP Responses .-> WW
WW <-. WebSocket Pub/Sub .-> CH
HTTP -- Route to --> OPS
OPS -. Responds via .-> HTTP
HTTP -- WebSocket Events --> CH
OP\_HANDLERS -- Delegates to --> ACTOR\_MANAGER\_API
ACTOR\_MANAGER\_API -. Results back to .-> OP\_HANDLERS
OPS -- Delegates to --> OP\_HANDLERS
OP\_HANDLERS -. Results back to .-> OPS
OP\_HANDLERS -. Uses .-> UDG\_API & CH
ACTOR\_MANAGER\_API -- Calls --> EXTERNAL\_SERVICE\_A
ACTOR\_MANAGER\_API -. Uses .-> UDG\_API & WM & CH
WM <-- Read/Write --> FS
UDG\_API -. Uses .-> WM & HSTP\_CLIENT & HSML\_CLIENT
HSTP\_CLIENT -- HSTP Request --> OTHER\_NODES
OTHER\_NODES -. HSTP Response .-> HSTP\_CLIENT
HSML\_CLIENT -- HTTP Request --> HSML\_HTTP
HSML\_HTTP -. HTTP Response .-> HSML\_CLIENT
HSML\_HTTP <-- SPARQL over HTTP --> RDF
mailbox1@{ shape: rect}
mailboxn@{ shape: rect}
WW:::externalWorld
OTHER\_NODES:::externalWorld
EXTERNAL\_SERVICE\_A:::externalWorld
HTTP:::transport
CH:::transport
OPS:::transport
WM:::INTEGRATION
FS:::INTEGRATION
HSTP\_CLIENT:::INTEGRATION
HSML\_CLIENT:::INTEGRATION
OP\_HANDLERS:::DOMAINLOGIC
ACTOR\_MANAGER\_API:::DOMAINLOGIC
HSML\_HTTP:::dataLayer
RDF:::dataLayer
HSTP\_D:::process
HSML:::process
classDef externalWorld fill:#e1f5fe,stroke:#0277bd,stroke-width:3px,color:#000
classDef transport fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px,color:#000
classDef DOMAINLOGIC fill:#e8f5e8,stroke:#2e7d32,stroke-width:2px,color:#000
classDef INTEGRATION fill:#fafafa,stroke:#fa8888,stroke-width:2px,color:#000
classDef dataLayer fill:#fff3e0,stroke:#ef6c00,stroke-width:2px,color:#000
classDef process fill:#fafafa,stroke:#424242,stroke-width:2px,color:#000
classDef deprecated fill:#ffebee,stroke:#c62828,stroke-width:2px,color:#000,stroke-dasharray: 5 5
style HTTP\_OPS fill:#FFFFFF
style DOMAINLOGIC fill:#FFFFFF
style INTEGRATION fill:#FFFFFF
style ACTOR\_SYSTEM fill:#FFCDD2
style SPATIAL\_WEB\_NODE fill:#FFFFFF
style EXT fill:#FFFFFF
" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://gitbook.spatialwebfoundation.org/readme.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
