|
189 | 189 | :coercion ^:replace query-coercer |
190 | 190 | :handler #'ledger/query}) |
191 | 191 |
|
| 192 | +(def ledger-query-endpoint |
| 193 | + {:summary "Endpoint for submitting queries to a specific ledger" |
| 194 | + :parameters {:body QueryRequestBody |
| 195 | + :path [:map [:ledger-alias :string]]} |
| 196 | + :responses {200 {:body QueryResponse} |
| 197 | + 400 {:body ErrorResponse} |
| 198 | + 500 {:body ErrorResponse}} |
| 199 | + :coercion ^:replace query-coercer |
| 200 | + :handler #'ledger/query}) |
| 201 | + |
192 | 202 | (def history-endpoint |
193 | 203 | {:summary "Endpoint for submitting history queries" |
194 | 204 | :parameters {:body HistoryQuery} |
|
299 | 309 | (select-keys fluree-request-header-keys) |
300 | 310 | (update-keys (fn [k] (keyword (subs k request-header-prefix-count))))) |
301 | 311 |
|
| 312 | + ;; SPARQL protocol headers for graph specification |
| 313 | + from (get headers "default-graph-uri") |
| 314 | + from-named (get headers "named-graph-uri") |
| 315 | + using (get headers "using-graph-uri") |
| 316 | + using-named (get headers "using-named-graph-uri") |
| 317 | + |
302 | 318 | max-fuel (when max-fuel |
303 | 319 | (try (Integer/parseInt max-fuel) |
304 | 320 | (catch Exception e |
|
371 | 387 | max-fuel (assoc :max-fuel max-fuel) |
372 | 388 | format (assoc :format format) |
373 | 389 | output (assoc :output output) |
| 390 | + from (assoc :from from) |
| 391 | + from-named (assoc :from from-named) |
| 392 | + using (assoc :using using) |
| 393 | + using-named (assoc :using using-named) |
374 | 394 | ledger (assoc :ledger ledger) |
375 | 395 | policy (assoc :policy policy) |
376 | 396 | policy-class (assoc :policy-class policy-class) |
|
561 | 581 | {:get query-endpoint |
562 | 582 | :post query-endpoint}]) |
563 | 583 |
|
| 584 | +(def fluree-ledger-query-routes |
| 585 | + ["/query/{*ledger-alias}" |
| 586 | + {:post ledger-query-endpoint}]) |
| 587 | + |
564 | 588 | (def fluree-history-routes |
565 | 589 | ["/history" |
566 | 590 | {:get history-endpoint |
|
599 | 623 | :update fluree-update-route |
600 | 624 | :transact fluree-transact-routes |
601 | 625 | :query fluree-query-routes |
| 626 | + :ledger-query fluree-ledger-query-routes |
602 | 627 | :history fluree-history-routes |
603 | 628 | :remote fluree-remote-routes |
604 | 629 | :subscription fluree-subscription-routes}) |
|
0 commit comments