The logical view pipeline¶
CARML evaluates every mapping as a logical view. There is one code path, whether or not the mapping declares a view.
Explicit and implicit views¶
A logical view (rml:LogicalView) describes a source as a table: named fields, nested
iteration, and joins to other views. A triples map can use one as its rml:logicalSource.
When a triples map uses a plain rml:LogicalSource instead, CARML builds the view for it:
- each reference expression the triples map uses becomes a field with the same name,
- each
rml:parentTriplesMapwith a join condition becomes a left join.
flowchart TD
A[Triples maps] --> B{logical source is a view?}
B -- yes --> C[use the declared view]
B -- no --> D[build a view from the logical source]
C --> E[evaluator, chosen per view]
D --> E
E --> F[view rows]
F --> G[RDF terms]
G --> H["Flux<Statement>"]
Before evaluation CARML orders the triples maps so that a parent comes before the maps that refer to it. A cycle of
rml:parentTriplesMap references is an error.
What applies to which mappings¶
For every mapping:
- an evaluator is chosen per view,
- joins are run by that evaluator,
- the deduplication mode you set is applied,
- the reactive evaluator reads each source once. In a run with more than one triples map, or any join, it keeps the source's records in memory.
Only for declared views that carry structural annotations:
- Skipping deduplication. A primary key, or a unique key whose fields are not null, proves that rows are distinct.
- Left join to inner join. This happens when the child's join fields are not null and a foreign key or inclusion annotation maps them to the parent's join fields, so every child row has a match.
- Join removal. A join is dropped when no field of the join is used and a foreign key maps the child's join fields to the parent's join fields. An inner join also needs the child's join fields to be not null.
- Self-join removal. A join between two views on the same logical source, on fields that are a key of the parent, is replaced by reading the fields from the same row.
- View decomposition. Predicate-object maps are grouped by the key that determines their fields, and each group is evaluated over only the fields it needs.
A view that CARML builds from a plain logical source has no annotations, so none of the second list applies to it.