Tool in Mylly: Relation algebra / Part that does not match | fi
Part that does not match another relation
The ”miss” operation takes two relations and produces those records of the first that do not match the shared attributes of any record of the second.
The input and output relations are represented as TSV files.
Example
The first input relation consists of some word forms annotated with a lemma, a sentence number, and a token number. The second input relation consists of sentence numbers annotated with the mood of a sentence.
sen | tok | lemma | word |
---|---|---|---|
3 | 3 | niin | niin |
3 | 2 | se | se |
3 | 1 | olla | on |
5 | 1 | olla | on |
sen | mood |
---|---|
3 | calm |
4 | calm |
5 | angry |
The output relation consists of those records of the first input relation that did not have their sentence number in any record of the second input relation (none of them).
tok | sen | lemma | word |
---|
On the other hand, reversing the roles of the input relations produces those records of the second relation (the one that annotates sentence numbers with moods) that have no corresponding token in the first relation (sentence 4).
sen | mood |
---|---|
4 | calm |
Related tools
See also
- Relation algebra for context