1 JSONLD JSON as an XML Alterna3ve JSON is a lightweight alterna3ve to XML for data interchange JSON = JavaScript Object Nota3on – It’s really language independent – most programming languages can easily read it and instan3ate objects or some other data structure Defined in RFC 4627 Started gaining trac3on ~2006 and now widely used hQp://json.org/ has more informa3on Example {"firstName": "John", "lastName" : "Smith", "age" : 25, "address" : {"streetAdr” : "21 2nd Street", "city" : "New York", "state" : "NY", ”zip" : "10021"}, "phoneNumber": [{"type" : "home", "number": "212 5551234"}, {"type" : "fax", "number” : "646 5554567"}] } This is a JSON object with five keyvalue pairs Objects are wrapped by curly braces There are no object IDs Keys are strings Values are numbers, strings, objects or arrays Arrays are wrapped by square brackets The BNF is simple
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
1
JSON-‐LD
JSON as an XML Alterna3ve l JSON is a light-‐weight alterna3ve to XML for data-‐interchange
l JSON = JavaScript Object Nota3on – It’s really language independent
– most programming languages can easily read it and instan3ate objects or some other data structure
l Defined in RFC 4627
l Started gaining trac3on ~2006 and now widely used
[1] This means that 'name' is shorthand for 'hQp://schema.org/name' [2] This means that 'image' is shorthand for 'hQp://schema.org/image' [3] This means that a string value associated with 'image' should be interpreted as an iden3fier that is an IRI [4] This means that 'homepage' is shorthand for 'hQp://schema.org/url' [5] This means that a string value associated with 'homepage' should be interpreted as an iden3fier that is an IRI