linked-data-dotnet/json-ld.net

lists of objects don't appear to frame correctly

Closed this issue · 2 comments

The following flattened and expanded JSON:

[
  {
    "@id": "http://tempuri.org/schema#sub0",
    "@type": [
      "http://tempuri.org/schema#Class"
    ],
    "http://tempuri.org/schema#prop0": [
      {
        "@list": [
          {
            "@id": "http://tempuri.org/schema#hello"
          },
          {
            "@id": "http://tempuri.org/schema#world"
          }
        ]
      }
    ]
  },
  {
    "@id": "_:autos1",
    "http://www.w3.org/1999/02/22-rdf-syntax-ns#first": [
      {
        "@id": "http://tempuri.org/schema#hello"
      }
    ],
    "http://www.w3.org/1999/02/22-rdf-syntax-ns#rest": [
      {
        "@id": "_:autos2"
      }
    ]
  },
  {
    "@id": "_:autos2",
    "http://www.w3.org/1999/02/22-rdf-syntax-ns#first": [
      {
        "@id": "http://tempuri.org/schema#world"
      }
    ],
    "http://www.w3.org/1999/02/22-rdf-syntax-ns#rest": [
      {
        "@id": "http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"
      }
    ]
  },
  {
    "@id": "http://tempuri.org/schema#hello",
    "http://tempuri.org/schema#prop1": [
      {
        "@value": "Hello"
      }
    ]
  },
  {
    "@id": "http://tempuri.org/schema#world",
    "http://tempuri.org/schema#prop1": [
      {
        "@value": "World"
      }
    ]
  }
]

With the frame:

{
    "@context" : { 
        "ns" : "http://tempuri.org/schema#",

        "prop0" : { "@container" : "@list" },

        "@vocab" : "http://tempuri.org/schema#"
    },
    "@type" : "ns:Class"
} 

Should produce a framed form like this, according to the json-ld playground

{
  "@context": {
    "ns": "http://tempuri.org/schema#",
    "prop0": {
      "@container": "@list"
    },
    "@vocab": "http://tempuri.org/schema#"
  },
  "@graph": [
    {
      "@id": "ns:sub0",
      "@type": "Class",
      "prop0": [
        {
          "@id": "ns:hello",
          "prop1": "Hello"
        },
        {
          "@id": "ns:world",
          "prop1": "World"
        }
      ]
    }
  ]
}

However it appears to drop the nested objects, just leaving their links

{
  "@id": "ns:sub0",
  "@type": "Class",
  "prop0": [
    {
      "@id": "ns:hello"
    },
    {
      "@id": "ns:world"
    }
  ],
  "@context": {
    "@vocab": "http://tempuri.org/schema#",
    "ns": "http://tempuri.org/schema#",
    "prop0": {
      "@id": "ns:prop0",
      "@container": "@list"
    }
  }
}

Investigation so far seems to indicate there were two distinct bugs here.
BUG 1. The JsonLdIntegration piece leaves RDF list nodes in the flattened output it is creating.
BUG 2. Even after removing these unconnected nodes the JsonLdProcessor appears not to walk into the subtree as described in this bug.
(Incidentally regarding BUG 1. I think it should have been harmless. i.e. ignored in later steps. But its noise anyhow.)

BUG 2 looks like a bug in the JsonLdProcessor.