Normal JSON-LD structure is completely flat; there are no JSON objects as property values.
AS2 on the other hand mandates that there is only one JSON object at the root of the document. If you want multiple JSON objects to be represented, they must be nested. You can't use @graph.
This does some juggling of a normal JSON-LD document to rebuild it as an AS2-complient one. It hunts through the @graph for objects, and nests them wherever it finds each objects' id as a value.
TODO:
Handle if there's no AS2 properties.
Handle if there are things in the @graph with nowhere to nest them.
Normal JSON-LD structure is completely flat; there are no JSON objects as property values.
AS2 on the other hand mandates that there is only one JSON object at the root of the document. If you want multiple JSON objects to be represented, they must be nested. You can't use
@graph
.This does some juggling of a normal JSON-LD document to rebuild it as an AS2-complient one. It hunts through the
@graph
for objects, and nests them wherever it finds each objects'id
as a value.TODO:
@graph
with nowhere to nest them.