|
1 | 1 | # Getting Started with Janus |
2 | 2 |
|
3 | | -Welcome to Janus! This guide will help you get up and running with the Janus RDF Stream Processing Engine. |
4 | | - |
5 | | -## What is Janus? |
6 | | - |
7 | | -Janus is a hybrid engine for unified Live and Historical RDF Stream Processing, written in Rust. It allows you to seamlessly process both historical RDF data stored in databases and live RDF streams in real-time using a single query language. |
| 3 | +Janus is a Rust engine for querying historical and live RDF data through one |
| 4 | +Janus-QL model and one HTTP/WebSocket API. |
8 | 5 |
|
9 | 6 | ## Prerequisites |
10 | 7 |
|
11 | | -Before you begin, ensure you have the following installed: |
12 | | - |
13 | | -- **Rust** (1.70.0 or later) - [Install from rustup.rs](https://rustup.rs/) |
14 | | -- **Cargo** (comes with Rust) |
15 | | -- **Git** (for cloning the repository) |
16 | | -- **Docker** (optional, for running RDF stores) |
17 | | - |
18 | | -### Installing Rust |
| 8 | +- Rust stable with Cargo |
| 9 | +- Docker and Docker Compose if you want the MQTT-backed replay flow |
19 | 10 |
|
20 | | -If you don't have Rust installed, run: |
21 | | - |
22 | | -```bash |
23 | | -curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh |
24 | | -``` |
| 11 | +## Fastest Working Path |
25 | 12 |
|
26 | | -After installation, restart your terminal and verify: |
| 13 | +### 1. Build and test |
27 | 14 |
|
28 | 15 | ```bash |
29 | | -rustc --version |
30 | | -cargo --version |
| 16 | +make build |
| 17 | +make test |
31 | 18 | ``` |
32 | 19 |
|
33 | | -## Quick Start |
34 | | - |
35 | | -### 1. Clone the Repository |
| 20 | +### 2. Start the HTTP server |
36 | 21 |
|
37 | 22 | ```bash |
38 | | -git clone https://github.com/yourusername/janus.git |
39 | | -cd janus |
| 23 | +cargo run --bin http_server -- --host 127.0.0.1 --port 8080 --storage-dir ./data/storage |
40 | 24 | ``` |
41 | 25 |
|
42 | | -### 2. Build the Project |
| 26 | +Verify it is up: |
43 | 27 |
|
44 | 28 | ```bash |
45 | | -# Debug build (faster compilation, slower execution) |
46 | | -cargo build |
47 | | - |
48 | | -# Release build (slower compilation, faster execution) |
49 | | -cargo build --release |
| 29 | +curl http://127.0.0.1:8080/health |
50 | 30 | ``` |
51 | 31 |
|
52 | | -### 3. Run Tests |
| 32 | +### 3. Exercise the API |
53 | 33 |
|
54 | | -Verify everything is working correctly: |
| 34 | +The quickest end-to-end client is the example binary: |
55 | 35 |
|
56 | 36 | ```bash |
57 | | -cargo test |
| 37 | +cargo run --example http_client_example |
58 | 38 | ``` |
59 | 39 |
|
60 | | -### 4. Run the Example |
| 40 | +That example covers query registration, start, stop, replay control, and |
| 41 | +WebSocket result consumption. |
61 | 42 |
|
62 | | -```bash |
63 | | -cargo run --example basic |
64 | | -``` |
65 | | - |
66 | | -You should see output explaining the steps Janus takes to process RDF streams. |
| 43 | +## Optional Local Demo UI |
67 | 44 |
|
68 | | -### 5. Run the CLI Tool |
| 45 | +This repository keeps a small static demo at |
| 46 | +`examples/demo_dashboard.html` for manual browser testing. |
69 | 47 |
|
70 | | -```bash |
71 | | -cargo run |
72 | | -``` |
| 48 | +The maintained Svelte dashboard lives in the separate |
| 49 | +`SolidLabResearch/janus-dashboard` repository. |
73 | 50 |
|
74 | | -This will display the version and basic information about Janus. |
| 51 | +## Main Binaries |
75 | 52 |
|
76 | | -## Project Structure |
| 53 | +- `http_server`: REST and WebSocket API for query lifecycle and replay control |
| 54 | +- `stream_bus_cli`: replay and ingestion CLI for RDF event files |
77 | 55 |
|
78 | | -Understanding the project structure will help you navigate the codebase: |
79 | | - |
80 | | -``` |
81 | | -janus/ |
82 | | -├── src/ # Source code |
83 | | -│ ├── lib.rs # Library entry point |
84 | | -│ ├── main.rs # Binary entry point |
85 | | -│ ├── core/ # Core engine logic (to be implemented) |
86 | | -│ ├── store/ # RDF store adapters (to be implemented) |
87 | | -│ ├── stream/ # Stream processing (to be implemented) |
88 | | -│ ├── query/ # Query engine (to be implemented) |
89 | | -│ └── config/ # Configuration (to be implemented) |
90 | | -├── examples/ # Usage examples |
91 | | -│ └── basic.rs # Basic example |
92 | | -├── tests/ # Integration tests |
93 | | -│ └── integration_test.rs |
94 | | -├── benches/ # Performance benchmarks |
95 | | -├── fuseki-config/ # Apache Jena Fuseki configuration |
96 | | -├── Cargo.toml # Project metadata and dependencies |
97 | | -├── Makefile # Common development tasks |
98 | | -└── README.md # Project overview |
99 | | -``` |
100 | | - |
101 | | -## Using the Makefile |
102 | | - |
103 | | -The project includes a `Makefile` with common development tasks: |
| 56 | +## Common Commands |
104 | 57 |
|
105 | 58 | ```bash |
106 | | -# See all available commands |
107 | | -make help |
108 | | - |
109 | | -# Build the project |
110 | 59 | make build |
111 | | - |
112 | | -# Run tests |
| 60 | +make release |
113 | 61 | make test |
114 | | - |
115 | | -# Format code |
116 | 62 | make fmt |
117 | | - |
118 | | -# Run linter |
| 63 | +make fmt-check |
119 | 64 | make lint |
120 | | - |
121 | | -# Run all checks |
122 | 65 | make check |
123 | | - |
124 | | -# Generate documentation |
125 | | -make doc |
126 | | - |
127 | | -# Run benchmarks |
128 | | -make bench |
129 | | - |
130 | | -# Start Docker services (Oxigraph + Jena) |
131 | | -make docker-start |
132 | | - |
133 | | -# Stop Docker services |
134 | | -make docker-stop |
135 | | -``` |
136 | | - |
137 | | -## Development Workflow |
138 | | - |
139 | | -### 1. Set Up Your Development Environment |
140 | | - |
141 | | -```bash |
142 | | -# Install development tools |
143 | | -make setup |
144 | | - |
145 | | -# Verify everything is installed |
146 | | -make setup-check |
147 | | -``` |
148 | | - |
149 | | -### 2. Make Changes |
150 | | - |
151 | | -Edit files in the `src/` directory. The main areas to implement are: |
152 | | - |
153 | | -- `src/core/` - Core engine logic |
154 | | -- `src/store/` - RDF store adapters |
155 | | -- `src/stream/` - Stream processing |
156 | | -- `src/query/` - Query parsing and execution |
157 | | - |
158 | | -### 3. Test Your Changes |
159 | | - |
160 | | -```bash |
161 | | -# Run tests |
162 | | -cargo test |
163 | | - |
164 | | -# Run tests with output |
165 | | -cargo test -- --nocapture |
166 | | - |
167 | | -# Run specific test |
168 | | -cargo test test_name |
169 | | -``` |
170 | | - |
171 | | -### 4. Format and Lint |
172 | | - |
173 | | -```bash |
174 | | -# Format code |
175 | | -cargo fmt |
176 | | - |
177 | | -# Check formatting |
178 | | -cargo fmt --check |
179 | | - |
180 | | -# Run linter |
181 | | -cargo clippy |
| 66 | +make ci-check |
182 | 67 | ``` |
183 | 68 |
|
184 | | -### 5. Build and Run |
185 | | - |
186 | | -```bash |
187 | | -# Build |
188 | | -cargo build |
189 | | - |
190 | | -# Run |
191 | | -cargo run |
| 69 | +## Repository Layout |
192 | 70 |
|
193 | | -# Run example |
194 | | -cargo run --example basic |
195 | | -``` |
196 | | - |
197 | | -## Working with RDF Stores |
198 | | - |
199 | | -Janus is designed to work with multiple RDF stores. Here's how to set them up for development: |
200 | | - |
201 | | -### Oxigraph |
202 | | - |
203 | | -Start Oxigraph using Docker: |
204 | | - |
205 | | -```bash |
206 | | -docker run -d -p 7878:7878 --name oxigraph-server oxigraph/oxigraph |
207 | | -``` |
208 | | - |
209 | | -Or use the Makefile: |
210 | | - |
211 | | -```bash |
212 | | -make docker-oxigraph |
213 | | -``` |
| 71 | +- `src/api`: query lifecycle orchestration |
| 72 | +- `src/http`: REST and WebSocket server |
| 73 | +- `src/parsing`: Janus-QL parsing |
| 74 | +- `src/execution`: historical execution |
| 75 | +- `src/stream`: live stream processing |
| 76 | +- `src/storage`: segmented RDF storage |
| 77 | +- `src/bin`: executable binaries |
| 78 | +- `examples`: runnable examples and a minimal static demo |
| 79 | +- `tests`: integration coverage |
| 80 | +- `docs`: current docs plus older design notes |
214 | 81 |
|
215 | | -Oxigraph will be available at `http://localhost:7878` |
| 82 | +## Where to Read Next |
216 | 83 |
|
217 | | -### Apache Jena Fuseki |
218 | | - |
219 | | -Start Jena Fuseki using Docker: |
220 | | - |
221 | | -```bash |
222 | | -docker run -d -p 3030:3030 --platform linux/amd64 \ |
223 | | - -v $(pwd)/fuseki-config:/fuseki/configuration \ |
224 | | - -v $(pwd)/fuseki-config/shiro.ini:/fuseki/shiro.ini \ |
225 | | - --name jena-server stain/jena-fuseki |
226 | | -``` |
227 | | - |
228 | | -Or use the Makefile: |
229 | | - |
230 | | -```bash |
231 | | -make docker-jena |
232 | | -``` |
233 | | - |
234 | | -Fuseki will be available at `http://localhost:3030` |
235 | | - |
236 | | -### Starting Both Services |
237 | | - |
238 | | -```bash |
239 | | -make docker-start |
240 | | -``` |
241 | | - |
242 | | -### Stopping Services |
243 | | - |
244 | | -```bash |
245 | | -make docker-stop |
246 | | -``` |
247 | | - |
248 | | -## Adding Dependencies |
249 | | - |
250 | | -To add a new dependency, edit `Cargo.toml`: |
251 | | - |
252 | | -```toml |
253 | | -[dependencies] |
254 | | -# Add your dependency here |
255 | | -tokio = { version = "1.35", features = ["full"] } |
256 | | -``` |
257 | | - |
258 | | -Then run: |
259 | | - |
260 | | -```bash |
261 | | -cargo build |
262 | | -``` |
| 84 | +- `README.md` |
| 85 | +- `START_HERE.md` |
| 86 | +- `docs/DOCUMENTATION_INDEX.md` |
263 | 87 |
|
264 | 88 | ## Common Rust Commands |
265 | 89 |
|
|
0 commit comments