-
Notifications
You must be signed in to change notification settings - Fork 30
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
How to get a struct from ld-json #29
Comments
Is this supported? Or there different ways to handle it in application. |
@dharmjit it depends on your use case and how you are using JSON-LD. As you may see from JsonLdProcessor interface, different JSON-LD operations return either map[string]interface{} or []interface{} or interface{}. After that, JSON-LD is just JSON. The easiest way to transform it into a specific structure is to perform a Marchall/Unmarshall operation with the JSON marshaller of your choice. Unfortunately, streaming JSON-LD is complicated and, currently, we don't support it. |
Is there an example somewhere that shows how to take a string that represents json-ld and gets it into a form that can be used by this library? |
@jaydonnell if you marshal your JSON string into interface{}, the library will be able to process it. |
For a document like:
How to get a struct like:
The text was updated successfully, but these errors were encountered: