Skip to content

Duplicate resource in JSON-LD frame output with embed=LAST #332

@pvojtechovsky

Description

@pvojtechovsky

The framing algorithm sometime keeps two occurrences of the resource with all attributes even if embed=LAST.
Json-LD input

{
	"@context" : {
		"@vocab" : "http://www.example.net/"
	},
	"@id": "#doc",
	"@type": "Document",
	"content": {
		"@list": [
			{
				"@id": "#question",
				"@type": "Question",
				"label" : "Why am I here twice?"
			},
			{
				"@id": "#block",
				"predicate": {
					"@id": "#question"
				}
			}
		]
	}
}

Frame:

{
	"@context" : {
		"@vocab" : "http://www.example.net/"
	},
	"@type" : "Document"
}

Cuttent buggy output:

{
  "@context" : {
    "@vocab" : "http://www.example.net/"
  },
  "@graph" : [ {
    "@id" : "#doc",
    "@type" : "Document",
    "content" : {
      "@list" : [ {
        "@id" : "#question",
        "@type" : "Question",                       //This attr should not be here, it is printed later
        "label" : "Why am I here twice?"       //This attr should not be here, it is printed later
      }, {
        "@id" : "#block",
        "predicate" : {
          "@id" : "#question",
          "@type" : "Question",
          "label" : "Why am I here twice?"
        }
      } ]
    }
  } ]
}

I will make PR with failing test case soon and link it here

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