Skip to content

framing with "@embed": "@link" cannot handle circular references #64

@bpow

Description

@bpow

Framing with "@embed": "@link" has been proposed as one way to create an in-memory representation of a graph (as discussed in json-ld/json-ld.org#140 ).

jsonld.js does this in a way that handles circular references, but when I try to use pyld to frame:

{
  "@context": "http://schema.org/",
  "@type": "Person",
  "name": "Jane Doe",
  "jobTitle": "Professor",
  "telephone": "(425) 123-4567",
  "@id": "http://www.janedoe.com",
  "knows": {
    "name": "John Smith",
    "@type": "Person",
    "@id": "http://www.johnsmith.me",
    "knows": {
      "@id": "http://www.janedoe.com"
    }
  }
}

with a frame like:

{
  "@context": "http://schema.org",
  "@embed": "@link"
}

... I get a RuntimeError from exceeding the recursion limit.

I also demonstrate this in a gist

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions