Visitar URL original
Converting an RDF object containing large number values to a JSON-LD object with usingNativeTypes · Issue #331 · jsonld-java/jsonld-java · GitHub
Skip to content

Converting an RDF object containing large number values to a JSON-LD object with usingNativeTypes #331

Open

Description

@imsdu

Hello,

When converting an RDF object with a number exceeding Integer.MAX_VALUE such as:

<https://example.com/data/> <https://example.com/field/contentSize> "6972682403840"^^<http://www.w3.org/2001/XMLSchema#integer>

To an JSON-LD object using the useNativeTypes option, the resulting json object will be:

[
  {
    "@id": "https://example.com/data/",
    "https://example.com/field//contentSize": [
      {
        "@value": "6972682403840"
      }
    ]
  }
]

Where the @value for contentSize is mapped to a string and not to a member.
Would it be ok to change this part and change the Integer for a Long ?
Or are there any consequence that I am missing ?

I can take care of the PR if needed.

Thanks :)

Activity

  1. dr0i commented on Mar 24, 2022

    @dr0i
    Member

    There is some discussion about elaborate on handling of JSON builtin types integer and double. The gist of it seems to be that, depending on the computer architecture you use, the range of long cannot always be 64bit (say on a 32bit cpu), even if xsd:long is defined to be of 64bit range. I am not deep into that discussion - maybe I don't have a proper understanding and you/others can dig and point to arguments to allow what you propose without breaking the specs.
    So atm I think this is a feature, not a bug. What dou you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions