Repository navigation
C11: a NaN beside a decimal through PROV-O, in the property test and the caveat (#701) - #702
Merged
Merged
Conversation
…alue under one attribute, and the C11 test pins that shape beside the decimal NaN (spec 5, 3.6) rdflib's Turtle, TriG and N3 writers order a predicate's values and a Decimal has no order against a NaN, so the replayed Hypothesis example raised decimal.InvalidOperation; the exclusion is per attribute and for rdf only, and strategies.py keeps generating the shape for the other formats.
…s cannot order, and says the other RDF syntaxes write them (spec 5, 3.6) C11 named only a decimal NaN beside a number, while #701's failing shape is a NaN of another numeric datatype beside an xsd:decimal value, measured in spec 5 section 2.1.
…order without an ambiguous pronoun (spec 5, 3.6) The final review found "which" and "such a pair" in the two pages and "whichever comes first" in the pinning test's comment without a clear antecedent; the facts and the code are unchanged.
… well-formed decimal as the value a NaN cannot be ordered against, and the C11 tests' helpers and comments state what the model stores (spec 5, 3.6) The review regime measured rdflib's longturtle writer raising on both pairs and an ill-formed decimal text writing beside a NaN, so C11 and spec 3.6 name four writers and a well-formed decimal; a well-formed double NaN is stored as a float, so the helper's Literal arm tests xsd:float only; the pinning test's rows carry ids.
…two name sets, the decimal-text check reuses the decimal predicate, the RDF exclusions are two flat assumes, and spec 3.6 and 9 name the pinning test's second row (spec 5, 3.6) The generated documents the property test skips are unchanged; the NaN-beside-decimal helper drops three imports (defaultdict, Any and QualifiedName).
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 12 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
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.
rdflib's Turtle, long Turtle, TriG and N3 writers sort the values of each predicate, and a
Decimalhas no order against a NaN. A record holding a NaN of any numeric datatype beside anxsd:decimalvalue under one attribute therefore raisesdecimal.InvalidOperationwhen written to PROV-O in those syntaxes, as does a decimalNaNbeside any number. 3.2.3 behaves the same, and N-Triples, N-Quads, RDF/XML, JSON-LD, TriX, Hext and every other prov format write such a record. This is the documented limitation conformance caveat C11 describes, so there is no fix in prov or rdflib.The 3.3.0 property test
test_generated_record_roundtrips[rdf]found the double-NaN-beside-decimal shape, which C11's text did not name, and.hypothesis/examplesreplays it on every default-profile run. The test now skips, forrdfonly, a record with a NaN and anxsd:decimalvalue under one attribute; the exclusion sits in the test'sassume, sostrategies.pykeeps generating the shape for every other format. The C11 pinning test intest_value_forms.pycovers both shapes with four rows.C11 in
docs/reference/conformance.mdand its one-liner indocs/howto/provo-rdf.mdnow name both pairs, the four writers that raise and the syntaxes that write. Spec 5 section 3.6 records the same wording. No changelog entry: no library behaviour changes.Closes #701.