Open miahmohd opened 3 years ago
I have a json-ld that contains a 2d list, and I'm struggling to frame it correctly.
[ { "@id":"http://example.com/resource/Conversation1", "@type":[ "http://example.com/ontology/Conversation" ], "http://example.com/ontology/triggers":[ { "@list":[ { "@id":"http://example.com/resource/Trigger1" } ] } ] }, { "@id":"http://example.com/resource/Trigger1", "@type":[ "http://example.com/ontology/Trigger" ], "http://example.com/ontology/formula":[ { "@list":[ { "@list":[ { "@id":"http://example.com/resource/pred1" }, { "@id":"http://example.com/resource/pred2" } ] }, { "@list":[ { "@id":"http://example.com/resource/pred3" } ] } ] } ], "http://example.com/ontology/next":[ { "@value":"Next" } ] }, { "@id":"http://example.com/resource/pred1", "@type":[ "http://example.com/ontology/PredType" ], "http://example.com/ontology/negate":[ { "@value":false } ] }, { "@id":"http://example.com/resource/pred2", "@type":[ "http://example.com/ontology/PredType" ], "http://example.com/ontology/negate":[ { "@value":true } ] }, { "@id":"http://example.com/resource/pred3", "@type":[ "http://example.com/ontology/PredType" ], "http://example.com/ontology/negate":[ { "@value":false } ] } ]
The frame I used:
{ "@context":{ "@version":1.1, "@base":"http://example.com/resource/", "@vocab":"http://example.com/ontology/", "formula":{ "@container":"@list" }, "triggers":{ "@container":"@list" } }, "@type":"Conversation", "triggers":{ "@type":"Trigger", "formula":{ "@embed":"@always", "@type":"PredType" } } }
{ "@context":{ "@version":1.1, "@base":"http://example.com/resource/", "@vocab":"http://example.com/ontology/", "formula":{ "@container":"@list" }, "triggers":{ "@container":"@list" } }, "@id":"Conversation1", "@type":"Conversation", "triggers":[ { "@id":"Trigger1", "@type":"Trigger", "formula":[ [ { "@id":"pred1" }, { "@id":"pred2" } ], [ { "@id":"pred3" } ] ], "next":"Next" } ] }
{ "@context":{ "@version":1.1, "@base":"http://example.com/resource/", "@vocab":"http://example.com/ontology/", "formula":{ "@container":"@list" }, "triggers":{ "@container":"@list" } }, "@id":"Conversation1", "@type":"Conversation", "triggers":[ { "@id":"Trigger1", "@type":"Trigger", "next":"Next", "formula":[ [ { "@id":"pred1", "@type":"PredType", "negate":false }, { "@id":"pred2", "@type":"PredType", "negate":true } ], [ { "@id":"pred3", "@type":"PredType", "negate":false } ] ] } ] }
I can't find a way to embed the nodes inside formula properly, how can I make it work?
formula
I have a json-ld that contains a 2d list, and I'm struggling to frame it correctly.
The flattened (input) json:
The frame I used:
The output generated:
The output I want is:
I can't find a way to embed the nodes inside
formula
properly, how can I make it work?