Skip to content

Commit 97adc27

Browse files
committed
validation: Make checksum field RECOMMENDED over text
1 parent e4e27d7 commit 97adc27

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

extensions/stam-textvalidation/README.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,19 @@ RFC 2119.
1717
## Vocabulary
1818

1919
This extension defines an annotation dataset with ID `https://w3id.org/stam/extensions/stam-textvalidation/`.
20-
In this set we define the following keys, using either one of them is *RECOMMENDED* by this extension:
20+
In this set we define the following keys, the use of `checksum` over `text` is *RECOMMENDED* by this extension:
2121

22+
* ``checksum``: The SHA-1 checksum of the text of the annotation. We use SHA-1 because it is *fast* and *small enough* (40 bytes). It does not offer strong cryptographic security though.
2223
* ``text``: The exact text of the current annotation
2324
* ``delimiter``: The delimiter to use to concatenate text selections in case the current annotation has a complex selector. If this key is not supplied, concatenation *MUST* proceed without delimiter.
24-
* ``checksum``: The SHA-1 checksum of the text of the annotation. We use SHA-1 because it is *fast* and *small enough* (40 bytes). It does not offer strong cryptographic security though.
2525

2626
The advantage of `text` over `checksum` is that it is directly interpretable
27-
and facilitates readability of a serialisation. However, for large texts
28-
the overhead may become a nuisance and a `checksum` may be more appropriate.
27+
and facilitates readability of a serialisation. For any other purposes,
28+
the overhead quickly becomes a nuisance and a `checksum` is appropriate, the latter is therefore *RECOMMENDED*.
2929

3030
## Functionality
3131

3232
Parser implementations, whenever encountering a `text` or `checksum` key in an annotation's data,
3333
*MUST* verify if the text of the annotation matches the `text`
3434
property or the SHA-1 checksum in the `checksum` property. If not,
3535
implementations *SHOULD* raise a hard validation failure.
36-

0 commit comments

Comments
 (0)