[go: up one dir, main page]

SlideShare a Scribd company logo

1

JSON-LD
for RESTful Services
Markus Lanthaler
Graz University of Technology

2

Web APIs are becoming a must-have

3

JSON-LD for RESTful services

4

JSON-LD for RESTful services

5

- Layered system

6

Semaphobia!?

7

Linked Data Graph

8

JSON-LD for RESTful services

9

JSON-LD for RESTful services

10

Example




          Jane Doe

11

http://example.com/persons/{id}

{
    "id": "mlanthaler",
    "name": "Markus Lanthaler",
    "title": {
      "de": "Dipl.Ing.",
      "en": "MSc"
    },
    "workHomepage": "http://www.tugraz.at",
    "knows": [
      { "id": "johndoe", "name": "John Doe" },
      { "id": "janedoe", "name": "Jane Doe" }
    ]
}

12

{
    "@id": "mlanthaler",
    "name": "Markus Lanthaler",
    "title": [
      { "@language": "de", "@value": "Dipl.Ing." },
      { "@language": "en", "@value": "MSc" }
    ],
    "workHomepage": "http://www.tugraz.at",
    "knows": [
      { "@id": "johndoe", "name": "John Doe" },
      { "@id": "janedoe", "name": "Jane Doe" }
    ]
}                        {
                             "@context": {
                               "foaf": "http://xmlns.com/foaf/0.1/",
                               "name": "foaf:name",
                               "title": "foaf:title",
                               "workHomepage": {
                                  "@id": "foaf:workplaceHomepage",
                                  "@type": "@id"
                               },
                               "knows": "foaf:knows"
                             }
                         }

13

Link: </context.jsonld>; rel="describedby"
{
    "id": "mlanthaler",
    "name": "Markus Lanthaler",
    "title_de": "Dipl.Ing.",
    "title_en": "MSc",
    "homepage": "http://www.tugraz.at",
    "knows": [
      { "id": "johndoe", "name": "John Doe" },
      { "id": "janedoe", "name": "Jane Doe" }
    ]
}

{
    "@context": {
      "foaf": "http://xmlns.com/foaf/0.1/",
      "name": "foaf:name",
      "title_de": { "@id": "foaf:title", "@language": "de" },
      "title_en": { "@id": "foaf:title", "@language": "en" },
      "homepage": { "@id": "foaf:workplaceHomepage", "@type": "@id" },
      "knows": "foaf:knows",
      "id": "@id"
    }
}

14

@context
                                         @id




         @language                                    @list
                                               @set
@value
          @type                                  @container
                                @graph

15

kTBS

16

JSON-LD for RESTful services

17

Thank You



© 2011, Markus Lanthaler. Some Rights Reserved.
http://creativecommons.org/licenses/by-nc-sa/3.0/

18

Questions?




Markus Lanthaler                     @MarkusLanthaler
Markus.Lanthaler@student.TUGraz.at   http://www.slideshare.net/lanthaler

19

Image Credits
(1)   http://www.flickr.com/photos/bestrated1/49371264/
(2)   http://www.flickr.com/photos/johnmcnab/3759095224/
(3)   http://www.flickr.com/photos/alexdram/3095419858/
(4)   Adapted from: http://www.flickr.com/photos/elektronaut/243067805/
(7)   http://en.wikipedia.org/wiki/The_Scream

More Related Content

JSON-LD for RESTful services

  • 1. JSON-LD for RESTful Services Markus Lanthaler Graz University of Technology
  • 2. Web APIs are becoming a must-have
  • 10. Example Jane Doe
  • 11. http://example.com/persons/{id} { "id": "mlanthaler", "name": "Markus Lanthaler", "title": { "de": "Dipl.Ing.", "en": "MSc" }, "workHomepage": "http://www.tugraz.at", "knows": [ { "id": "johndoe", "name": "John Doe" }, { "id": "janedoe", "name": "Jane Doe" } ] }
  • 12. { "@id": "mlanthaler", "name": "Markus Lanthaler", "title": [ { "@language": "de", "@value": "Dipl.Ing." }, { "@language": "en", "@value": "MSc" } ], "workHomepage": "http://www.tugraz.at", "knows": [ { "@id": "johndoe", "name": "John Doe" }, { "@id": "janedoe", "name": "Jane Doe" } ] } { "@context": { "foaf": "http://xmlns.com/foaf/0.1/", "name": "foaf:name", "title": "foaf:title", "workHomepage": { "@id": "foaf:workplaceHomepage", "@type": "@id" }, "knows": "foaf:knows" } }
  • 13. Link: </context.jsonld>; rel="describedby" { "id": "mlanthaler", "name": "Markus Lanthaler", "title_de": "Dipl.Ing.", "title_en": "MSc", "homepage": "http://www.tugraz.at", "knows": [ { "id": "johndoe", "name": "John Doe" }, { "id": "janedoe", "name": "Jane Doe" } ] } { "@context": { "foaf": "http://xmlns.com/foaf/0.1/", "name": "foaf:name", "title_de": { "@id": "foaf:title", "@language": "de" }, "title_en": { "@id": "foaf:title", "@language": "en" }, "homepage": { "@id": "foaf:workplaceHomepage", "@type": "@id" }, "knows": "foaf:knows", "id": "@id" } }
  • 14. @context @id @language @list @set @value @type @container @graph
  • 15. kTBS
  • 17. Thank You © 2011, Markus Lanthaler. Some Rights Reserved. http://creativecommons.org/licenses/by-nc-sa/3.0/
  • 18. Questions? Markus Lanthaler @MarkusLanthaler Markus.Lanthaler@student.TUGraz.at http://www.slideshare.net/lanthaler
  • 19. Image Credits (1) http://www.flickr.com/photos/bestrated1/49371264/ (2) http://www.flickr.com/photos/johnmcnab/3759095224/ (3) http://www.flickr.com/photos/alexdram/3095419858/ (4) Adapted from: http://www.flickr.com/photos/elektronaut/243067805/ (7) http://en.wikipedia.org/wiki/The_Scream