Skip to content

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

@imsdu

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 :)

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