Skip to content

Instantly share code, notes, and snippets.

@liang799
Last active October 4, 2022 16:10
Show Gist options
  • Save liang799/f9017983bbe61ce3461f97a13f01c628 to your computer and use it in GitHub Desktop.
Save liang799/f9017983bbe61ce3461f97a13f01c628 to your computer and use it in GitHub Desktop.
My notes for Terrifcally Simple JSON

My notes

Helpful Resources

Recap

{
 "key": "value"
}
  • { ... } is an object
  • "key" is a property

Every JSON object should have a self property

{
 "self": "http://martin-nally.name#",
 "bornIn": "http://www.scotland.org#"
}

Use either self or (_datatype & _value)

Datatype & value

Also works when working with custom types such as date

{
 "self": "http://martin-nally.name#",
 "bornIn": {
    "_value": "http://www.scotland.org#",
    "_datatype": "entity"
    }
}

Self

{
 "self": "http://martin-nally.name#",
 "bornIn": {"self": "http://www.scotland.org#"}
}

Collections

collections are entities

{"self": "http://scotland.org/native-sons",
 "contents": [
    {"self": "http://martin-nally.name#"},
    {"self": "many more like this"}
    ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment