This note records the current direction for making SPARQL evaluation stop assuming that an RDF graph is just a plain in-memory list of triples.
Today the algebra layer effectively assumes:
let graph_triples (g : rdf_graph) : list triple = g
That means:
list tripleThis is acceptable for parser validation and small examples, but it does not scale to larger corpora.
Keep the SPARQL algebra and value semantics in F*, but put a storage/query boundary underneath them.
The default in-memory representation should not remain an unindexed
list triple for normal query execution.
Factoidal should keep rdf_graph = list triple as the logical, portable RDF
graph representation used for parser output, semantic tests, small examples,
and proof-friendly graph operations. That representation is simple and remains
the easiest place to express RDF graph set semantics.
The default runtime backend for SPARQL evaluation, however, should be an indexed in-memory graph store built from that logical graph:
(subject_id, predicate_id, object_id) rowsstore_search boundary as RDF termsThis means callers should not have to choose between "correct list semantics" and "usable query execution." The list graph remains the semantic baseline; the indexed memory store becomes the ordinary ephemeral backend for parsed data.
GB_List should remain available as a compatibility and testing backend, but it
should not be the long-term default for data loaded for querying.
The first implementation target is:
eval_single_tp call the store API rather than directly scanning the
graph listThat gives us a seam for later backends such as HDT, HDTQ-style dataset stores, and COTTAS-style columnar quad stores.
The same seam should also support future SQL-backed storage, especially:
The algebra should target a storage interface, not an HDT-only worldview. That same interface family should be able to host:
Factoidal should not be treated as one monolithic always-live SPARQL dataset.
The better model is:
In that model:
This means named graphs are not merely SPARQL syntax. They become units of:
HDT should be treated as a physical storage backend, not as a parser replacement.
For now the safer dataset design is:
This avoids making correctness depend on HDT-native quad support.
For quad-aware storage, the native target should be an F*-defined HDTQ-style dataset backend, not an opaque external engine. See also:
For the current dataset-storage focus, COTTAS should be treated as a first-class native target too:
Yes, in principle, but there are two distinct meanings:
The first is easier. We already own the RDF term and triple structures, so an F*/OCaml backend could serialize:
The second is harder because it means conforming to HDT container and index structure, not just inventing our own binary store.
Recommended stance:
Yes, conceptually.
The useful split is:
That physical layer could be:
So the abstraction should not be named too narrowly around files. It should be closer to:
This allows one API to cover:
Yes. The same store abstraction should support:
That implies that Corpus eventually needs a runtime representation as well as
an on-disk layout. The runtime representation should not assume every graph
comes from an HDT file.
triple_pattern_bound, graph_store, and rdf_dataset_store
types in the algebra layer.eval_single_tp to use store_search.list triple just to keep the types simple.docs/cottas-format-v1.md — the
COTTAS-on-Parquet v1 spec defines what a COTTAS-backed dataset
store reads from disk.