Skip to content

Fix use native types flag with non-native values#671

Open
niklasl wants to merge 4 commits into
w3c:mainfrom
niklasl:fix-use-native-types-issue-670
Open

Fix use native types flag with non-native values#671
niklasl wants to merge 4 commits into
w3c:mainfrom
niklasl:fix-use-native-types-issue-670

Conversation

@niklasl

@niklasl niklasl commented Nov 18, 2025

Copy link
Copy Markdown
Contributor

This addresses #670.

  • Add test case
  • Implement fix in algorithm

Preview | Diff

@niklasl

niklasl commented May 20, 2026

Copy link
Copy Markdown
Contributor Author

Unless there is a better idea for refactoring the spec algorithm in this place (see #670), I'll probably implement the fix similarly to how I'll fix it in TRLD: niklasl/trld@a66feee (i.e. add a done converting flag).

@niklasl

niklasl commented Jun 5, 2026

Copy link
Copy Markdown
Contributor Author

I made a possibly cleaner approach in niklasl/trld@5fe0981 (explained in that commit message). Any feedback welcome; I'll probably proceed with fixing the spec algorithm accordingly in the coming week.

Test use native types flag with non-native values.
@niklasl niklasl force-pushed the fix-use-native-types-issue-670 branch from 5185051 to ad93494 Compare June 5, 2026 22:41
niklasl added 2 commits June 6, 2026 15:33
When useNativeTypes is true, the else clause was never reached even if a
native type couldn't be used; leaving only plain strings where e.g.
language-tagged string literals were the source.

This is a slight refactoring of the RDF to Object Conversion algorithm,
to address this issue, whilst keeping or improving the clarify of the
algorithm.

Fixes w3c#670
@niklasl niklasl marked this pull request as ready for review June 6, 2026 14:12
@niklasl

niklasl commented Jun 6, 2026

Copy link
Copy Markdown
Contributor Author

I've now implemented what I see as an acceptable fix, both in TRLD: niklasl/trld#5 (which now passes all fromRdf tests including the one added in this PR); and as a proposed spec change in this PR.

It is a slight refactoring of the RDF to Object Conversion algorithm, to address this issue whilst also keeping or seeking to improve the clarify of the algorithm.

Comment thread index.html Outdated
Comment thread index.html
and {{JsonLdOptions/rdfDirection}} is `i18n-datatype`:
<ol>
<li>If the string prefix of the <a data-cite="RFC3986#section-3.5">fragment identifier</a>
of the <a>datatype IRI</a> up until the underscore (`"_"`) is not empty,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
of the <a>datatype IRI</a> up until the underscore (`"_"`) is not empty,
of the <a>datatype IRI</a> up until the underscore ("`_`") is not empty,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a total of 11 occurrences of:

underscore (`"_"`)

in this document. I suggest making a separate PR to change this, rather than make this the odd one out.

Co-authored-by: Ted Thibodeau Jr <tthibodeau@openlinksw.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Development

Successfully merging this pull request may close these issues.

4 participants