json-ld / json-ld.org

JSON for Linked Data's documentation and playground site
https://json-ld.org/
Other
859 stars 152 forks source link

Issue while compacting the list of single item in framing algorithm #685

Open anushasivaraman opened 5 years ago

anushasivaraman commented 5 years ago

Issue while compacting the list of single item in framing algorithm : i am trying to pass single element in the list and passing to through framing alogorithm the return type which json ld form is in the form of object type of json and not in the array type of json

gkellogg commented 5 years ago

Please provide an example. Issues should be filed at github,com/w3c/json-ld-api, -syntax, or -framing depending on the nature of the issue.

anushasivaraman commented 5 years ago

list am passing with single element in json : JsonLdProcessor.frame(json, getFrame(), js);

it returns li in object type "li" :{ "type" : "xsd:integer", "@value" : "2" }

if that list contains two elements then it returns array type: "li" : [ { "type" : "xsd:integer", "@value" : "2" }, "AA"]