JSON-LD
for RESTful Services
Markus Lanthaler
Graz University of Technology
Web APIs are becoming a must-have
- Layered system
Semaphobia!?
Linked Data Graph
Example




          Jane Doe
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" }
    ]
}
{
    "@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"
                             }
                         }
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"
    }
}
@context
                                         @id




         @language                                    @list
                                               @set
@value
          @type                                  @container
                                @graph
kTBS
Thank You



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




Markus Lanthaler                     @MarkusLanthaler
Markus.Lanthaler@student.TUGraz.at   http://www.slideshare.net/lanthaler
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

JSON-LD for RESTful services

  • 1.
    JSON-LD for RESTful Services MarkusLanthaler Graz University of Technology
  • 2.
    Web APIs arebecoming a must-have
  • 5.
  • 6.
  • 7.
  • 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.
  • 17.
    Thank You © 2011,Markus Lanthaler. Some Rights Reserved. http://creativecommons.org/licenses/by-nc-sa/3.0/
  • 18.
    Questions? Markus Lanthaler @MarkusLanthaler [email protected] 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