SAPS - Semantic AtomPub-based Services

Semantic AtomPub-based Services

                           Markus Lanthaler
© Matt Reinbold




                           Graz University of Technology
Web services are increasingly popular
Twitter      Facebook     Google
15 billion    5 billion   5 billion
 per day      per day     per day
76% of the APIs are RESTful
            [ProgrammableWeb, May 2010]
but
© Nesster
Two Options
SAPS - Semantic AtomPub-based Services
Two Options
SAPS - Semantic AtomPub-based Services
Exchange of semantically annotated
data through a well-defined interface
SAPS’ Semantic Layer
 SAWSDL          JSON Schema+          …
XML Schema           JSON              …


  Atom             AtomPub          OpenSearch

                   HTTP(S)

                    TCP/IP
pay order
query products


                 Restbucks
<?xml version="1.0" encoding='utf-8'?>
<service xmlns="http://www.w3.org/2007/app"
        xmlns:atom="http://www.w3.org/2005/Atom"
        xmlns:saps="http://www.purl.org/saps">
 <workspace>
   <atom:title>Coffee Shop Service</atom:title>
   <collection href="/products" >
     <atom:title>Products</atom:title>
     [...]
   </collection>
   <collection href="/orders" >
     <atom:title>Orders</atom:title>
     [...]
   </collection>
 </workspace>
</service>
<collection href="/orders" >
  <atom:title>Orders</atom:title>
  <accept saps:schema="/schemas/purchase-order.xsd">
    application/xml
  </accept>
  <categories fixed="yes">
    <atom:category scheme=
       "http://www.purl.org/net/ontology/order.owl#"
      term="http://www.purl.org/net/ontology/
        order.owl#PurchaseOrder"
      label="Orders" />
  </categories>
</collection>
<collection href="/products" >
  <atom:title>Products</atom:title>
  <accept />
  <categories fixed="yes">
    <atom:category
      scheme="http://purl.org/goodrelations/v1#"
      term="http://purl.org/goodrelations/v1#Offering"
      label="Products" />
  </categories>
  <atom:link rel="search"
    type="application/opensearchdescription+xml"
    href="http://api.example.com/productsearch.xml"/>
</collection>
<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription
     xmlns="http://a9.com/-/spec/opensearch/1.1/">
  <ShortName>Product Search</ShortName>
  <Description>Search for products</Description>
  <Url xmlns:gr="http://purl.org/goodrelations/v1#"
    type="application/atom+xml;type=feed"
    template="http://api.example.com/?q=
     {searchTerms?}&amp;ean={gr:hasEAN_UCC-13?}" />
</OpenSearchDescription>


GET /?q=&ean=2300000010015 HTTP/1.1
Host: api.example.com
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title type="text">Search for EAN 2300000010015</title>
  [...]
  <entry>
    <title>Cappuccino</title>
    <summary>A hot cappuccino for 1.99 EUR</summary>
    <id>tag:example.org,2003:3.2397</id>
    <updated>2009-07-31T12:29:29Z</updated>
    <published>2008-12-13T08:29:29-04:00</published>
    <content type="application/xml">
      [...]
    </content>
  </entry>
</feed>
<content type="application/xml">
  <product xmlns="http://example.com/products"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-
         instance"
       xsi:schemaLocation="http://example.com/products
         http://example.com/products.xsd">
     <id>http://api.example.org/products/P4197</id>
     <label>Cappuccino</label>
     <ean>2300000010015</ean>
     <sku>P4197</sku>
     <price>1.99</price>
     <description>...</description>
  </product>
</content>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:sawsdl="http://www.w3.org/ns/sawsdl">
  <xsd:element name="product" type="ProductType"
     sawsdl:modelReference="http://purl.org/goodrelations/
       v1#Offering" />
  <xsd:complexType name="ProductType">
    <xsd:sequence>
      <xsd:sequence>
      <xsd:element name="id" type="xsd:anyURI" />
        <xsd:element name="label" type="xsd:string"
           sawsdl:modelReference="http://www.w3.org/2000/
              01/rdf-schema#label" />
        <xsd:element name="ean" type="xsd:string"
           sawsdl:modelReference="http://purl.org/
              goodrelations/v1#hasEAN_UCC-13" />
        <xsd:element name="sku" type="xsd:string"
           sawsdl:modelReference="
              http://purl.org/
                goodrelations/v1#hasStockKeepingUnit
              http://www.purl.org/net/
                ontology/order.owl#PartNumber" />
        <xsd:element name="price" type="xsd:decimal"
           sawsdl:modelReference="http://purl.org/
              goodrelations/v1#hasCurrencyValue" />
        <xsd:element name="description" type="xsd:string"
<collection href="/orders" >
  <atom:title>Orders</atom:title>
  <accept saps:schema="/schemas/purchase-order.xsd">
    application/xml
  </accept>
  [...]
</collection>

POST /orders HTTP/1.1
Host: api.example.com
Content-Type: application/xml
<order xmlns="http://example.com/orders
  [...]
</order>



     <link rel="next http://example.com/ontology/payment"
        href="/order/1684/payment" type="application/xml"
        saps:schema="/schemas/payment.xsd" title="Payment" />
strong emphasis on simplicity




                      discovery and composition
Thank You



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




Markus Lanthaler
Markus.Lanthaler@student.TUGraz.at
Image Credits
(1) http://www.flickr.com/photos/furryscalyman/3695730985/
(3) Adapted from “Two Billion is Cool,” M. Thomson. Available:
    http://corp.klout.com/blog/2011/07/two-billion-is-cool/
(6) http://www.flickr.com/photos/nesster/3168425434/
1 of 25

Recommended

AjaxAjax
AjaxSiya Agarwal
2.2K views20 slides
Spring Mvc RestSpring Mvc Rest
Spring Mvc RestCraig Walls
5.2K views35 slides
Introduction to ajaxIntroduction to ajax
Introduction to ajaxRaja V
4.8K views18 slides
Ajax PptAjax Ppt
Ajax PptHema Prasanth
8.7K views27 slides
AjaxAjax
AjaxNishanthyadav Nishanth
1.7K views25 slides

More Related Content

What's hot(20)

Box connector Mule ESB IntegrationBox connector Mule ESB Integration
Box connector Mule ESB Integration
AnilKumar Etagowni505 views
Introduction to ajaxIntroduction to ajax
Introduction to ajax
Nir Elbaz61.6K views
Ajax   Introduction   PresentationAjax   Introduction   Presentation
Ajax Introduction Presentation
thinkphp4.2K views
Ajax Ppt 1Ajax Ppt 1
Ajax Ppt 1
JayaPrakash.m8.9K views
Ajax presentationAjax presentation
Ajax presentation
engcs2008747 views
Using schemas in parsing xml part 2Using schemas in parsing xml part 2
Using schemas in parsing xml part 2
Alex Fernandez257 views
Inner core of Ajax Inner core of Ajax
Inner core of Ajax
Muhammad Junaid Ansari307 views
Ajax PresentationAjax Presentation
Ajax Presentation
alaa.moustafa3.6K views
Jsp introJsp intro
Jsp intro
husnara mohammad370 views
ASP.NET Routing & MVCASP.NET Routing & MVC
ASP.NET Routing & MVC
Emad Alashi3.6K views
AjaxAjax
Ajax
talktorohit541.8K views
Ajax pptAjax ppt
Ajax ppt
OECLIB Odisha Electronics Control Library9K views
Ajax TechnologyAjax Technology
Ajax Technology
Zia_Rehman736 views
AJAXAJAX
AJAX
Akhil Kumar1.1K views
Implicit objects advance JavaImplicit objects advance Java
Implicit objects advance Java
Darshit Metaliya1.2K views
Implicit object.pptxImplicit object.pptx
Implicit object.pptx
chakrapani tripathi2.1K views
Request dispacther interface pptRequest dispacther interface ppt
Request dispacther interface ppt
Taha Malampatti900 views

Viewers also liked(20)

Similar to SAPS - Semantic AtomPub-based Services(20)

Angular jsAngular js
Angular js
prasaddammalapati316 views
AngularJS Mobile Warsaw 20-10-2014AngularJS Mobile Warsaw 20-10-2014
AngularJS Mobile Warsaw 20-10-2014
Dariusz Kalbarczyk708 views
Rich Portlet Development in uPortalRich Portlet Development in uPortal
Rich Portlet Development in uPortal
Jennifer Bourey1.6K views
ASP.NET Overview - Alvin LauASP.NET Overview - Alvin Lau
ASP.NET Overview - Alvin Lau
Spiffy3.2K views
Ws restWs rest
Ws rest
patriknw402 views
Camel as a_glueCamel as a_glue
Camel as a_glue
Andriy Andrunevchyn777 views
Microsoft Accademic Cloud Tour GenovaMicrosoft Accademic Cloud Tour Genova
Microsoft Accademic Cloud Tour Genova
antimo musone399 views
Google Polymer FrameworkGoogle Polymer Framework
Google Polymer Framework
Kostas Karolemeas796 views
Java TechnologyJava Technology
Java Technology
ifnu bima749 views
Overview of RESTful web servicesOverview of RESTful web services
Overview of RESTful web services
nbuddharaju4.2K views
Java Web Development with StripesJava Web Development with Stripes
Java Web Development with Stripes
Samuel Santos4.8K views
Intro to JavaScriptIntro to JavaScript
Intro to JavaScript
Jussi Pohjolainen3.8K views

More from Markus Lanthaler(14)

Recently uploaded(20)

Java Platform Approach 1.0 - Picnic MeetupJava Platform Approach 1.0 - Picnic Meetup
Java Platform Approach 1.0 - Picnic Meetup
Rick Ossendrijver23 views
CXL at OCPCXL at OCP
CXL at OCP
CXL Forum183 views
[2023] Putting the R! in R&D.pdf[2023] Putting the R! in R&D.pdf
[2023] Putting the R! in R&D.pdf
Eleanor McHugh34 views
ThroughputThroughput
Throughput
Moisés Armani Ramírez28 views

SAPS - Semantic AtomPub-based Services

  • 1. Semantic AtomPub-based Services Markus Lanthaler © Matt Reinbold Graz University of Technology
  • 2. Web services are increasingly popular
  • 3. Twitter Facebook Google 15 billion 5 billion 5 billion per day per day per day
  • 4. 76% of the APIs are RESTful [ProgrammableWeb, May 2010]
  • 5. but
  • 11. Exchange of semantically annotated data through a well-defined interface
  • 12. SAPS’ Semantic Layer SAWSDL JSON Schema+ … XML Schema JSON … Atom AtomPub OpenSearch HTTP(S) TCP/IP
  • 14. <?xml version="1.0" encoding='utf-8'?> <service xmlns="http://www.w3.org/2007/app" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:saps="http://www.purl.org/saps"> <workspace> <atom:title>Coffee Shop Service</atom:title> <collection href="/products" > <atom:title>Products</atom:title> [...] </collection> <collection href="/orders" > <atom:title>Orders</atom:title> [...] </collection> </workspace> </service>
  • 15. <collection href="/orders" > <atom:title>Orders</atom:title> <accept saps:schema="/schemas/purchase-order.xsd"> application/xml </accept> <categories fixed="yes"> <atom:category scheme= "http://www.purl.org/net/ontology/order.owl#" term="http://www.purl.org/net/ontology/ order.owl#PurchaseOrder" label="Orders" /> </categories> </collection>
  • 16. <collection href="/products" > <atom:title>Products</atom:title> <accept /> <categories fixed="yes"> <atom:category scheme="http://purl.org/goodrelations/v1#" term="http://purl.org/goodrelations/v1#Offering" label="Products" /> </categories> <atom:link rel="search" type="application/opensearchdescription+xml" href="http://api.example.com/productsearch.xml"/> </collection>
  • 17. <?xml version="1.0" encoding="UTF-8"?> <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"> <ShortName>Product Search</ShortName> <Description>Search for products</Description> <Url xmlns:gr="http://purl.org/goodrelations/v1#" type="application/atom+xml;type=feed" template="http://api.example.com/?q= {searchTerms?}&amp;ean={gr:hasEAN_UCC-13?}" /> </OpenSearchDescription> GET /?q=&ean=2300000010015 HTTP/1.1 Host: api.example.com
  • 18. <?xml version="1.0" encoding="utf-8"?> <feed xmlns="http://www.w3.org/2005/Atom"> <title type="text">Search for EAN 2300000010015</title> [...] <entry> <title>Cappuccino</title> <summary>A hot cappuccino for 1.99 EUR</summary> <id>tag:example.org,2003:3.2397</id> <updated>2009-07-31T12:29:29Z</updated> <published>2008-12-13T08:29:29-04:00</published> <content type="application/xml"> [...] </content> </entry> </feed>
  • 19. <content type="application/xml"> <product xmlns="http://example.com/products" xmlns:xsi="http://www.w3.org/2001/XMLSchema- instance" xsi:schemaLocation="http://example.com/products http://example.com/products.xsd"> <id>http://api.example.org/products/P4197</id> <label>Cappuccino</label> <ean>2300000010015</ean> <sku>P4197</sku> <price>1.99</price> <description>...</description> </product> </content>
  • 20. <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sawsdl="http://www.w3.org/ns/sawsdl"> <xsd:element name="product" type="ProductType" sawsdl:modelReference="http://purl.org/goodrelations/ v1#Offering" /> <xsd:complexType name="ProductType"> <xsd:sequence> <xsd:sequence> <xsd:element name="id" type="xsd:anyURI" /> <xsd:element name="label" type="xsd:string" sawsdl:modelReference="http://www.w3.org/2000/ 01/rdf-schema#label" /> <xsd:element name="ean" type="xsd:string" sawsdl:modelReference="http://purl.org/ goodrelations/v1#hasEAN_UCC-13" /> <xsd:element name="sku" type="xsd:string" sawsdl:modelReference=" http://purl.org/ goodrelations/v1#hasStockKeepingUnit http://www.purl.org/net/ ontology/order.owl#PartNumber" /> <xsd:element name="price" type="xsd:decimal" sawsdl:modelReference="http://purl.org/ goodrelations/v1#hasCurrencyValue" /> <xsd:element name="description" type="xsd:string"
  • 21. <collection href="/orders" > <atom:title>Orders</atom:title> <accept saps:schema="/schemas/purchase-order.xsd"> application/xml </accept> [...] </collection> POST /orders HTTP/1.1 Host: api.example.com Content-Type: application/xml <order xmlns="http://example.com/orders [...] </order> <link rel="next http://example.com/ontology/payment" href="/order/1684/payment" type="application/xml" saps:schema="/schemas/payment.xsd" title="Payment" />
  • 22. strong emphasis on simplicity discovery and composition
  • 23. Thank You © 2011, Markus Lanthaler. Some Rights Reserved. http://creativecommons.org/licenses/by-nc-sa/3.0/
  • 25. Image Credits (1) http://www.flickr.com/photos/furryscalyman/3695730985/ (3) Adapted from “Two Billion is Cool,” M. Thomson. Available: http://corp.klout.com/blog/2011/07/two-billion-is-cool/ (6) http://www.flickr.com/photos/nesster/3168425434/