Handson Automating the Use of Web APIs through Lightweight Semantics

518 views

Published on

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

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

  • Be the first to like this

No Downloads
Views
Total views
518
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
8
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Handson Automating the Use of Web APIs through Lightweight Semantics

  1. 1. Automating the Use of Web APIs -Hands-on Session-<br />The Open University<br />ICWE 2011, Paphos, Cyprus<br />
  2. 2. Presenters<br />Maria Maleshkovam.maleshkova@open.ac.uk<br />Dong Liu d.liu@open.ac.uk<br />Carlos Pedrinacic.pedrinaci@open.ac.uk<br />
  3. 3. Outline<br /> Web API Annotation<br />Web API annotation with SWEET<br />Semantic description publishing in iServe<br />Web API Discovery<br />Without lightweight semantics<br />Service search in iServe<br />Web API Invocation<br />Invocation with the Invocation Engine<br />
  4. 4. Preparation for Hands-On <br />The material shown in this session will be the basis for the hands-on session afterwards<br />You’ll need Firefox<br />Tabulator extension for Firefox<br />http://dig.csail.mit.edu/2007/tab/<br />
  5. 5. Web API Annotation Hands-On <br />The script for the Web API annotation hands-on is available at:<br />http://iserve.kmi.open.ac.uk/wiki/index.php/Hands-on_Session<br />
  6. 6. Web API Annotation with SWEET<br /> Open SWEET<br />http://sweetdemo.kmi.open.ac.uk/war/MicroWSMOeditor.html<br />Open GeoNamesWebService documentation<br />http://www.geonames.org/export/web-services.html<br />Annotate the CountryCodeoperation <br />
  7. 7. Annotation Steps<br /> Create Service property<br />Rename it to ‘GeoNames’<br />Create Operation property<br />Rename it to ‘CountryCode’<br />Create Input<br />Create Output<br />Create Address <br />Rename address property (not the label itself) to<br />http://api.geonames.org/countryCode<br />Create HTTP Method<br />Rename method property (not the label itself) to GET<br />
  8. 8. Annotation Steps<br />Create Parameter ‘lat’<br />Select the ‘lat’ string the double-click on ‘Parameter’<br />Rename the parameter to ‘lat’<br />Create Parameter ‘long’<br />Create Parameter ‘username’<br />Create Parameter ‘isoCode’<br />
  9. 9. Model References<br /> Input<br />lat<br />http://www.w3.org/2003/01/geo/wgs84_pos#lat<br />long<br />http://www.w3.org/2003/01/geo/wgs84_pos#long<br />username<br />http://purl.oclc.org/NET/WebApiAuthentication#Username<br />Output<br />isoCode<br />http://www.geonames.org/ontology#countryCode<br />
  10. 10. Liftings and Lowerings<br /> Input lowering<br />http://people.kmi.open.ac.uk/ning/Schema/GeoNames/CountryCodeLowering.txt<br />Output lifting<br />http://people.kmi.open.ac.uk/ning/Schema/GeoNames/CountryCodeLifting.txt<br />
  11. 11. Publishing the Description<br />Look at the annotated HTML by saving it to your local machine<br />Look at the generated RDF by exporting it to you local machine<br />Publish the description in the semantic Web service repository iServe<br />http://iserve-dev.kmi.open.ac.uk/iserve<br />maria<br />maria<br />Note the service ID!!!<br />
  12. 12. Web API Discovery Hands-On <br />The script for the Web API annotation hands-on is available at:<br />http://iserve.kmi.open.ac.uk/wiki/index.php/IServe_Higher_Level_Discovery_API<br />
  13. 13. Invocation Example<br />Test Invoke <br />http://iserve-dev.kmi.open.ac.uk/RestServiceInvoke/ServiceInvoke/4619ca73-bb6e-4b99-8114-ad2e2cae3b60/CountryCode?rdfURL=http://iserve.kmi.open.ac.uk/exampleInput/DE.rdf<br />Monitoring Example<br />http://iserve-dev.kmi.open.ac.uk:8080/RestInvoke/service/e8f9548e-bbed-43fe-9d8a-71b7fdefb9da/operation/SearchListingsOperation/data <br />
  14. 14. Invocation<br />Look at you service description <br />http://iserve-dev.kmi.open.ac.uk/iserve/page/services/YOURSERVICEID<br />http://iserve-dev.kmi.open.ac.uk/iserve/page/services/db4b646a-4665-4337-9626-4669cc8bce56<br />Invocation URI<br />http://iserve-dev.kmi.open.ac.uk/RestServiceInvoke/ServiceInvoke/{YOURSERVICEID} /{OperationName}?rdfURL={URLtoInputRDF}<br />http://iserve-dev.kmi.open.ac.uk/RestServiceInvoke/ServiceInvoke/71879558-f1aa-40a1-8a11-5fd3c48a6cde/CountryCode?rdfURL=http://people.kmi.open.ac.uk/ning/Schema/GeoNames/GeoName_input_CY.rdf<br />
  15. 15. Invocation<br />Sample input RDF<br />http://iserve.kmi.open.ac.uk/exampleInput/FR.rdf<br />http://iserve.kmi.open.ac.uk/exampleInput/CY.rdf<br />http://iserve.kmi.open.ac.uk/exampleInput/BG.rdf<br />http://iserve.kmi.open.ac.uk/exampleInput/DE.rdf<br />http://iserve.kmi.open.ac.uk/exampleInput/GBR.rdf<br />Compare results with<br />http://api.geonames.org/countryCode?lat=XXXX&lng=YYYYY&username=mariam<br />

×