Skip to content
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

Improve type-checking for JSON values #51

Open
rubensworks opened this issue Jun 14, 2021 · 1 comment
Open

Improve type-checking for JSON values #51

rubensworks opened this issue Jun 14, 2021 · 1 comment

Comments

@rubensworks
Copy link
Member

Issue type:

  • ➕ Feature request

Description:

In 08b7950, we introduced the rdf:JSON param range, which allows users to pass arbitrary JSON values.
While useful for many cases, this strips away any kind of type-checking,
which may result in cases where an unexpected JSON shape is received.

Example where myParam expects a Record<string, string>:

{
  "@id": "ex:myInstance",
  "@type": "ex:MyClass",
  "ex:myParam": {
    "key1": "value1",
    "key2": "value2"
  }
}

So this would have to be converted into:

<ex:myInstance> a ex:MyClass;
  ex:myParam [ ex:key "key1"; ex:value "value1" ],
             [ ex:key "key2"; ex:value "value2" ].

AFAICS, JSON-LD currently doesn't support such functionality.

JSON-LD's property-based data indexing already gets us partially there (defining the key's as index range), but the keys would not allow direct values in that case.

@github-actions
Copy link

Thanks for the suggestion!

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

No branches or pull requests

1 participant