Serialization for CoRAL Links a </1> { { p </1/x> - - PowerPoint PPT Presentation

serialization for coral links
SMART_READER_LITE
LIVE PREVIEW

Serialization for CoRAL Links a </1> { { p </1/x> - - PowerPoint PPT Presentation

CoRE WG Virtual Interim 2019/08/21 Klaus Hartke JSON Serialization for CoRAL Links a </1> { { p </1/x> "a": { q </1/y> "_link": "/1", p </1/z> "p": [ } {


slide-1
SLIDE 1

JSON Serialization for CoRAL

CoRE WG Virtual Interim 2019/08/21 Klaus Hartke

slide-2
SLIDE 2

Links

a </1> { p </1/x> q </1/y> p </1/z> } b </2> b </3> c null { d "foo" } { "a": { "_link": "/1", "p": [ { "_link": "/1/x" }, { "_link": "/1/z" } ], "q": { "_link": "/1/y" } }, "b": [ { "_link": "/2" }, { "_link": "/3" } ], "c": { "d": "foo" } }

2

slide-3
SLIDE 3

Forms

create -> </frob> [ method "POST" accept "application/json" schema <http://example.com/schema.json> { type "application/schema+json" } ] { “create": { "_form": "/frob", "method": "POST", "accept": "application/json", "schema": { "_link": "http://example.com/schema.json", "type": "application/schema+json" } } }

3

slide-4
SLIDE 4

Literals

has-published-item true current-rate 4.53 max-rate 50 created dt'2019-08-13T17:00:00+02:00' id "t123" title "Temperaturwerte" { language "de-DE" direction "LTR" } title "Temperature values" { language "en-US" direction "LTR" } key b64'AQIDBAU=' { "has-published-item": true, "max-rate": 4.53, "max-subscribers": { "_int": 50 }, "created": { "_datetime": "2019-08-13T17:00:00+02:00" }, "id": "t123", "title": [ { "_text": "Temperaturwerte", "language": "de-DE", "direction": "LTR" }, { "_text": "Temperature values", "language": "en-US", "direction": "LTR" } ], "key": { "_bytes": "AQIDBAU=" } }

4

slide-5
SLIDE 5

Issues

  • Type tags
  • All literals are optionally tagged by their data type as shown left
  • If the tag is not present, it defaults to the data types shown right
  • Order of elements
  • Grouping elements by relation type makes the JSON serialization

more restrictive than the other two serializations

  • CURIEs

5

CoRAL type JSON tag JSON value Boolean value "_bool" true / false integer "_int" number floating-point number "_float" number date/time value "_datetime" rfc3339 string byte string "_bytes" base64 string text string "_text" string JSON value CoRAL type true / false Boolean value number floating-point number string text string

slide-6
SLIDE 6

CURIEs (1/4)

{ "http://coreapps.org/collections#create": { "_form": "/items", "http://coreapps.org/http#method": "POST", "http://coreapps.org/http#accept": "application/json", "urn:example:foo:schema": { "_link": "http://example.com/schema.json", "http://coreapps.org/http#type": "application/schema+json" } } }

6

slide-7
SLIDE 7

CURIEs (2/4)

{ "_curie": { "_default": "http://coreapps.org/collections#", "http": "http://coreapps.org/http#", "foo": "urn:example:foo:" } "create": { "_form": "http://example.com/my-collection", "http:method": "POST", "http:accept": "application/json", "foo:schema": { "_link": "http://example.com/schema.json", "http:type": "application/schema+json" } } }

7

slide-8
SLIDE 8

CURIEs (3/4)

{ "_curie": { "_default": "http://coreapps.org/collections#", "http": "http://coreapps.org/http#", "foo": "urn:example:foo:" } "http://coreapps.org/collections#create": { "_form": "http://coreapps.org/http#//example.com/my-collection", "http://coreapps.org/http#method": "POST", "http://coreapps.org/http#accept": "application/json", "urn:example:foo:schema": { "_link": "http://coreapps.org/http#//example.com/schema.json", "http://coreapps.org/http#type": "application/schema+json" } } }

8

slide-9
SLIDE 9

CURIEs (4/4)

{ "_curie": { "_default": "http://coreapps.org/collections#", "h": "http://coreapps.org/http#", "f": "urn:example:foo:" } "create": { "_form": "http://example.com/my-collection", "h:method": "POST", "h:accept": "application/json", "f:schema": { "_link": "http://example.com/schema.json", "h:type": "application/schema+json" } } }

9