-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(closes #555) Fall back to default logic in useNativeTypes
mode for RDF numbers which are not JSON numbers
#625
base: main
Are you sure you want to change the base?
(closes #555) Fall back to default logic in useNativeTypes
mode for RDF numbers which are not JSON numbers
#625
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor changes, but this direction seems like the way to go.
fd7684b
to
3b61a1b
Compare
|
This was discussed during the #json-ld meeting on 15 January 2025. View the transcriptw3c/json-ld-api#625anatoly-scherbakov: this is the new version of w3c/json-ld-api#619 ; thanks gkellogg and pchampin for your suggestions. gkellogg: it's a fairly small change. anatoly-scherbakov: I can not wrap a whole block in <ins> or <del>, right? bigbluehat: correct, they are 'inline'. Is there a specific class to use? gkellogg: there are other things to put in place. Respec documentation for them is not great, but there are examples in the same doc. anatoly-scherbakov: what is the use-case for this marking? gkellogg: it is there for reviewers of the specification, because we are editing a published Recommendation. anatoly-scherbakov: an HTML diff will not be enough for the reviewers? gkellogg: no, they do not expect to look at HTML raw code. <gkellogg> https://www.w3.org/policies/process/#candidate-amendments bigbluehat: this is required until we recharter. The alternative is to keep a bunch of open PR and merge them only after we recharter. |
There’s additional markup needed to show the controls for candidate change ins/del. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the other markup necessary, and called it Candidate Correction 5.
…ted to JSON number, fall back to default logic
…iveTypes` mode
62e7730
to
33a652b
Compare
Needs a review from @pchampin. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay. I'm approving this PR because the spec text now looks good, and to avoid more delay in back-and-forth...
However, the new test must be amended per my comment, as currently it is both buggy and non-compliant.
}, | ||
{ | ||
"@type": "http://www.w3.org/2001/XMLSchema#decimal", | ||
"@value": 1.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
}, | |
{ | |
"@type": "http://www.w3.org/2001/XMLSchema#decimal", | |
"@value": 1.1 |
This must be removed for two reasons:
-
the spec only tells to convert
xsd:integer
andxsd:double
, and for a good reason (see below), so this part of the test is actually not complying with the spec; -
xsd:decimal
s should never be converted to JSON native number because they do not round-trip: this one is converted back to "1.1E0"^^xsd:decimal, which is ill-formed (xsd:decimal does not support scientific notation in its lexical space).
<http://example.com/boolean-object> <http://example.com/example> "False"^^<http://www.w3.org/2001/XMLSchema#boolean> . | ||
|
||
<http://example.com/number-native> <http://example.com/example> "1"^^<http://www.w3.org/2001/XMLSchema#integer> . | ||
<http://example.com/number-native> <http://example.com/example> "1.1"^^<http://www.w3.org/2001/XMLSchema#decimal> . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<http://example.com/number-native> <http://example.com/example> "1.1"^^<http://www.w3.org/2001/XMLSchema#decimal> . |
Must be removed (see my comment on 0027-out.jsonld
below).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tiny language fixes
@@ -5456,6 +5456,12 @@ <h3>Algorithm</h3> | |||
<li>Initialize <var>converted value</var> to <var>value</var>.</li> | |||
<li>Initialize <var>type</var> to <code>null</code></li> | |||
<li>If <a data-link-for="JsonLdOptions">useNativeTypes</a> is <code>true</code> | |||
<div class="candidate correction" id="change_5"> | |||
<span class="marker">Candidate Correction 5</span> | |||
<p>This changes the behavior of using native numbers when <a data-link-for="JsonLdOptions">useNativeTypes</a> is `true`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<p>This changes the behavior of using native numbers when <a data-link-for="JsonLdOptions">useNativeTypes</a> is `true`. | |
<p>This changes behavior when using native numbers where <a data-link-for="JsonLdOptions">useNativeTypes</a> is `true`. |
<ol> | ||
<li> | ||
Attempt to convert the <a>lexical form</a> to a <a>JSON number</a> | ||
according to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
according to | |
according to the |
This is my second attempt to fix this issue after #619.
Preview | Diff