Automating the Use of Web APIs through Lightweight Semantics

1,902 views

Published on

ICWE 2011 Tutorial:
Automating the Use of Web APIs through Lightweight Semantics
Maria Maleshkova, Carlos Pedrinaci and Dong Liu

Published in: Technology, Education
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,902
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
66
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide
  • Introduction (15min) Carlos: SOA (Publish, discover, invoke) Trends Web APIs- Current State
  • Lessons
  • One client to invoke them all
  • Automating the Use of Web APIs through Lightweight Semantics

    1. 1. Automating the Use of Web APIs through Lightweight Semantics <ul><li>The Open University </li></ul>ICWE 2011, Paphos, Cyprus
    2. 2. Presenters <ul><li>Carlos Pedrinaci [email_address] </li></ul><ul><li>Maria Maleshkova [email_address] </li></ul><ul><li>Dong Liu [email_address] </li></ul>
    3. 3. Acknowledgements <ul><li>Guillermo Alvaro (iSOCO) </li></ul><ul><li>Ning Li, Jacek Kopecky, Dave Lambert, John Domingue (OU) </li></ul><ul><li>Reto Krummenacher, University of Innsbruck </li></ul><ul><li>SOA4All Project </li></ul><ul><li>1 slide by Tom Gruber (Siri/Apple) </li></ul>
    4. 4. Structure of the Tutorial <ul><li>Morning </li></ul><ul><li>(Theory) </li></ul><ul><li>Intro </li></ul><ul><li>Background </li></ul><ul><li>Describing Web APIs </li></ul><ul><li>Discovering Web APIs </li></ul><ul><li>Invoking Web APIs </li></ul><ul><li>Afternoon </li></ul><ul><li>(Practice) </li></ul><ul><li>Hands-On Session </li></ul>
    5. 5. Preparation for Hands-On <ul><li>The material shown in this session will be the basis for the hands-on session afterwards </li></ul><ul><li>You need an up-to-date version of Firefox </li></ul><ul><li>Tabulator extension for Firefox </li></ul><ul><ul><li>http://dig.csail.mit.edu/2007/tab/ </li></ul></ul>
    6. 6. Interrupt!
    7. 7. Web Services or Services on the Web?
    8. 8. Web Services <ul><li>Large number of standards and implementations </li></ul><ul><ul><li>WSDL, BPEL, WS-Coordination, WS-Transaction, WS-AtomicTransaction, WS-★ </li></ul></ul>“ Despite their name,Web Services have nothing to do with the Web” Frank Leymann SSAIE 2009
    9. 9. Web Services on the Web <ul><li>The Web currently contains 30 billion Web pages </li></ul><ul><ul><li>Nearly 100M active sites </li></ul></ul><ul><ul><li>10 million new pages added each day </li></ul></ul><ul><li>T he Web contains only 28,000 WSDL Web services (Seekda.com) </li></ul><ul><li>Verizon have around 4,000 </li></ul>
    10. 10. Geek and Poke
    11. 11. The Ecosystem of APIs and Online Data ©Siri (sligthly modified) Over 3500 APIs and 5100 Mashups growing at accelerated rate...
    12. 12. Web APIs Technologies <ul><li>Web APIs are based on a light technology stack ≅ URIs, HTTP, XML/JSON </li></ul><ul><li>Very much aligned with Web technologies </li></ul><ul><li>Some are based on REST principles </li></ul><ul><ul><li>Resource identification through URIs </li></ul></ul><ul><ul><li>Uniform interface </li></ul></ul><ul><ul><li>Self-descriptive messages </li></ul></ul><ul><ul><li>Stateful interactions through hyperlinks </li></ul></ul>
    13. 13. Challenges with Web APIs <ul><li>There is not a widely used IDL </li></ul><ul><ul><li>Locating services is hard </li></ul></ul><ul><ul><li>Their use requires human interpretation of semi-structured descriptions </li></ul></ul><ul><li>The semantics of the services are not described in a machine processable manner </li></ul><ul><li>Prevents automating discovery, invocation, and composition of Web APIs </li></ul>
    14. 14. Tutorial Coverage <ul><li>In this tutorial we shall cover existing approaches to Web APIs </li></ul><ul><ul><li>Description </li></ul></ul><ul><ul><li>Discovery </li></ul></ul><ul><ul><li>Invocation </li></ul></ul><ul><li>We shall present an integrated approach based on the use of semantic technologies </li></ul>
    15. 15. Background
    16. 16. Semantic Web Principles <ul><li>Lift data available on the Web to a level where machines can manipulate it in “meaningful ways” </li></ul><ul><li>Adding machine “understandable” annotations about Web resources </li></ul><ul><li>All resources are identified by URIs </li></ul><ul><li>Use of Web oriented modeling languages </li></ul><ul><ul><li>RDF & RDFS </li></ul></ul><ul><ul><li>OWL (Lite, DL, Full) & OWL2 (EL, QL, RL) </li></ul></ul><ul><li>Use of conceptual models (ontologies, vocabularies) </li></ul>
    17. 17. RDF <ul><li>Resource Description Framework (RDF) is the HTML of the Semantic Web </li></ul><ul><ul><li>Simple way to describe resources on the Web </li></ul></ul><ul><ul><li>Based on triples <subject, predicate, object> </li></ul></ul><ul><ul><li>Defines graphs </li></ul></ul>
    18. 18. RDF Example
    19. 19. RDF Example
    20. 20. RDF Example
    21. 21. RDF Representation <ul><li>Several available. Only standard RDF/XML </li></ul>@prefix ex: < http://www.example.org/rdf-example# > @prefix dc: < http://purl.org/dc/elements/1.1/ > ex:Person a rdfs:Class. ex:Carlos a ex:Person. ex:Doc a rdfs:Class. ex:Slide rdfs:subClassOf ex:Doc. ex:this a ex:Slide. ex:this dc:hasCreator ex:Carlos. ...
    22. 22. Ontology and Rule languages <ul><li>RDF Schema (RDFS) </li></ul><ul><ul><li>A simple ontology language on RDF </li></ul></ul><ul><li>Web Ontology Language (OWL) is a more expressive ontology language than RDFS </li></ul><ul><ul><li>Layered language based on Description Logics </li></ul></ul><ul><ul><ul><li>OWL Lite, OWL DL, OWL Full </li></ul></ul></ul><ul><ul><ul><li>OWL2 (EL, QL, RL) </li></ul></ul></ul><ul><li>Rule languages </li></ul><ul><ul><li>Rule Interchange Format (RIF) </li></ul></ul><ul><ul><li>Extend ontology languages with axioms </li></ul></ul>
    23. 23. SPARQL <ul><li>Query language for RDF </li></ul><ul><li>Can be used to express queries across diverse data sources </li></ul><ul><li>SPARQL contains capabilities for querying required and optional graph patterns along with their conjunctions and disjunctions </li></ul><ul><li>The results of SPARQL queries can be results sets or RDF graphs </li></ul>
    24. 24. SPARQL Select Example PREFIX foaf: http://xmlns.com/foaf/0.1/ SELECT ?name1 ?name2 WHERE { ?x foaf:name ?name1 ; foaf:mbox ?mbox1 . ?y foaf:name ?name2 ; foaf:mbox ?mbox2 . FILTER (sameTerm(?mbox1, ?mbox2) && !sameTerm(?name1, ?name2)) }
    25. 25. SPARQL Construct Example PREFIX foaf: http://xmlns.com/foaf/0.1/ PREFIX vcard: http://www.w3.org/2001/vcard-rdf/3.0# CONSTRUCT { ?x vcard:N _:v . _:v vcard:givenName ?gname . _:v vcard:familyName ?fname } WHERE { { ?x foaf:firstname ?gname } UNION { ?x foaf:givenname ?gname } . { ?x foaf:surname ?fname } UNION { ?x foaf:family_name ?fname } . }
    26. 26. Describing Web APIs
    27. 27. Components Descriptions <ul><li>Software Engineering has traditionally aimed at reaching further abstraction </li></ul><ul><li>Lead to the definition of objects and components for abstraction and reuse </li></ul><ul><li>Remote components </li></ul><ul><ul><li>RPC, RMI, CORBA, DCOM, etc </li></ul></ul><ul><li>They all rely on an IDL for describing the interface of the component </li></ul>
    28. 28. WSDL Wikipedia
    29. 29. Semantic Web Services <ul><li>Web Service descriptions do not capture the semantics of services (data, functionality, and NFP) </li></ul><ul><li>Limitations for Discovery, Invocation, Composition, etc </li></ul><ul><li>Semantic Web Service technologies were proposed to circumvent these issues </li></ul><ul><ul><li>OWL-S, WSMO, SAWSDL </li></ul></ul>
    30. 30. Semantic Web Services OWL-S WSMO
    31. 31. Semantic Web Services <ul><li>Existing approaches like OWL-S, WSMO are (perceived as) complex in terms of </li></ul><ul><ul><li>Modeling and Computational complexity </li></ul></ul><ul><li>SAWSDL is purposely underspecified </li></ul><ul><li>Web APIs preferred over WSDL Web Services and SWS were up to now built on top of WSDL </li></ul>
    32. 32. Web APIs Description <ul><li>There is no standard </li></ul><ul><ul><li>WADL is a W3C Submission but not widely used </li></ul></ul><ul><li>Different conceptual styles from RESTful to RPC </li></ul>Service Nature Percentage of APIs RPC-Style 47.8 RESTful 32.4 Hybrid 19.8
    33. 33. Describing Web APIs
    34. 34. State of Web APIs Descriptions <ul><li>Survey based on 222 Web APIs from ProgrammableWeb from 21 categories </li></ul><ul><li>40% of Web APIs do not state the used HTTP method! </li></ul><ul><li>Authentication </li></ul><ul><ul><li>80% require authentication (37% use API Key, 14%HTTP Basic, 6% OAuth, etc) </li></ul></ul><ul><li>Input and Output information </li></ul><ul><ul><li>72% do not state the data type of the input parameters </li></ul></ul><ul><ul><li>61% use optional parameters, 45% use default values </li></ul></ul><ul><ul><li>90% have as output XML, 42% JSON </li></ul></ul><ul><ul><li>84% provide example request and 75% example response </li></ul></ul>
    35. 35. Kinds of Service Semantics F N B I
    36. 36. Functional Semantics <ul><li>For service discovery, composition </li></ul><ul><li>Category </li></ul><ul><ul><li>Functionality categorization </li></ul></ul><ul><ul><li>E.g. eCl@ss </li></ul></ul><ul><ul><li>Or tagging, folksonomies </li></ul></ul><ul><li>Capability </li></ul><ul><ul><li>Precondition, Effect </li></ul></ul><ul><ul><li>Needs using some rule language (WSML, RIF, etc) </li></ul></ul>F
    37. 37. Category Example wl:FunctionalClassificationRoot ex:Travel ReservationService ex:Accommodation ReservationService subclasses type ex:eCommerceService
    38. 38. Capability Example <ul><li>ex:RomaHotelReservationPrecondition </li></ul><ul><li>rdf:type wl:Condition ; </li></ul><ul><li>rdf:value &quot;&quot;&quot; </li></ul><ul><li>?request </li></ul><ul><li>[ numberOfGuests hasValue ?guests </li></ul><ul><li>and city hasValue ?city ] </li></ul><ul><li>memberOf ReservationData </li></ul><ul><li>and ?guests <= 10 </li></ul><ul><li>and ?city = 'Roma' </li></ul><ul><li>&quot;&quot;&quot;^^wsml:AxiomLiteral . </li></ul>
    39. 39. Non-functional Semantics <ul><li>For ranking and selection </li></ul><ul><li>Not constrained, any ontologies </li></ul><ul><li>Example: </li></ul><ul><li>ex:PriceSpecification </li></ul><ul><li>rdfs:subClassOf wl:NonFunctionalParameter . </li></ul><ul><li>ex:ReservationFee </li></ul><ul><li>rdf:type ex:PriceSpecification ; </li></ul><ul><li>rdf:value &quot;15&quot;^^ex:euroAmount . </li></ul>N
    40. 40. Behavioral Semantics <ul><li>For invocation, composition, process mediation </li></ul><ul><li>Functionalities on operations </li></ul><ul><ul><li>Capabilities, categories </li></ul></ul><ul><li>Client selects operation to invoke next </li></ul><ul><ul><li>Instead of being strictly guided by an explicit process </li></ul></ul><ul><li>Example functional category for operations: </li></ul><ul><ul><li>Web Architecture: interaction safety </li></ul></ul>B
    41. 41. Information Semantics <ul><li>For invocation, composition, data mediation </li></ul><ul><li>Not constrained, any ontologies </li></ul><ul><li>Marked as wl:Ontology </li></ul>I
    42. 42. Conceptual Model
    43. 43. Semantics for RESTful and WSDL
    44. 44. hRESTS <ul><li>&quot;There's usually an HTML page&quot; </li></ul><ul><li>Identifying machine-readable parts </li></ul><ul><ul><li>Service, its operations </li></ul></ul><ul><ul><li>Resource address, HTTP method </li></ul></ul><ul><ul><li>Input/output data format </li></ul></ul><ul><li>hRESTS microformat </li></ul><ul><ul><li>Technically, a poshformat </li></ul></ul>
    45. 45. hRESTS <ul><li>H TML for REST ful S ervice Description </li></ul><ul><li>Introduces the service model structure </li></ul><ul><ul><li>service (+ label ) </li></ul></ul><ul><ul><li>operations (+ address , method ) </li></ul></ul><ul><ul><li>input , output </li></ul></ul><ul><li>Can also be in RDFa </li></ul><ul><li>Basis for extensions: </li></ul><ul><ul><li>MicroWSMO adds semantic annotations </li></ul></ul>
    46. 46. MicroWSMO <ul><li>Extends hRESTS </li></ul><ul><ul><li>model for model references </li></ul></ul><ul><ul><li>lifting, lowering </li></ul></ul><ul><li>Applies WSMO-Lite semantics presented earlier </li></ul>
    47. 47. Annotation Example
    48. 48. Annotation Example
    49. 49. Annotation Example Service Operation Input Parameter
    50. 50. Annotation Example Service Operation Input Parameter
    51. 51. Annotation Example <ul><ul><li><div class=&quot;service&quot; id=&quot;service1” > </li></ul></ul><ul><ul><li><h1 class=&quot;header”> </li></ul></ul><ul><ul><li>< span class=&quot;label&quot; id=&quot;label2&quot; >Last.fm Web </li></ul></ul><ul><ul><li>Services</span> </li></ul></ul><ul><ul><li>[...] </li></ul></ul><ul><ul><li><div class=&quot;operation&quot; id=&quot;operation1&quot; ><h1><span class=&quot;label&quot; id=&quot;label1&quot; >artist.getInfo</span></h1> </li></ul></ul><ul><ul><li><div class=&quot;wsdescription&quot;>Get the metadata for an artist on </li></ul></ul><ul><ul><li>Last.fm. Includes biography.</div> </li></ul></ul><ul><ul><li>[...] </li></ul></ul><ul><ul><li><div class=&quot;input&quot; id=&quot;input1&quot; ><span class=&quot;param&quot; >artist</span> </li></ul></ul><ul><ul><li>[...] </li></ul></ul>
    52. 52. Annotation Example <ul><ul><li><div class=&quot;service&quot; id=&quot;service1”> </li></ul></ul><ul><ul><li><h1 class=&quot;header”> </li></ul></ul><ul><ul><li><span class=&quot;label&quot; id=&quot;label2&quot;>Last.fm Web </li></ul></ul><ul><ul><li>Services</span> </li></ul></ul><ul><ul><li><a rel=&quot;model&quot; href=&quot;http://www.service-finder.eu/ontologies/ServiceCategories#Music&quot; ></a> </li></ul></ul><ul><ul><li><div class=&quot;operation&quot; id=&quot;operation1&quot;><h1><span class=&quot;label&quot; id=&quot;label1&quot;>artist.getInfo</span></h1> </li></ul></ul><ul><ul><li><div class=&quot;wsdescription&quot;>Get the metadata for an artist on </li></ul></ul><ul><ul><li>Last.fm. Includes biography.</div> </li></ul></ul><ul><ul><li>[...] </li></ul></ul>
    53. 53. Resulting RDF Model <ul><ul><li><rdf:Description rdf:about=&quot;http://iserve…&quot;> </li></ul></ul><ul><ul><li><rdf:type rdf:resource=“ msm:Service &quot;/> </li></ul></ul><ul><ul><li>< sawsdl:modelReference rdf:resource=&quot;http://www.service-finder.eu/ontologies/ServiceCategories#Music&quot;/> </li></ul></ul><ul><ul><li></rdf:Description> </li></ul></ul><ul><ul><li><rdf:Description rdf:about=”http://iserve…&quot;> </li></ul></ul><ul><ul><li><rdf:type rdf:resource=” msm:Operation &quot;/> </li></ul></ul><ul><ul><li></rdf:Description> </li></ul></ul><ul><ul><li><rdf:Description rdf:about=&quot;http://iserve…&quot;> </li></ul></ul><ul><ul><li><rdf:type rdf:resource=” msm#MessageContent &quot;/> </li></ul></ul><ul><ul><li></rdf:Description> </li></ul></ul><ul><ul><li>[…] </li></ul></ul>
    54. 54. Web APIs Discovery
    55. 55. Outline <ul><li>Matchmaking and Ranking </li></ul><ul><li>Traditional Web Service Discovery and UDDI </li></ul><ul><li>Semantic Matchmaking </li></ul><ul><ul><li>Logic-based Methods </li></ul></ul><ul><ul><li>Non-Logic-based Methods </li></ul></ul><ul><ul><li>Hybrid Methods </li></ul></ul><ul><li>Discovery of Web APIs </li></ul><ul><ul><li>ProgrammableWeb </li></ul></ul><ul><ul><li>Google API Discovery Service </li></ul></ul><ul><ul><li>iServe Approach </li></ul></ul>
    56. 56. Matchmaking <ul><li>Find candidate Web Services that can provide the desired functionality using </li></ul><ul><ul><li>Information Retrieval (IR) techniques </li></ul></ul><ul><ul><ul><li>Match natural language keywords in resource descriptions, similarity analysis </li></ul></ul></ul><ul><ul><li>Semantic Matchmaking </li></ul></ul><ul><ul><ul><li>Reasoning applied over descriptions, i.e., Inputs/Outputs, Preconditions, Effects, Classifications, QoS, Tags, … </li></ul></ul></ul><ul><ul><li>Structural analysis </li></ul></ul><ul><ul><li>Hybrid IR/semantic solutions perform better </li></ul></ul>
    57. 57. Ranking <ul><li>Rank and eventually select the best service given certain criteria </li></ul><ul><li>Often applied after service matchmaking using </li></ul><ul><ul><li>Different degrees of match for ranking (exact > plugin, etc.) </li></ul></ul><ul><ul><li>Non-functional properties (QoS, response time, user location, ratings, etc.) </li></ul></ul><ul><li>Techniques </li></ul><ul><ul><li>Weighted combination, skyline, fuzzy reasoning </li></ul></ul>
    58. 58. Traditional Web Service Discovery
    59. 59. UDDI <ul><li>U niversal D escription, D iscovery and I ntegration </li></ul><ul><li>A Web service registry API specification </li></ul><ul><ul><li>Business-oriented service publication, discovery (initially limited search capabilities) </li></ul></ul><ul><ul><li>Itself has Web service interface </li></ul></ul><ul><ul><li>Useful for intranet registries </li></ul></ul><ul><li>A failed public service </li></ul><ul><ul><li>Not particularly useful discovery support </li></ul></ul><ul><ul><li>Discontinued in 2006 </li></ul></ul>
    60. 60. Semantic Matchmaking <ul><li>Logic-based Methods </li></ul><ul><ul><li>Logical Unfolding </li></ul></ul><ul><ul><li>Matching Degree </li></ul></ul><ul><ul><li>Input and Output </li></ul></ul><ul><ul><li>Functional Classification </li></ul></ul><ul><li>Non-logic-based Methods </li></ul><ul><ul><li>Text Similarity </li></ul></ul><ul><ul><li>Structural Analysis </li></ul></ul><ul><ul><li>Collaborative Filtering </li></ul></ul><ul><li>Hybrid Methods </li></ul><ul><ul><li>Logic-based + Non-logic-based </li></ul></ul>
    61. 61. Logical Unfolding <ul><li>Name Symbols vs. Base Symbols </li></ul><ul><li>Example : </li></ul>
    62. 62. Matching Degree <ul><li>Exact </li></ul><ul><ul><li>R and S are equivalent concepts </li></ul></ul><ul><li>Plug in </li></ul><ul><ul><li>R is a sub-concept of S </li></ul></ul><ul><li>Subsumes </li></ul><ul><ul><li>R is a super-concept of S </li></ul></ul><ul><li>Intersection </li></ul><ul><ul><li>If the intersection of S and R is satisfiable </li></ul></ul><ul><li>Disjoint (Mismatch, Fail) </li></ul><ul><ul><li>If the intersection of S and R is not satisfiable </li></ul></ul>
    63. 63. Matching Degree
    64. 64. Input and Output <ul><li>Input </li></ul><ul><ul><li>Exact > Plug in > Subsumes > Intersection > Disjoint </li></ul></ul><ul><li>Output </li></ul><ul><ul><li>Exact > Subsumes > Plug in > Intersection > Disjoint </li></ul></ul><ul><li>Example </li></ul><ul><ul><li>Requst </li></ul></ul><ul><ul><ul><li>Input: Fruit, Output: TaxedPrice </li></ul></ul></ul><ul><ul><li>Service A </li></ul></ul><ul><ul><ul><li>Input: Food, Output: UKTaxedPrice </li></ul></ul></ul><ul><ul><ul><li>Input: Plug in; Output: Subsumes </li></ul></ul></ul><ul><ul><li>Service B </li></ul></ul><ul><ul><ul><li>Input: Apple, Output: Price </li></ul></ul></ul><ul><ul><ul><li>Input: Subsumes; Output: Plug in </li></ul></ul></ul>
    65. 65. Functional Classification <ul><li>Find “Exact” or “Plug in” of Service Category </li></ul><ul><li>Example </li></ul><ul><ul><li>Taxonomy </li></ul></ul><ul><ul><ul><li>Service Finder : http://www.service-finder.eu/ontologies/ServiceCategories </li></ul></ul></ul><ul><ul><li>Service </li></ul></ul><ul><ul><ul><li><rdf:Description rdf:about=&quot;http://.../Service&quot;> </li></ul></ul></ul><ul><ul><ul><li><sawsdl:modelReference rdf:resource=&quot;http://www.service-finder.eu/ontologies/ServiceCategories#Content&quot;/> </li></ul></ul></ul><ul><ul><ul><li></rdf:Description> </li></ul></ul></ul><ul><ul><li>Query </li></ul></ul><ul><ul><ul><li>SELECT ?service WHERE { ?service sawsdl:modelReference ?c . </li></ul></ul></ul><ul><ul><ul><li>?c rdfs:subClassOf sf:Content . } </li></ul></ul></ul>
    66. 66. Non-Logic-based <ul><li>Text Similarity </li></ul><ul><ul><li>Method </li></ul></ul><ul><ul><ul><li>Levenshtein, TF-IDF, Jaro, Averaged String Matching, etc </li></ul></ul></ul><ul><ul><li>Library </li></ul></ul><ul><ul><ul><li>SecondString, SimMetrics, SimPack, etc </li></ul></ul></ul><ul><li>Structural Analysis </li></ul><ul><ul><li>XML schema of input/output messages </li></ul></ul><ul><li>Collaborative Filtering </li></ul><ul><ul><li>Text similarity of tags </li></ul></ul>
    67. 67. Example <ul><li>Example for Levenshtein Distance </li></ul><ul><ul><li>Levenshtein (&quot;CarBicyclePrice service”, ”Car Bicycle Taxed Price Service”) = 9 </li></ul></ul><ul><ul><li>Play online: http://www.functions-online.com/ levenshtein.html </li></ul></ul><ul><ul><li>Ranking services by the Levenshtein Distance between labels of request and candidate services </li></ul></ul>
    68. 68. Hybrid <ul><li>Logic-based + Non-logic-based </li></ul><ul><li>Related Techniques </li></ul><ul><ul><li>Vector </li></ul></ul><ul><ul><ul><li>Euclidean, Dice, Cosine, Jaccard, Manhattan, Overlap, Pearson, etc </li></ul></ul></ul><ul><ul><li>Tree </li></ul></ul><ul><ul><ul><li>Bottom-up/Top-down Maximum Common Subtree, Tree Edit Distance </li></ul></ul></ul><ul><ul><li>Graph </li></ul></ul><ul><ul><ul><li>Bipartite graph-matching , Conceptual Similarity, Graph Isomorphism, Subgraph Isomorphism, Maximum Common Subgraph Isomorphism, Graph Isomorphism Covering, Shortest Path </li></ul></ul></ul><ul><ul><li>Set </li></ul></ul><ul><ul><ul><li>Jaccard, Loss of Information, Resemblance </li></ul></ul></ul>
    69. 69. Reflections on Different Techniques <ul><li>Logic-based vs. Non-logic-based methods </li></ul><ul><ul><li>“ Integration of logic-based reasoning with text similarity may significantly improve precision at the cost of higher avg query response time.” </li></ul></ul><ul><ul><li>“ Hybrid semantic matching can be less precise than mere logic-based matching in case of syntactic pre-filtering of services (two-phase vs. integrative hybrid).” </li></ul></ul><ul><li>Cache mechanism for ontologies helps improve performance </li></ul>
    70. 70. Discovery of Web APIs <ul><li>ProgrammableWeb: Keyword, Category, Company... </li></ul>
    71. 71. Discovery of Web APIs <ul><li>Google: Label, Name, Preferred </li></ul>
    72. 72. Discovery of Web APIs <ul><li>iServe approach </li></ul><ul><ul><li>iServe architecture </li></ul></ul><ul><ul><li>Implemented Discovery Mechanisms </li></ul></ul><ul><ul><ul><li>Simple SPARQL-based </li></ul></ul></ul><ul><ul><ul><li>Inputs/Outputs logic-based using RDFS reasoning </li></ul></ul></ul><ul><ul><ul><li>Functional classifications with RDFS reasoning </li></ul></ul></ul><ul><ul><ul><li>Similarity analysis based on iMatcher </li></ul></ul></ul><ul><ul><ul><li>Support to re-use most of existing discovery mechanisms </li></ul></ul></ul><ul><ul><ul><li>Atom-based discovery </li></ul></ul></ul><ul><ul><ul><ul><li>Discovery mechanisms return an Atom feed with the results </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Provides Atom feed combinators: Union, Intersection, Subtract </li></ul></ul></ul></ul>
    73. 73. iServe Architecture
    74. 74. iServe Architecture
    75. 75. Minimal Service Model
    76. 76. SPARQL based <ul><li>Find services by executing SPARQL query </li></ul><ul><li>Example </li></ul><ul><ul><li>SELECT ?s WHERE { </li></ul></ul><ul><ul><li>?s <http://purl.org/dc/elements/1.1/creator> <http://iserve.kmi.open.ac.uk/foaf.rdf#iServe> </li></ul></ul><ul><ul><li>} LIMIT 10 </li></ul></ul>
    77. 77. I/O based <ul><li>Use ontological annotations of inputs and outputs </li></ul><ul><li>Do RDFS reasoning </li></ul><ul><li>Available at </li></ul><ul><ul><li>http://iserve.kmi.open.ac.uk/data/disco/io-rdfs?f={and|or}&i=I1&i=I2&o=O1& ... </li></ul></ul><ul><li>Example </li></ul><ul><ul><li>http://iserve.kmi.open.ac.uk/data/disco/io-rdfs?f=and&i=http://purl.org/iserve/ontology/owlstc/SUMO.owl%23Vehicle&o=http://purl.org/iserve/ontology/owlstc/concept.owl%23Price </li></ul></ul>
    78. 78. Functional Classification <ul><li>Functional Classification Root </li></ul><ul><ul><li>Defined by WSMO-Lite </li></ul></ul><ul><ul><li>Subclasses of instances of FCR are functional categories </li></ul></ul><ul><ul><li>Assigned to services through sawsdl:modelReferences </li></ul></ul><ul><ul><li>Available at </li></ul></ul><ul><ul><ul><li>http://iserve.kmi.open.ac.uk/data/disco/func-rdfs?{classes } </li></ul></ul></ul><ul><ul><li>Example </li></ul></ul><ul><ul><ul><li>http://iserve.kmi.open.ac.uk/data/disco/func-rdfs?class=http://www.service-finder.eu/ontologies/ServiceCategories%23SMS </li></ul></ul></ul>
    79. 79. Similarity analysis <ul><li>Implemented based on iMatcher </li></ul><ul><ul><li>iMatcher provides a number of similarity-based approximate matchmaking strategies </li></ul></ul><ul><ul><li>Two of them (Levenshtein, TF-IDF) are ported to iServe and available at </li></ul></ul><ul><ul><ul><li>http://iserve.kmi.open.ac.uk/data/disco/imatch?strategy=levenshtein&label=L </li></ul></ul></ul><ul><ul><ul><li>http://iserve.kmi.open.ac.uk/data/disco/imatch?strategy=tfidfd&comment=C </li></ul></ul></ul><ul><li>Example </li></ul><ul><ul><li>http://iserve.kmi.open.ac.uk/data/disco/imatch?strategy=levenshtein&label=ribbit </li></ul></ul><ul><ul><li>http://iserve.kmi.open.ac.uk/data/disco/imatch?strategy=tfidfd&comment=service </li></ul></ul>
    80. 80. Web API Invocation
    81. 81. Web Service Invocation <ul><li>Find and retrieve Web service entry in UDDI </li></ul><ul><li>Extracts WSDL URL </li></ul><ul><li>Retrieves WSDL file and use it to generate stub/hub code </li></ul><ul><li>Get input data or prompt user for operation and operands </li></ul><ul><li>Invokes web service with user input </li></ul><ul><li>Displays result </li></ul>
    82. 82. WSDL-based Invocation <ul><ul><li>Stubs provide a local interface to the remote Web service </li></ul></ul>ticketBooker_Appl { // GUI code wsProxy = new tixServiceStub (); wsProxy.book(…); } Application tixService { book (…) { // Actual business // logic } } Web Service tixServiceStub { book (…) { // SOAPCall } } SOAP SOAP
    83. 83. Web API Invocation <ul><li>Manual discovery </li></ul><ul><ul><li>Keyword search in search engines </li></ul></ul><ul><ul><li>Search in API depositories </li></ul></ul><ul><ul><li>Word of mouth </li></ul></ul><ul><li>Interpreting of the documentation </li></ul><ul><ul><li>Completing missing information </li></ul></ul><ul><li>Custom implementation solutions </li></ul><ul><ul><li>Low level of reusability </li></ul></ul>
    84. 84. Current Invocation Support <ul><li>WSDL and WADL-based invocation </li></ul><ul><li>Implementation support </li></ul><ul><ul><li>Jersey, Apache Axis, JOpera </li></ul></ul><ul><li>Pipe-based solutions </li></ul><ul><ul><li>Yahoo pipes, Deri pipes, IBM mashup center </li></ul></ul><ul><li>Google ‘meta’ API </li></ul><ul><li>Semantic approaches: </li></ul><ul><ul><li>SPICES </li></ul></ul><ul><ul><li>Lambert et. al </li></ul></ul>
    85. 85. Challenges <ul><li>Lack of widely accepted IDL </li></ul><ul><ul><li>Web APIs commonly described in HTML </li></ul></ul><ul><li>Underspecification </li></ul><ul><ul><li>27.5% APIs that state the data-type of the parameters </li></ul></ul><ul><ul><li>60.4% Provide HTTP method </li></ul></ul><ul><li>Heterogeneity </li></ul><ul><ul><li>47.8 % RPC-Style, 32.4% RESTful, 19.8% Hybrid </li></ul></ul><ul><ul><li>61.3% use optional parameters </li></ul></ul><ul><ul><li>51.3% use alternative values for a parameter </li></ul></ul><ul><ul><li>44.6% use default values for parameters </li></ul></ul><ul><ul><li>24.8% use coded values for a parameter </li></ul></ul>
    86. 86. Why Lightweight Semantics? <ul><li>Non-invasive approach </li></ul><ul><ul><li>Enriching the existing HTML documentation, NOT requiring new description files </li></ul></ul><ul><ul><li>Syntactic structuring via microformats inserted in the HTML </li></ul></ul><ul><ul><li>Semantic enhancement via model references </li></ul></ul><ul><li>Based on a common Web API grounding model </li></ul><ul><ul><li>Declarative specification of what the API does </li></ul></ul><ul><ul><li>Abstraction layer over current heterogeneity </li></ul></ul><ul><ul><li>Semantics as basis for task automation support </li></ul></ul>
    87. 87. Invocation Step-by-Step <ul><li>Construct HTTP request: </li></ul><ul><ul><li>Identify the HTTP Method </li></ul></ul><ul><ul><li>Construct invocation URI </li></ul></ul><ul><ul><li>Construct HTTP body and header </li></ul></ul><ul><ul><li>Prepare the input data </li></ul></ul><ul><li>Actual invocation </li></ul><ul><li>Process the HTTP response </li></ul><ul><ul><li>Response handling </li></ul></ul><ul><ul><li>Process the output data </li></ul></ul><ul><ul><li>Present the output </li></ul></ul><ul><ul><li>Error handling </li></ul></ul>
    88. 88. Example Request <ul><li>http://ws.audioscrobbler.com/2.0/?method=artist.getinfo&artist=Cher&api_key=*** </li></ul>GET /2.0/?method=artist.getinfo HTTP/1.0 User-agent: curl/7.19.7 Mozilla/4.0 Host: ws.audioscrobbler.com Accept: */* text/html, image/gif,image/jpeg Accept-language:fr request line (GET, POST, HEAD commands) header lines
    89. 89. Example Response HTTP/1.0 200 OK Connection: close Date: Thu, 06 Aug 1998 12:00:15 GMT Server: Apache/1.3.0 (Unix) Last-Modified: Mon, 22 Jun 1998 …... Content-Length: 6821 Content-Type: text/html data data data data data ... status line (protocol status code status phrase) header lines data, e.g., requested html file
    90. 90. HTTP Response Status Codes <ul><li>200 OK </li></ul><ul><ul><li>request succeeded </li></ul></ul><ul><li>301 Moved Permanently </li></ul><ul><ul><li>requested object moved </li></ul></ul><ul><li>400 Bad Request </li></ul><ul><ul><li>request message not understood by server </li></ul></ul><ul><li>404 Not Found </li></ul><ul><ul><li>requested document not found on this server </li></ul></ul><ul><li>505 HTTP Version Not Supported </li></ul><ul><li>Custom Errors in about 50% </li></ul>
    91. 91. Requirements on Web API Descriptions <ul><li>Capture HTTP method </li></ul><ul><li>Operation definition </li></ul><ul><ul><li>If necessary, mapping of resource to operation definition </li></ul></ul><ul><li>Parameterized URI definition </li></ul><ul><li>Distinction between service and operation address </li></ul><ul><li>Input grounding </li></ul><ul><li>Input lowering / Output lifting </li></ul><ul><li>Distinction between the inputs and outputs as a whole and their parts </li></ul><ul><li>Invocation relevant input (optional and output format parameters) </li></ul><ul><li>Custom errors support </li></ul>
    92. 92. Current State
    93. 93. Web API Grounding Model
    94. 94. Data Grounding <ul><li>Which part of the input goes where? </li></ul><ul><ul><li>Parameters belonging in the URI </li></ul></ul><ul><ul><li>Parameters transmitted in the HTTP body </li></ul></ul><ul><ul><li>HTTP header parameters </li></ul></ul><ul><li>isGroundeIn property </li></ul><ul><li>SchemaMapping expected transformation type </li></ul><ul><ul><li>acceptsContentType and producesContentType </li></ul></ul>
    95. 95. Granularity of the Input and Output <ul><li>MessageContent and MessageParts </li></ul><ul><ul><li>Individual grounding of MessageParts </li></ul></ul><ul><ul><li>Individual lifting and lowering schemas </li></ul></ul><ul><ul><li>Optional and mandatory parts </li></ul></ul><ul><ul><li>Parts relevant for invocation such as output format and authentication parameters </li></ul></ul><ul><li>Important for Invocation </li></ul><ul><li>But also for discovery and composition </li></ul>
    96. 96. Invocation Engine
    97. 97. Data Transformations
    98. 98. Invocation Steps
    99. 99. LastFM API Invocation
    100. 100. Lowering <ul><li>Artist </li></ul><ul><li>API Key </li></ul>declare namespace foaf = &quot;http://xmlns.com/foaf/0.1&quot;; declare namespace mo = &quot;http://purl.org/ontology/mo/&quot;; { for $artist_name $artist from <file:StaticInputFile> where { $artist a mo:MusicArtist; foaf:name $artist_name. } return {$artist_name}} declare namespace waa = &quot;http://purl.oclc.org/NET/WebApiAuthentication#&quot;; declare namespace sioc = &quot;http://rdfs.org/sioc/ns#&quot;; { for $apikey $user from <file:StaticInputFile> where { $user a sioc:UserAccount; waa:API_Key $apikey.} return {$apikey}}
    101. 101. Lifting declare namespace foaf=&quot;http://xmlns.com/foaf/0.1&quot;; declare namespace mo=&quot;http://purl.org/ontology/mo/&quot;; let $doc :=doc(&quot;OriginalOutputFile&quot;) for $listing in $doc//artist let $name := $listing/name let $id := $listing/mbid let $url := $listing/url let $image := $listing/image[@size='medium'] construct { _:p a mo:Artist; foaf:name {data($name)}; mo:musicbrainz_guid {data($id)}; mo:homepage {data($url)}; mo:image {data($image)}; }
    102. 102. Invocation Example <ul><li>http://iserve.kmi.open.ac.uk/rest- invoke/service/{ServiceUID}/operation/{OperationName} </li></ul><ul><ul><li>http://iserve-dev.kmi.open.ac.uk:8080/RestInvoke/service/db4b646a-4665-4337-9626-4669cc8bce56/operation/ArtistGetInfo/invoke </li></ul></ul><rdf:RDF xmlns:rdf=&quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#&quot; xmlns:waa=&quot;http://purl.oclc.org/NET/WebApiAuthentication#&quot; xmlns:mo=&quot;http://purl.org/ontology/mo/&quot; xmlns:foaf=&quot;http://xmlns.com/foaf/0.1&quot; xmlns:sioc=&quot;http://rdfs.org/sioc/ns#&quot;> <mo:MusicArtist rdf:about=&quot;#artist1&quot;> <foaf:name>Cher</foaf:name> </mo:MusicArtist> <sioc:UserAccount rdf:about=&quot;#usr0&quot;> <waa:API_Key>b25b959554ed76058ac220b7b2e0a026</waa:API_Key> </sioc:UserAccount></rdf:RDF>
    103. 103. Conclusions <ul><li>Current world of Services on the Web is very: </li></ul><ul><ul><li>Heterogeneous </li></ul></ul><ul><ul><li>Not conforming to standards or guidelines </li></ul></ul><ul><ul><li>Suffering from underspecification </li></ul></ul><ul><li>Need of a unifying model capable of supporting invocation </li></ul><ul><li>Web API Grounding model </li></ul><ul><li>Invocation Engine </li></ul>
    104. 104. Wrap-up <ul><li>Current world of Web APIs is “messy” </li></ul><ul><ul><li>Heterogeneity and underspecification </li></ul></ul><ul><li>Implications on discovery, composition and invocation </li></ul><ul><ul><li>A lot of manual effort </li></ul></ul><ul><ul><li>Low level of reuse of the implementations </li></ul></ul>
    105. 105. Wrap-up <ul><li>Solution: lightweight semantics </li></ul><ul><ul><li>Non-invasive approach </li></ul></ul><ul><ul><li>Common abstraction layer overcoming heterogeneity </li></ul></ul><ul><ul><li>Basis for tasks automation </li></ul></ul><ul><li>Web API Semantic Descriptions </li></ul><ul><li>Web API discovery </li></ul><ul><li>Web API invocation </li></ul><ul><ul><li>Web API grounding model </li></ul></ul><ul><ul><li>Invocation Engine </li></ul></ul>
    106. 106. Hands-on Session <ul><li>Web API Annotation </li></ul><ul><ul><li>Web API annotation with SWEET </li></ul></ul><ul><ul><li>Semantic description publishing in iServe </li></ul></ul><ul><li>Web API Discovery </li></ul><ul><ul><li>Without lightweight semantics </li></ul></ul><ul><ul><li>Service search in iServe </li></ul></ul><ul><li>Web API Invocation </li></ul><ul><ul><li>Invocation with the Invocation Engine </li></ul></ul>
    107. 107. Thank You! http://sweet.kmi.open.ac.uk/ http://iserve.kmi.open.ac.uk/ http://www.soa4all.eu/
    108. 108. References <ul><li>SAWSDL </li></ul><ul><ul><li>http://www.w3.org/2002/ws/sawsdl/ </li></ul></ul><ul><li>WSMO-Lite </li></ul><ul><ul><li>http://cms-wg.sti2.org/TR/d11/v0.2/ </li></ul></ul><ul><li>hRESTS & MicroWSMO </li></ul><ul><ul><li>http:// cms-wg.sti2.org/TR/d12 </li></ul></ul><ul><li>REST & RESTful Web services </li></ul><ul><ul><li>http:// en.wikipedia.org/wiki/REST </li></ul></ul><ul><li>Microformats </li></ul><ul><ul><li>http:// microformats.org/ </li></ul></ul>
    109. 109. References <ul><li>SPARQL </li></ul><ul><ul><li>http://www.w3.org/TR/rdf-sparql-query/ </li></ul></ul><ul><li>WSMO </li></ul><ul><ul><li>http://www.wsmo.org and http:// cms-wg.sti2.org </li></ul></ul><ul><li>OWL-S </li></ul><ul><ul><li>http://www.daml.org/services/owl-s/ </li></ul></ul><ul><li>SWSF & FLOWS </li></ul><ul><ul><li>http:// www.w3.org/Submission/SWSF/ </li></ul></ul><ul><li>WSDL-S </li></ul><ul><ul><li>http://www.w3.org/Submission/WSDL-S/ </li></ul></ul>

    ×