I am trying to unmarshall JSON-LD using package https://godoc.org/github.com/emersion/go-jsonld
package main
import (
"fmt"
jsonld "github.com/emersion/go-jsonld"
)
func main() {
text := `{"@context": ["http://schema.org", { "image": { "@id": "schema:image", "@type": "@id"} }],"id": "http://www.wikidata.org/entity/Q76","type": "Person","name": "Barack Obama","givenName": "Barack","familyName": "Obama","jobTitle": "44th President of the United States","image": "https://commons.wikimedia.org/wiki/File:President_Barack_Obama.jpg"}`
textBytes := []byte(text)
var container interface{}
err := jsonld.Unmarshal(textBytes,container)
fmt.Println("Error while unmarshalling json-ld: ",err.Error())
fmt.Println("Output: ",container)
}
Output
Error while unmarshalling json-ld: jsonld: fetching remote contexts is disabled
Output: <nil>
I also checked other function for unmarshalling in same package like func UnmarshalWithContext(b []byte, v interface{}, ctx *Context) error but no help.
UnmarshalWithContextis unrelated to fetching remote data.