SlideShare a Scribd company logo
1 of 25
1st Workshop on Programming the Semantic Web
Toward Data-driven Programming for RESTful Linked Data
Steffen Stadtmüller, Dr. Andreas Harth

AIFB, Karlsruhe Institute of Technology, DE
Boston, US, MA, 11/11/2012

INSTITUTE OF APPLIED INFORMATICS AND FORMAL DESCRIPTION METHODS (AIFB)




                                                                         www.aifb.kit.edu




KIT – University of the State of Baden-Württemberg and
National Laboratory of the Helmholtz Association                                            www.kit.edu
Agenda

 Motivation
      Programming with REST
      Challenges
 REST Execution Language
      Formal Grounding
      Client Behaviour Defined by Rules
 REST Service Execution Engine
      Rete Query Engine
      Transition System
 Conclusion
      Related Work
      Future Work
      Summary




2   11/15/2012   REST Service Composition, Steffen Stadtmüller, M.Sc.
                                                                        www.aifb.kit.edu
MOTIVATION




3   11/15/2012   REST Service Composition, Steffen Stadtmüller, M.Sc.
                                                                        www.aifb.kit.edu
Motivation

 The Web today is not only about serving static data:
      APIs are used to trigger functionalities in the web and the real world
       as well (e.g., ordering a pizza or solving a re-captcha)
      Programmableweb.com lists ~6000 APIs1

 An important role plays
  Representational State
  Transfer (REST)
      Software architecture for
       client–server interaction
      Focused on the Web
       architecture



                                                                        1http://programmableweb.com


4   11/15/2012   REST Service Composition, Steffen Stadtmüller, M.Sc.
                                                                                     www.aifb.kit.edu
Programming with REST

 Functionality is enabled by exposing resources and
  allowing clients to manipulate them
       Real world entities (e.g., car, movie, person…) are projected onto
        the web by making the information associated with them (their
        state) accessible on the Web.
       Manipulation is possible with a constraint set of HTTP methods
       No arbitrary function definition

     HTTP Verb                                                           Effect
    GET              retrieves the representation/state of a resource identified with a URI
    PUT              create or overwrite a resource identified by a client-generated URI
    POST             create a resource identified by a service-generated URI
    DELETE           deletes a resource (or its representation) identified with a URI




5    11/15/2012   REST Service Composition, Steffen Stadtmüller, M.Sc.
                                                                                              www.aifb.kit.edu
Programming with REST

  REST is focussed on loose coupling, thus enabling
   flexibility and robustness toward server side changes
         Representations of resources contain links to other resources to
          show clients what to do next
         Interactions should not be hard-coded
  Example:                                                                 Client creates a new
                            Client                                           pizza order
POST        Response                      POST              Response        Pizza baker server replies
            201 CREATED                                     200 OK           with the created order
 Pizza Order                                                                 including ETA and a link
 Topping: …                                 Account PB                       to his bank account
 ETA: …
          Link
                                                                            Client can use the bank
 Server (pizza baker)                        Server (bank)                   account resource to pay
 6     11/15/2012   REST Service Composition, Steffen Stadtmüller, M.Sc.
                                                                                               www.aifb.kit.edu
Challenges to Address

 REST allows service providers to use arbitrary formalisms to
  represent resources and links
      Developers have to gain a deep understanding of every API by reading
       textual descriptions.
 Applications (clients) are supposed to follow links as found
  during runtime of the application. However, developers have to
  define their desired interaction at design time.
      Developers have to write individually tailored code to consume services in
       applications.

 Approach:
      Linked APIs: Linked Data / RDF as uniform semantic data
       model for resources
      Declarative rule-based execution language for composition and
       orchestration
      Execution Engine to perform the actual interaction
7   11/15/2012   REST Service Composition, Steffen Stadtmüller, M.Sc.
                                                                          www.aifb.kit.edu
REST EXECUTION LANGUAGE




8   11/15/2012   REST Service Composition, Steffen Stadtmüller, M.Sc.
                                                                        www.aifb.kit.edu
REST State Transition System

 A Linked API establishes a state transition system on the
  Web:
      Every state in the transition system is the collection of all states of
       the resources exposed by the service
      An HTTP method applied to a resource potentially changes the
       state of resources and is therefore a transition in the system.



                        PUT(...                               PUT(r2, d)                   POST(...
                                      r1        r2                         r1        r2‘
                                           r3                                   r3



                                      GET(r1)                               GET(r3)

                                                               r1
                                                                    r3


9   11/15/2012   REST Service Composition, Steffen Stadtmüller, M.Sc.
                                                                                                      www.aifb.kit.edu
REST State Transition System

 A Linked API establishes a state transition system on the
  Web:
       Every state in the transition system is the collection of all states of
        the resources exposed by the service
       To every application of an HTTP method, the server replies with a
        defined response, that details the effected changes
                                                               Client
                                         request                            response (r2’)

                         PUT(...                               PUT(r2, d)                    POST(...
                                       r1        r2                          r1        r2‘
                                            r3                                    r3



                                       GET(r1)                                GET(r3)

                                                                r1
                                                                     r3


10   11/15/2012   REST Service Composition, Steffen Stadtmüller, M.Sc.
                                                                                                        www.aifb.kit.edu
Rule Execution Language

 The state transition system builds the formal grounding for
  a rule execution language
 A rule is of the form
                         m(r, d)  Q
          m: HTTP method (transition) to be applied
          r: addressed resource (in the current state)
          d: input data (potentially empty)
          Q: Query as condition under which the rule is to be executed


 Intuitively a rule defines what transition should be executed
  as subject to conditions on the current state



11   11/15/2012   REST Service Composition, Steffen Stadtmüller, M.Sc.
                                                                         www.aifb.kit.edu
Query Bindings in Rule Bodies

 Since resources are represented with RDF (graph
  model), RDF queries (graph pattern) are used as rule
  bodies
 If a query delivers results, the corresponding transition is
  executed

 The query results (i.e. bindings), can be used to construct
  the input data for HTTP method, if required



                                          M(r, d(?x) )  Q2 (?x)


12   11/15/2012   REST Service Composition, Steffen Stadtmüller, M.Sc.
                                                                         www.aifb.kit.edu
Utilization of Links

 Linked Data resources, as used by Linked APIs contain
  inherently links in their representation to other resources
       Traditionally Linked Data resources can not be manipulated
       But linked resources can also accessible for RESTful interaction
 To leverage links enables the main advantage of REST
  (i.e., runtime flexibility)

 Rule heads support the selection of resources as bindings
  produced by the query in the rule body:

                                              M(?x, d)  Q2 (?x)


13   11/15/2012   REST Service Composition, Steffen Stadtmüller, M.Sc.
                                                                         www.aifb.kit.edu
Client Behaviour Defined by Rules

 Clients maintain their own knowledge space that contains
  information about the current state of (some) resources
  Rule bodies (queries) are constantly evaluated over the
  knowledge space
       If a query matches the information in the knowledge space, the
        method defined in the rule head is executed
       The server informs the client about the effected changes, which
        updates the knowledge space
       Client                                               Rule Set
                                                                         r1        r2   PUT(r3,d)       r1        r2
            Knowledge                                                         r4                             r4
                                                                         r8                             r8        r3
            Space                            PUT(r3,d)  Q1
                   r1                        GET(r4,{})  Q2
                   r2                               …
                   r3


14   11/15/2012   REST Service Composition, Steffen Stadtmüller, M.Sc.
                                                                                                    www.aifb.kit.edu
REST SERVICE EXECUTION ENGINE




15   11/15/2012   REST Service Composition, Steffen Stadtmüller, M.Sc.
                                                                         www.aifb.kit.edu
Service Execution Engine - Rete

 The Execution Engine uses a multi query engine at its
  core, capable of processing multiple queries in parallel
  based an the Rete algorithm

                                            Bindings                   The queries are divided in their
                                                                        atomic parts (triple pattern)
                    join                 join
                                                                       A plan (β-net) is established, how
             join          join                                         the results of the atomic queries
                                                                        have to be joined to receive the
     TP1          TP2             TP3           TP4
                                                                        result of the overall queries
                                                                       RDF is sent through the net to
                                                                        receive the bindings of all queries
Q1, Q2
                     RDF
16   11/15/2012     REST Service Composition, Steffen Stadtmüller, M.Sc.
                                                                                                   www.aifb.kit.edu
Service Execution Engine – Transition System

 If a binding for a query is found a transition system
  executes the HTTP method of the corresponding rule
 The RDF response is sent through the β-net
                                            Bindings
                                                                                                         r1
                    join                 join



                                                                   Transition System
                                                                                       Construct
                                                                                                         r2
                                                                                         Input
             join          join

                                                                                        PUT(r4)          r4
     TP1          TP2             TP3           TP4
                                                                                        GET(r1)
                                                                                       POST(r3)
                                                                                                         r4
Q1, Q2
                     RDF                                                                    Engine Web
17   11/15/2012     REST Service Composition, Steffen Stadtmüller, M.Sc.
                                                                                                         www.aifb.kit.edu
Current Status

 Engine works for a monotone subset of rules, i.e., only
  creation or extension of resources possible
 Deletion and modification of resources can lead to non-
  deterministic behaviour in a declarative rule set:
                     „Delete B if A exists.“
                     „Create C if B exists.“
                   Knowledge Space: {A, B}
     If C is created, depends on the order of evaluation.

 Approach: Stratification, i.e. layering of rules, to ensure a
  deterministic evaluation order


18   11/15/2012   REST Service Composition, Steffen Stadtmüller, M.Sc.
                                                                         www.aifb.kit.edu
Layered Composition

 The execution language supports the notion of input and
  output defined with graph patterns:
       Input(Q): Defines the structure of data that can initially be imported
        in the knowledge space to start the interaction
       Output(Q): Defines the structure of data that is extracted from the
        knowledge space after the interaction


 A defined interaction (i.e. rule set) can be deployed on the
  Web as resource itself
       Input can be HTTP POSTed to the composed resource
       Output is returned in the response




19   11/15/2012   REST Service Composition, Steffen Stadtmüller, M.Sc.
                                                                         www.aifb.kit.edu
Layered Composition

 The composed resource is server for other clients and
  client for resources on higher layers
 Note: state of resources on higher layers can reach the
  client via the knowledge space
                                                                                                                                     r1

                                                                                         Bindings
                                                                           j
                                                                           o                                                         r2
                       POST (Input)
                                                                           i




                                                                                                    Transition System
                                                                           n                                             Construct
                                                                 j                   j                                     Input
                                                                 o                   o
                                                                 i                   i
                                                                 n                   n




 Client                                                     TP
                                                             1
                                                                     TP
                                                                      2
                                                                                TP
                                                                                 3
                                                                                          TP
                                                                                           4
                                                                                                                         PUT(r4)
                                                                                                                         GET(r1)
                                                                                                                        POST(r3)

                  Response (Output)                                                                                                  r4
                                                                          RDF



                                                                 Server / Client
                                                                                                                                     r4




20   11/15/2012   REST Service Composition, Steffen Stadtmüller, M.Sc.
                                                                                                                                     www.aifb.kit.edu
CONCLUSION




21   11/15/2012   REST Service Composition, Steffen Stadtmüller, M.Sc.
                                                                         www.aifb.kit.edu
Related Work
   Kopecky et al.: Semantic Web Services and REST: WSMO-Lite
   Pautasso: BPEL extension to compose WSDL-wrapped REST services
   Hernandez et al.: Model for REST based on a combination of pi-calculus and an
    extension of triple space computing (Simperl et al.)
REST is based on another kind of abstraction than traditional Service and SWS
technologies: the resource. We favour a more data-driven approach


  Verborgh et al.: RESTdesc, RESTful LD resources and composition with N3-reasoning
  Bonetta et al.: script language S to develop REST resources with focus on performance
   due to parallel calculation
We focus on the dynamic reaction on resource states for flexible behaviour


   Krummenacher et al: Process Spaces; RESTful Linked Open Services read and write to
    a shared space
 Speiser et al.: Linked Data services; RESTful Linked Data
Improvement on these ideas with a well defined service model and an explicit definition of
intended interactions


22   11/15/2012   REST Service Composition, Steffen Stadtmüller, M.Sc.
                                                                                  www.aifb.kit.edu
Future Work

 Support for streaming resources, i.e. continuous state
  updates
 Ensure deterministic behaviour with non monotone rule
  sets
 Handling of non-Linked API resources (i.e., not Linked
  Data based)
       Non-Linked Data resources (e.g., binary data, pictures, XML) can
        be stored separately by the engine and hooked in the knowledge
        space with a created URI
 Validation, verification, auto-completion with the help of
  service descriptions



23   11/15/2012   REST Service Composition, Steffen Stadtmüller, M.Sc.
                                                                         www.aifb.kit.edu
Summary

 REST is a lightweight software architecture especially suited for client
  server interaction
 Programs are based on the manipulation of (Linked Data) resources on
  the Web
 Goals:
    Mitigation of manual integration effort
    Preservation of runtime flexibility (i.e., follow links) and capability to
      dynamically react on resource states
    High scalability
 Approach: Declarative rule-based execution language + engine, based
  on resources with Linked Data as uniform semantic data model



                                                            Thank you

24   11/15/2012   REST Service Composition, Steffen Stadtmüller, M.Sc.
                                                                         www.aifb.kit.edu
Backup: REST State Transition System –
Formal Definition




25   11/15/2012   REST Service Composition, Steffen Stadtmüller, M.Sc.
                                                                         www.aifb.kit.edu

More Related Content

Similar to Programming the Semantic Web with a REST Execution Language

Saturn 2018 rest.li
Saturn 2018 rest.liSaturn 2018 rest.li
Saturn 2018 rest.liMin Chen
 
Transform-to-Smart-ERP-using-Custom-Mobile-Apps.pptx
Transform-to-Smart-ERP-using-Custom-Mobile-Apps.pptxTransform-to-Smart-ERP-using-Custom-Mobile-Apps.pptx
Transform-to-Smart-ERP-using-Custom-Mobile-Apps.pptxkmani5
 
Transform-to-Smart-ERP-using-Custom-Mobile-Apps.pptx (3).ppt
Transform-to-Smart-ERP-using-Custom-Mobile-Apps.pptx (3).pptTransform-to-Smart-ERP-using-Custom-Mobile-Apps.pptx (3).ppt
Transform-to-Smart-ERP-using-Custom-Mobile-Apps.pptx (3).pptHusseinWassof
 
Rest API and Client OM for Developer
Rest API and Client OM for DeveloperRest API and Client OM for Developer
Rest API and Client OM for DeveloperInnoTech
 
53 hui homework2
53 hui homework253 hui homework2
53 hui homework2huis89
 
Ijirsm ashok-kumar-ps-compulsiveness-of-res tful-web-services
Ijirsm ashok-kumar-ps-compulsiveness-of-res tful-web-servicesIjirsm ashok-kumar-ps-compulsiveness-of-res tful-web-services
Ijirsm ashok-kumar-ps-compulsiveness-of-res tful-web-servicesIJIR JOURNALS IJIRUSA
 
Rest service in mule
Rest service in mule Rest service in mule
Rest service in mule Harish43
 
Modeling REST API's Behaviour with Text, Graphics or Both?
Modeling REST API's Behaviour with Text, Graphics or Both?Modeling REST API's Behaviour with Text, Graphics or Both?
Modeling REST API's Behaviour with Text, Graphics or Both?Ana Ivanchikj
 
Rest API Automation with REST Assured
Rest API Automation with REST AssuredRest API Automation with REST Assured
Rest API Automation with REST AssuredTO THE NEW Pvt. Ltd.
 
IRJET- Rest API for E-Commerce Site
IRJET- Rest API for E-Commerce SiteIRJET- Rest API for E-Commerce Site
IRJET- Rest API for E-Commerce SiteIRJET Journal
 
Native REST Web Services with Oracle 11g
Native REST Web Services with Oracle 11gNative REST Web Services with Oracle 11g
Native REST Web Services with Oracle 11gMarcelo Ochoa
 
Introduction to REST and the Restlet Framework
Introduction to REST and the Restlet FrameworkIntroduction to REST and the Restlet Framework
Introduction to REST and the Restlet FrameworkPhilip Johnson
 

Similar to Programming the Semantic Web with a REST Execution Language (20)

Lab7 paper
Lab7 paperLab7 paper
Lab7 paper
 
Saturn 2018 rest.li
Saturn 2018 rest.liSaturn 2018 rest.li
Saturn 2018 rest.li
 
Transform-to-Smart-ERP-using-Custom-Mobile-Apps.pptx
Transform-to-Smart-ERP-using-Custom-Mobile-Apps.pptxTransform-to-Smart-ERP-using-Custom-Mobile-Apps.pptx
Transform-to-Smart-ERP-using-Custom-Mobile-Apps.pptx
 
Transform-to-Smart-ERP-using-Custom-Mobile-Apps.pptx (3).ppt
Transform-to-Smart-ERP-using-Custom-Mobile-Apps.pptx (3).pptTransform-to-Smart-ERP-using-Custom-Mobile-Apps.pptx (3).ppt
Transform-to-Smart-ERP-using-Custom-Mobile-Apps.pptx (3).ppt
 
Rest api-interview
Rest api-interviewRest api-interview
Rest api-interview
 
Apitesting.pptx
Apitesting.pptxApitesting.pptx
Apitesting.pptx
 
Rest API and Client OM for Developer
Rest API and Client OM for DeveloperRest API and Client OM for Developer
Rest API and Client OM for Developer
 
Rest web service
Rest web serviceRest web service
Rest web service
 
Lecture 12
Lecture 12Lecture 12
Lecture 12
 
Switch to Backend 2023 | Day 1 Part 1
Switch to Backend 2023 | Day 1 Part 1Switch to Backend 2023 | Day 1 Part 1
Switch to Backend 2023 | Day 1 Part 1
 
53 hui homework2
53 hui homework253 hui homework2
53 hui homework2
 
Ijirsm ashok-kumar-ps-compulsiveness-of-res tful-web-services
Ijirsm ashok-kumar-ps-compulsiveness-of-res tful-web-servicesIjirsm ashok-kumar-ps-compulsiveness-of-res tful-web-services
Ijirsm ashok-kumar-ps-compulsiveness-of-res tful-web-services
 
Rest Service In Mule
Rest Service In Mule Rest Service In Mule
Rest Service In Mule
 
Rest service in mule
Rest service in mule Rest service in mule
Rest service in mule
 
Modeling REST API's Behaviour with Text, Graphics or Both?
Modeling REST API's Behaviour with Text, Graphics or Both?Modeling REST API's Behaviour with Text, Graphics or Both?
Modeling REST API's Behaviour with Text, Graphics or Both?
 
Rest API Automation with REST Assured
Rest API Automation with REST AssuredRest API Automation with REST Assured
Rest API Automation with REST Assured
 
IRJET- Rest API for E-Commerce Site
IRJET- Rest API for E-Commerce SiteIRJET- Rest API for E-Commerce Site
IRJET- Rest API for E-Commerce Site
 
Native REST Web Services with Oracle 11g
Native REST Web Services with Oracle 11gNative REST Web Services with Oracle 11g
Native REST Web Services with Oracle 11g
 
C# REST API
C# REST APIC# REST API
C# REST API
 
Introduction to REST and the Restlet Framework
Introduction to REST and the Restlet FrameworkIntroduction to REST and the Restlet Framework
Introduction to REST and the Restlet Framework
 

Recently uploaded

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 

Recently uploaded (20)

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 

Programming the Semantic Web with a REST Execution Language

  • 1. 1st Workshop on Programming the Semantic Web Toward Data-driven Programming for RESTful Linked Data Steffen Stadtmüller, Dr. Andreas Harth AIFB, Karlsruhe Institute of Technology, DE Boston, US, MA, 11/11/2012 INSTITUTE OF APPLIED INFORMATICS AND FORMAL DESCRIPTION METHODS (AIFB) www.aifb.kit.edu KIT – University of the State of Baden-Württemberg and National Laboratory of the Helmholtz Association www.kit.edu
  • 2. Agenda  Motivation  Programming with REST  Challenges  REST Execution Language  Formal Grounding  Client Behaviour Defined by Rules  REST Service Execution Engine  Rete Query Engine  Transition System  Conclusion  Related Work  Future Work  Summary 2 11/15/2012 REST Service Composition, Steffen Stadtmüller, M.Sc. www.aifb.kit.edu
  • 3. MOTIVATION 3 11/15/2012 REST Service Composition, Steffen Stadtmüller, M.Sc. www.aifb.kit.edu
  • 4. Motivation  The Web today is not only about serving static data:  APIs are used to trigger functionalities in the web and the real world as well (e.g., ordering a pizza or solving a re-captcha)  Programmableweb.com lists ~6000 APIs1  An important role plays Representational State Transfer (REST)  Software architecture for client–server interaction  Focused on the Web architecture 1http://programmableweb.com 4 11/15/2012 REST Service Composition, Steffen Stadtmüller, M.Sc. www.aifb.kit.edu
  • 5. Programming with REST  Functionality is enabled by exposing resources and allowing clients to manipulate them  Real world entities (e.g., car, movie, person…) are projected onto the web by making the information associated with them (their state) accessible on the Web.  Manipulation is possible with a constraint set of HTTP methods  No arbitrary function definition HTTP Verb Effect GET retrieves the representation/state of a resource identified with a URI PUT create or overwrite a resource identified by a client-generated URI POST create a resource identified by a service-generated URI DELETE deletes a resource (or its representation) identified with a URI 5 11/15/2012 REST Service Composition, Steffen Stadtmüller, M.Sc. www.aifb.kit.edu
  • 6. Programming with REST  REST is focussed on loose coupling, thus enabling flexibility and robustness toward server side changes  Representations of resources contain links to other resources to show clients what to do next  Interactions should not be hard-coded  Example:  Client creates a new Client pizza order POST Response POST Response  Pizza baker server replies 201 CREATED 200 OK with the created order Pizza Order including ETA and a link Topping: … Account PB to his bank account ETA: … Link  Client can use the bank Server (pizza baker) Server (bank) account resource to pay 6 11/15/2012 REST Service Composition, Steffen Stadtmüller, M.Sc. www.aifb.kit.edu
  • 7. Challenges to Address  REST allows service providers to use arbitrary formalisms to represent resources and links  Developers have to gain a deep understanding of every API by reading textual descriptions.  Applications (clients) are supposed to follow links as found during runtime of the application. However, developers have to define their desired interaction at design time.  Developers have to write individually tailored code to consume services in applications.  Approach:  Linked APIs: Linked Data / RDF as uniform semantic data model for resources  Declarative rule-based execution language for composition and orchestration  Execution Engine to perform the actual interaction 7 11/15/2012 REST Service Composition, Steffen Stadtmüller, M.Sc. www.aifb.kit.edu
  • 8. REST EXECUTION LANGUAGE 8 11/15/2012 REST Service Composition, Steffen Stadtmüller, M.Sc. www.aifb.kit.edu
  • 9. REST State Transition System  A Linked API establishes a state transition system on the Web:  Every state in the transition system is the collection of all states of the resources exposed by the service  An HTTP method applied to a resource potentially changes the state of resources and is therefore a transition in the system. PUT(... PUT(r2, d) POST(... r1 r2 r1 r2‘ r3 r3 GET(r1) GET(r3) r1 r3 9 11/15/2012 REST Service Composition, Steffen Stadtmüller, M.Sc. www.aifb.kit.edu
  • 10. REST State Transition System  A Linked API establishes a state transition system on the Web:  Every state in the transition system is the collection of all states of the resources exposed by the service  To every application of an HTTP method, the server replies with a defined response, that details the effected changes Client request response (r2’) PUT(... PUT(r2, d) POST(... r1 r2 r1 r2‘ r3 r3 GET(r1) GET(r3) r1 r3 10 11/15/2012 REST Service Composition, Steffen Stadtmüller, M.Sc. www.aifb.kit.edu
  • 11. Rule Execution Language  The state transition system builds the formal grounding for a rule execution language  A rule is of the form m(r, d)  Q  m: HTTP method (transition) to be applied  r: addressed resource (in the current state)  d: input data (potentially empty)  Q: Query as condition under which the rule is to be executed  Intuitively a rule defines what transition should be executed as subject to conditions on the current state 11 11/15/2012 REST Service Composition, Steffen Stadtmüller, M.Sc. www.aifb.kit.edu
  • 12. Query Bindings in Rule Bodies  Since resources are represented with RDF (graph model), RDF queries (graph pattern) are used as rule bodies  If a query delivers results, the corresponding transition is executed  The query results (i.e. bindings), can be used to construct the input data for HTTP method, if required M(r, d(?x) )  Q2 (?x) 12 11/15/2012 REST Service Composition, Steffen Stadtmüller, M.Sc. www.aifb.kit.edu
  • 13. Utilization of Links  Linked Data resources, as used by Linked APIs contain inherently links in their representation to other resources  Traditionally Linked Data resources can not be manipulated  But linked resources can also accessible for RESTful interaction  To leverage links enables the main advantage of REST (i.e., runtime flexibility)  Rule heads support the selection of resources as bindings produced by the query in the rule body: M(?x, d)  Q2 (?x) 13 11/15/2012 REST Service Composition, Steffen Stadtmüller, M.Sc. www.aifb.kit.edu
  • 14. Client Behaviour Defined by Rules  Clients maintain their own knowledge space that contains information about the current state of (some) resources Rule bodies (queries) are constantly evaluated over the knowledge space  If a query matches the information in the knowledge space, the method defined in the rule head is executed  The server informs the client about the effected changes, which updates the knowledge space Client Rule Set r1 r2 PUT(r3,d) r1 r2 Knowledge r4 r4 r8 r8 r3 Space PUT(r3,d)  Q1 r1 GET(r4,{})  Q2 r2 … r3 14 11/15/2012 REST Service Composition, Steffen Stadtmüller, M.Sc. www.aifb.kit.edu
  • 15. REST SERVICE EXECUTION ENGINE 15 11/15/2012 REST Service Composition, Steffen Stadtmüller, M.Sc. www.aifb.kit.edu
  • 16. Service Execution Engine - Rete  The Execution Engine uses a multi query engine at its core, capable of processing multiple queries in parallel based an the Rete algorithm Bindings  The queries are divided in their atomic parts (triple pattern) join join  A plan (β-net) is established, how join join the results of the atomic queries have to be joined to receive the TP1 TP2 TP3 TP4 result of the overall queries  RDF is sent through the net to receive the bindings of all queries Q1, Q2 RDF 16 11/15/2012 REST Service Composition, Steffen Stadtmüller, M.Sc. www.aifb.kit.edu
  • 17. Service Execution Engine – Transition System  If a binding for a query is found a transition system executes the HTTP method of the corresponding rule  The RDF response is sent through the β-net Bindings r1 join join Transition System Construct r2 Input join join PUT(r4) r4 TP1 TP2 TP3 TP4 GET(r1) POST(r3) r4 Q1, Q2 RDF Engine Web 17 11/15/2012 REST Service Composition, Steffen Stadtmüller, M.Sc. www.aifb.kit.edu
  • 18. Current Status  Engine works for a monotone subset of rules, i.e., only creation or extension of resources possible  Deletion and modification of resources can lead to non- deterministic behaviour in a declarative rule set: „Delete B if A exists.“ „Create C if B exists.“ Knowledge Space: {A, B} If C is created, depends on the order of evaluation.  Approach: Stratification, i.e. layering of rules, to ensure a deterministic evaluation order 18 11/15/2012 REST Service Composition, Steffen Stadtmüller, M.Sc. www.aifb.kit.edu
  • 19. Layered Composition  The execution language supports the notion of input and output defined with graph patterns:  Input(Q): Defines the structure of data that can initially be imported in the knowledge space to start the interaction  Output(Q): Defines the structure of data that is extracted from the knowledge space after the interaction  A defined interaction (i.e. rule set) can be deployed on the Web as resource itself  Input can be HTTP POSTed to the composed resource  Output is returned in the response 19 11/15/2012 REST Service Composition, Steffen Stadtmüller, M.Sc. www.aifb.kit.edu
  • 20. Layered Composition  The composed resource is server for other clients and client for resources on higher layers  Note: state of resources on higher layers can reach the client via the knowledge space r1 Bindings j o r2 POST (Input) i Transition System n Construct j j Input o o i i n n Client TP 1 TP 2 TP 3 TP 4 PUT(r4) GET(r1) POST(r3) Response (Output) r4 RDF Server / Client r4 20 11/15/2012 REST Service Composition, Steffen Stadtmüller, M.Sc. www.aifb.kit.edu
  • 21. CONCLUSION 21 11/15/2012 REST Service Composition, Steffen Stadtmüller, M.Sc. www.aifb.kit.edu
  • 22. Related Work  Kopecky et al.: Semantic Web Services and REST: WSMO-Lite  Pautasso: BPEL extension to compose WSDL-wrapped REST services  Hernandez et al.: Model for REST based on a combination of pi-calculus and an extension of triple space computing (Simperl et al.) REST is based on another kind of abstraction than traditional Service and SWS technologies: the resource. We favour a more data-driven approach  Verborgh et al.: RESTdesc, RESTful LD resources and composition with N3-reasoning  Bonetta et al.: script language S to develop REST resources with focus on performance due to parallel calculation We focus on the dynamic reaction on resource states for flexible behaviour  Krummenacher et al: Process Spaces; RESTful Linked Open Services read and write to a shared space  Speiser et al.: Linked Data services; RESTful Linked Data Improvement on these ideas with a well defined service model and an explicit definition of intended interactions 22 11/15/2012 REST Service Composition, Steffen Stadtmüller, M.Sc. www.aifb.kit.edu
  • 23. Future Work  Support for streaming resources, i.e. continuous state updates  Ensure deterministic behaviour with non monotone rule sets  Handling of non-Linked API resources (i.e., not Linked Data based)  Non-Linked Data resources (e.g., binary data, pictures, XML) can be stored separately by the engine and hooked in the knowledge space with a created URI  Validation, verification, auto-completion with the help of service descriptions 23 11/15/2012 REST Service Composition, Steffen Stadtmüller, M.Sc. www.aifb.kit.edu
  • 24. Summary  REST is a lightweight software architecture especially suited for client server interaction  Programs are based on the manipulation of (Linked Data) resources on the Web  Goals:  Mitigation of manual integration effort  Preservation of runtime flexibility (i.e., follow links) and capability to dynamically react on resource states  High scalability  Approach: Declarative rule-based execution language + engine, based on resources with Linked Data as uniform semantic data model Thank you 24 11/15/2012 REST Service Composition, Steffen Stadtmüller, M.Sc. www.aifb.kit.edu
  • 25. Backup: REST State Transition System – Formal Definition 25 11/15/2012 REST Service Composition, Steffen Stadtmüller, M.Sc. www.aifb.kit.edu

Editor's Notes

  1. Ever increasing
  2. Also data objects.Manipulation of the representation implies manipulation of the real world object.
  3. Advantage: bank change
  4. Integration and Composition Problem
  5. Composition side-by-side composition
  6. Composition side-by-side composition
  7. Q evaluated over current state of resources
  8. Remember KS contains resource representations
  9. Scalability!!!
  10. multithreaded
  11. Might complete previous semi query bindingsNo need for constant re-evaluation