src/swipl-devel/packages/xpce/man/refmanual/md/relation_table.md

class relation_table {#class-relation_table}

Class table defines a multi-column table with various indexing mechanisms. Each row of the table is formed by a vector object. The rows are not ordered and rows (vectors) may be selected quickly using index tables. Each column may be declared in three modes:

| unique-key | Indexed and no duplicates         |
| key        | Indexed, possible duplicates      |
| otherwise  | Not indexed (may have duplicates) |

The following example defines a 1 to n mapping between persistent objects (called p) and their visualisations (called v):

?- new(T, table(vector(p, v),
                vector(unique, key)).

@see class hash_table @see class vector

Instance variables {#class-relation_table-instvars}

Send methods {#class-relation_table-send}

Get methods {#class-relation_table-get}



Try the rswipl package in your browser

Any scripts or data that you put into this service are public.

rswipl documentation built on June 16, 2026, 5:07 p.m.