Skip to content

use the JSON primitive types for Boolean, Integer, Number in compaction output #554

Description

@fennibay

Currently JSON-LD compaction always outputs the values as strings, even when the @type is specified to be a primitive type such as xsd:boolean, xsd:integer and xsd:double.

It would be nicer for JSON parsers that such values would be available as native JSON Booleans, Integers and Numbers.

Basically I'm proposing to introduce a useNative flag in compaction options, similar to fromRdf and Normalize.

See also:

edit: removed Null from the proposal, that doesn't have a corresponding xsd type.

Activity

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