You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi ruben! Thanks so much for this (and many other) jsonld libraries that are enabling my work.
In my use-case I would like to use this lib to parse a context remotely, then insert it into jsonld-serializer-ext, which relies on jsonld@8 library. Based on values passed around I would expect to be able to call parse() and then getContextRaw().
This generally works but causes runtime errors because of the containerToHash method; in parsing a context, the jsonld.js library expects the @container to point to an Array or string, but the normalizedRaw puts out values of form `'@container': { '@language': true}'
Is there a step I am missing to get the normalized / raw context back out of this parser as an object with the standard @container : Array | string?
The example i am working with is here. For example I get
out of the contextRaw. I see in #40 that you suggest this is for performance reasons, maybe i am just missing how to get back out of this form..! Thank you.
The text was updated successfully, but these errors were encountered:
Is there a step I am missing to get the normalized / raw context back out of this parser as an object with the standard @container : Array | string?
Unfortunately this library doesn't support this yet. The raw context is just an internal representation structured for optimal performance, so it's not valid according to the JSON-LD context spec.
Serializing back to a valid context would be possible, but that would require changing the structure of things like @container.
thanks Ruben! After reviewing this I have found a workaround by relying on some native behavior in jsonld.js that I call directly. I will track this issue in case the export becomes implemented in future.
Hi ruben! Thanks so much for this (and many other) jsonld libraries that are enabling my work.
In my use-case I would like to use this lib to parse a context remotely, then insert it into
jsonld-serializer-ext
, which relies onjsonld@8
library. Based on values passed around I would expect to be able to callparse()
and thengetContextRaw()
.This generally works but causes runtime errors because of the
containerToHash
method; in parsing a context, thejsonld.js
library expects the@container
to point to an Array or string, but thenormalizedRaw
puts out values of form `'@container': { '@language': true}'Is there a step I am missing to get the normalized / raw context back out of this parser as an object with the standard
@container : Array | string
?The example i am working with is here. For example I get
out of the contextRaw. I see in #40 that you suggest this is for performance reasons, maybe i am just missing how to get back out of this form..! Thank you.
The text was updated successfully, but these errors were encountered: