projection.pl -- Define the projection
This module redefines variables that are included in the SWISH result set.
- projection(+Spec:list)
- Specify the result variables. Using projection/1 at the start of a
query specifies which variables are part of the result set, in what
order they are displayed and, optionally, whether the results must
be ordered on one or more variables or the solutions should be
distinct. Each element of Spec is one of the following:
- Var
- Include Var in the result. Var must appear in the remainder of the body.
- Var:Annotation
- As Var, respecting Annotation. Valid annotations are below.
Annotations may be abbreviated, e.g.
asc
,desc
- ascending
- Order solutions in ascending order.
- descending
- Order solutions is descending order
- distinct
- Remove duplicates wrt. this argument.
- AnnA + AnnB
- Multiple annotations
- + Var
- Equivalent to
Var:ascending
- - Var
- Equivalent to
Var:descending
If ordering is specified for multiple variables, the result set is ordered starting with the left-most variable for which ordering is defined.