docs: describe the round-trip guarantee and how it is tested - #3
Merged
Conversation
The "how it works" list described idiomatic re-serialization as the final step and said all triples are preserved. Since 0.0.2 there is a fourth step - the output is re-parsed and required to be isomorphic to the input - and the preservation claim is now something the library enforces rather than something the reader has to trust. Worth documenting explicitly because the behaviour it guards against is invisible: Turtle's compact collection syntax cannot express a list whose tail is shared, so for those graphs the idiomatic form silently dropped or duplicated triples while still parsing cleanly (#1). A consumer reading the old README would have had no reason to suspect that, or to know that output is now occasionally more verbose than "idiomatic" implies, and why. Also adds the four properties the test suite asserts - lossless, idempotent, blank-node-label-independent, triple-order-independent - since correctness is what this library is for, and a reader deciding whether to depend on it should be able to see what is actually checked. Signed-off-by: jdsika <carlo.van-driesten@vdl.digital>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Documentation only; no code changes.
The "how it works" list stopped at idiomatic re-serialization and stated that all triples are
preserved. Since 0.0.2 there is a fourth step — the output is re-parsed and required to be
isomorphic to the input — and preservation is enforced by the library rather than asserted in
prose.
That is worth stating explicitly because the failure it guards against is invisible: Turtle's
compact
( … )syntax cannot express a list whose tail is shared, so for those graphs theidiomatic form silently dropped or duplicated triples while still parsing cleanly (#1). It also
explains why output is occasionally more verbose than "idiomatic" would suggest — the fallback to
explicit
rdf:first/rdf:rest— which a consumer would otherwise notice without knowing why.Adds a short section listing the four properties the suite asserts (lossless, idempotent,
label-independent, order-independent) and the supporting checks, so someone deciding whether to
depend on this can see what is actually verified rather than inferring it from the changelog.