bevry / cson

CoffeeScript-Object-Notation. Same as JSON but for CoffeeScript objects.
Other
1.34k stars 56 forks source link

Enable json-ld for linked data with LD option for CSON CLI #61

Closed jmatsushita closed 7 years ago

jmatsushita commented 9 years ago

With JSON-LD the use of keys prefixed with the @ character is idiomatic. This means that the home page example:

{
  "@context": "http://json-ld.org/contexts/person.jsonld",
  "@id": "http://dbpedia.org/resource/John_Lennon",
  "name": "John Lennon",
  "born": "1940-10-09",
  "spouse": "http://dbpedia.org/resource/Cynthia_Lennon"
}

Is converted with the @keys quoted.

"@context": "http://json-ld.org/contexts/person.jsonld"
"@id": "http://dbpedia.org/resource/John_Lennon"
name: "John Lennon"
born: "1940-10-09"
spouse: "http://dbpedia.org/resource/Cynthia_Lennon"

Would it be possible to add an option (--ld ?) to allow @keys not to be quoted for better readability, as in:

@context: "http://json-ld.org/contexts/person.jsonld"
@id: "http://dbpedia.org/resource/John_Lennon"
name: "John Lennon"
born: "1940-10-09"
spouse: "http://dbpedia.org/resource/Cynthia_Lennon"
balupton commented 7 years ago

Will be an issue for https://www.npmjs.com/package/cson-parser