SP QE

Semantic Pattern Operations & Query Expressions

Your data isn't in one place. SPOQE queries it where it lives.

As flexible as you need. As rigid as you like.

Answers in seconds, not in Sprints.

;; One query. Three backends. No ETL.
{:from [?t :mo/Track]
 :select {:title   [:dc/title]
          :artist  [:foaf/maker {:name [:foaf/name]}]
          :reviews [:chinook/reviews {:rating [:review/rating]}]}
 :filter (>= [:review/rating] 4)}

Federates across Fuseki (SPARQL), Postgres (SQL), and Elasticsearch — one query language, heterogeneous backends.

What SPOQE is

A compiler

Embed it in your app. Compile SPOQE to SPARQL or SQL, run it yourself. No server needed.

A federation service

Run it as a server. Query across SPARQL, SQL, Elasticsearch, Notion, and HTTP APIs with one request.

For agent builders

A wire protocol where queries, commands, and configuration are all data. Designed for LLM consumption with helpful errors.

For analysts

Your data isn't in one place, but it feels like it.

Federation across heterogeneous sources

SourceProtocolUse Case
Fuseki / VirtuosoSPARQLRDF knowledge graphs
Postgres / MySQLSQLTransactional data
ElasticsearchQuery DSLFull-text search
NotionREST APITeam knowledge bases
PubMed / arXivHTTP APIsExternal literature

Reusable patterns

Stop copy-pasting SQL fragments across Slack, Teams, and spreadsheets. Define once, use everywhere.

;; Define a reusable concept
(defmacro active-customer? [c]
  (exists {:from [:orders]
           :where (and (= [:customer_id] c)
                       (> [:order_date] (- (now) (days 90))))}))

;; Use it in any query
{:from [?c :sales/Customer]
 :where [(active-customer? ?c)]
 :select {:name [:customer/name]}}

Explain is executable

No hidden magic. See exactly what will execute. Copy-paste it. Override it.

;; Ask what will happen
{:explain {:from [?t :mo/Track] :select {:title [:dc/title]} :limit 5}}

;; Returns the actual plan
{:strategy :direct-sparql
 :source   :kg
 :endpoint "http://localhost:3031/chinook/query"
 :spoqe/sparql "SELECT ?title WHERE { ?t a mo:Track . ?t dc:title ?title } LIMIT 5"}

Escape hatches

SPOQE never becomes a prison. Override any part of the generated output.

;; Override with raw SPARQL
{:from [?t :mo/Track] :spoqe/sparql "SELECT ..."}

;; Override with raw SQL
{:from [?c :Customer] :spoqe/sql "SELECT ..."}

;; Override the entire plan
{:spoqe/plan [{:query {...} :source :kg}
              {:query {...} :source :sales}]}

How it works

Status