You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2.3.4 Omit graph flag
The omit graph flag determines if framed output containing a single node object is contained within @graph, or not. The initial value for the omit graph flag is set using the omitGraph option, or based on the processing mode; if processing mode is json-ld-1.0, the output always includes a @graph member, otherwise, the @graph member is used only to describe multiple node objects, consistent with compaction. See § 4.2.2 Framing Algorithm for a further discussion.
which seems to indicate "@graph member is used only to describe multiple node".. But what do I do if I want no graph at all and I just want a list of the objects?
You use uri instead of the JSON-LD keyword @id to indicate the URI of a node.
However, if I use a valid context (like https://schema.org for testing purpose) and @id you won't get rid of the @graph anyway because you have two distinct nodes (http://test1 and http://test2) which are not linked to each other so that one description can not be embedded in the other and @graph becomes necessary.
When I put this in the playground and add a JSON-LD frame with the node of type metaframe:MetadataDictionary as root object and @embed": "@always", there will still be two separate nodes that need a @graph around them to be represented as JSON-LD. See https://tinyurl.com/246b6sfp.
Activity
acka47 commentedon Jun 8, 2021
I see several reasons the data couldn't be processed as you wish:
@contextlinks do not point to valid JSON-LD context files (see also the JSON-LD playground)uriinstead of the JSON-LD keyword@idto indicate the URI of a node.@idyou won't get rid of the@graphanyway because you have two distinct nodes (http://test1andhttp://test2) which are not linked to each other so that one description can not be embedded in the other and@graphbecomes necessary.Here is some correct JSON-LD for testing:
{ "@context":"https://schema.org", "@graph":[ { "@id":"http://test1", "type":"metaframe:MetadataDictionary", "metaDataConcepts":{ "@id":"http://testc1", "type":"metaframe:ClassConcept", "primaryKey":[ { "@id":"http://pk1", "type":"metaframe:PrimaryKey", "priority":"5" }, { "@id":"http://pk2", "type":"metaframe:PrimaryKey", "priority":"6" } ] }, "title":"test1" }, { "@id":"http://test2", "type":"metaframe:MetadataDictionary", "title":"test2" } ] }When I put this in the playground and add a JSON-LD frame with the node of type
metaframe:MetadataDictionaryas root object and@embed": "@always", there will still be two separate nodes that need a@grapharound them to be represented as JSON-LD. See https://tinyurl.com/246b6sfp.dr0i commentedon Jun 15, 2021
@acka47 thx for clarification/explanation! Very detailed :)
@garpinc is this helpful to solve your problem?