Skip to content

Nested @context definition returns an error #76

@MikePlayle

Description

@MikePlayle

Minimal test program:

package main

import (
	"encoding/json"
	"fmt"
	"github.com/piprate/json-gold/ld"
)

var json_text = `{"@context":["https://www.w3.org/ns/activitystreams","https://w3id.org/security/v1",{"@context":{"PropertyValue":"http://schema.org/#PropertyValue"}}],"id":"https://foo.bar/baz","type":"Group"}`

func main() {
	var json_data map[string]interface{}
	json.Unmarshal([]byte(json_text), &json_data)

	processor := ld.NewJsonLdProcessor()
	options := ld.NewJsonLdOptions("")

	_, err := processor.Expand(json_data, options)
	fmt.Printf("processor.Expand: %s\n", err)
}

Observed result: processor.Expand: keyword redefinition: @context

Expected result: I'm told this is legal, and https://json-ld.org/playground/ accepts it, so json-gold should accept this and return success.

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