Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Linked services
1. Linked Services
Dr. Carlos Pedrinaci
The Open University
SSAIE 2010, Heraklion
2. Outline
• Web Services or Services on the Web?
• The Semantic Web and the Web of Data
• Linked Services - Integrating Services with
the Web of Data
–Annotating WSDLs
–Annotating Web APIs
• Unified Discovery and Publication on the
Web of Data
3. Preparation for Hands-On
• The material shown in this session will be
the basis for the hands-on session
afterwards
• You’ll need Firefox
• Tabulator extension for Firefox
–http://dig.csail.mit.edu/2007/tab/
5. Web Services
• Large number of standards and
implementations
– WSDL, BPEL, WS-Coordination, WS-
Transaction, WS-AtomicTransaction,
WS- (see Cesare’s presentation)
“Despite their name,Web Services have
nothing to do with the Web”
Frank Leymann
SSAIE 2009
6. Web Services on the Web
• The Web currently contains 30 billion Web
pages
–Nearly 100M active sites
–10 million new pages added each day
• The Web contains only 28,000 WSDL Web
services (Seekda.com)
• Verizon have around 4,000
13. Semantic Web Principles
• Lift data available on the Web to a level where
machines can manipulate it in “meaningful ways”
• Adding machine “understandable” annotations
about Web resources
• All resources are identified by URIs
• Use of Web oriented modeling languages
• RDF & RDFS
• OWL (Lite, DL, Full) & OWL2 (EL, QL, RL)
• Use of conceptual models (ontologies,
vocabularies)
14. RDF
• Resource Description Framework (RDF) is the HTML of
the Semantic Web
– Simple way to describe resources on the Web
– Based on triples <subject, predicate, object>
– Defines graphs
18. RDF Representation
• Several available. Only standard RDF/
XML
@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.
...
19. Ontology and Rule languages
• RDF Schema (RDFS)
– A simple ontology language on RDF
• Web Ontology Language (OWL) is
a more expressive ontology language than RDFS
– Layered language based on Description Logics
• OWL Lite, OWL DL, OWL Full
• OWL2 (EL, QL, RL)
• Rule languages
– Rule Interchange Format (RIF)
– Extend ontology languages with axioms
20. SPARQL
• Query language for RDF
• Can be used to express queries across
diverse data sources
• SPARQL contains capabilities for querying
required and optional graph patterns along
with their conjunctions and disjunctions
• The results of SPARQL queries can be
results sets or RDF graphs
23. Linked Data
• “Like the web of hypertext, the web of data is constructed with
documents on the web. However, unlike the web of
hypertext, where links are relationships anchors in hypertext
documents written in HTML, for data they links between arbitrary
things described by RDF. The URIs identify any kind of object or
concept.”
• Four basic principles:
1.Use URIs as names for things
2.Use HTTP URIs so that people can look up those names.
3.When someone looks up a URI, provide useful information,
using the standards (RDF, SPARQL)
4.Include links to other URIs so that they can discover more
things.
Tim Berners-Lee - http://www.w3.org/DesignIssues/LinkedData
30. Linked Services
• Linked Services are
Linked Data describing services
• Their inputs, outputs, functionality, etc is
described using RDF(S) and using existing
vocabularies
• Consume RDF and produce RDF
• Process layer on top of the Web of Data
31. Lightweight Semantic Web
Services
• Existing approaches like OWL-S, WSMO are
(perceived as) complex in terms of
– Modeling and Computational complexity
• Web APIs preferred over WSDL Web Services and
SWS were up to now built on top of WSDL
• Let's try to reduce the complexity
– Based and built on top of RDF
– Scale up computationally and promote the uptake
– WSMO-Lite ontology
• Let's support Web APIs as well
35. SAWSDL Annotations
• modelReference
–points to a concept in a semantic model
• loweringSchemaMapping
• liftingSchemaMapping
–point to data mapping transformation for data
grounding
38. Types of Service Semantics
• Functional • Behavioral
– What the service does – How the client
talks to the service
• Information model • Nonfunctional
– For handling data – Policies, QoS,
– Incl. lifting/lowering price, location etc.
39. Functional Semantics
• For service discovery, composition
F
• Category
– Functionality categorization
– E.g. eCl@ss
– Or tagging, folksonomies
• Capability
– Precondition, Effect
– Needs using some rule language (WSML, RIF, etc)
40. Category Example
wl:FunctionalClassificationRoot
type
ex:eCommerceService
subclasses
ex:Travel ex:Accommodation
ReservationService ReservationService
41. Capability Example
ex:RomaHotelReservationPrecondition
rdf:type wl:Condition ;
rdf:value """
?request
[ numberOfGuests hasValue ?guests
and city hasValue ?city ]
memberOf ReservationData
and ?guests <= 10
and ?city = 'Roma'
"""^^wsml:AxiomLiteral .
42. Non-functional Semantics
• For ranking and selection N
• Not constrained, any ontologies
• Example:
ex:PriceSpecification
rdfs:subClassOf wl:NonFunctionalParameter .
ex:ReservationFee
rdf:type ex:PriceSpecification ;
rdf:value "15"^^ex:euroAmount .
43. Behavioral Semantics
• For invocation, composition, process mediation B
• Functionalities on operations
– Capabilities, categories
• Client selects operation to invoke next
– Instead of being strictly guided by an explicit process
• Example functional category for operations:
– Web Architecture: interaction safety
44. Information Semantics
• For invocation, composition, I
data mediation
• Not constrained, any ontologies
• Marked as wl:Ontology
45. WSMO-Lite Example
<wsdl:description>
<wsdl:types> <xs:schema> I
<xs:element name="ReservationRequest"
sawsdl:modelReference="&ex;Reservation" I
sawsdl:loweringSchemaMapping="&ex;ResMapping.xsparql" … />
</xs:schema> </wsdl:types>
<wsdl:interface name="HotelReservations"
sawsdl:modelReference=
F
"&ex;AccommodationReservationService">
<wsdl:operation name="searchForRooms"
sawsdl:modelReference="&wsdlx;SafeInteraction">
B
…
</wsdl:operation>
…
</wsdl:interface>
<wsdl:service name="RomaHotels" interface="HotelReservations" F
sawsdl:modelReference="&ex;RomaHotelReservationPrecondition
&ex;ReservationFee" … /> N
</wsdl:description>
47. Reality Check
• Survey based on 222 Web APIs from ProgrammableWeb from 21
categories
• Types of Web APIs
– 45.5% REST, RPC 33.8%, Hybrid 20.7%
• 40% of Web APIs do not state the used HTTP method!
• Authentication
– 80% require authentication (37% use API Key, 14%HTTP Basic,
6% OAuth, etc)
• Input and Output information
– 72% do not state the data type of the input parameters
– 61% use optional parameters, 45% use default values
– 90% have as output XML, 42% JSON
– 84% provide example request and 75% example response
48. What’s the Current State
• Web APIs evolving rapidly and
autonomously (like the Web)
• No Interface Definition Language adopted
–WADL is an option but not widely used
–APIs are described via an HTML Web page
• Allow fast development of mashups
• Little reuse of sofware, high reuse of
services!
49. Describing Web APIs
• Machine-readable descriptions useful
– Tool support for developing clients
– Service discovery
• No WSDL for Web apps
– APIs described mostly in text
– AtomPub has RFC, Service Documents
– Resources behind AJAX stay undescribed
• Some machine-readable descriptions:
– HTML links, forms
– AtomPub service document
– WADL
50. hRESTS
• "There's usually an HTML page"
• Identifying machine-readable parts
–Service, its operations
–Resource address, HTTP method
–Input/output data format
• hRESTS microformat
–Technically, a poshformat
51. Simpler Example Description
Description of the ACME Hotels service:
The operation getHotelDetails
is invoked using the method GET at
http://example.com/h/{id},
with the ID of the particular hotel replacing
the parameter id. It returns the hotel details
in an ex:hotelInformation document.
52. Example HTML
<p>Description of the
ACME Hotels service:</p>
<p>
The operation <code>getHotelDetails</code> is
invoked using the method GET
at <code>http://example.com/h/{id}</code>,
with the ID of the particular hotel replacing
the parameter <code>id</code>.
It returns the hotel details in an
<code>ex:hotelInformation</code> document.
</p>
53. Example hRESTS
<div class="service" id="svc">
<p>Description of the
<span class="label">ACME Hotels</span> service:</p>
<div class="operation" id="op1">
<p>
The operation <code class="label">getHotelDetails</code> is
invoked using the method <span class="method">GET</span>
at <code class="address">http://example.com/h/{id}</code>,
with <span class="input">the ID of the particular hotel replacing
the parameter <code>id</code>.</span>
It returns <span class="output">the hotel details in an
<code>ex:hotelInformation</code> document.</span>
</p></div>
</div>
54. hRESTS
• HTML for RESTful Service Description
• Introduces the service model structure
– service (+ label)
– operations (+ address, method)
– input, output
• Can also be in RDFa
• Basis for extensions:
– MicroWSMO adds semantic annotations
58. The Typical High-Level View
registry
discover publish
services descriptions
invoke
client service
(provider)
59. UDDI
• Universal Description, Discovery and Integration
• A Web service registry API specification
–Business-oriented service publication, discovery
(initially limited search capabilities)
–Itself has Web service interface
–Useful for intranet registries
• A failed public service
–Not particularly useful discovery support
–Discontinued in 2006
66. An Open Repository
• Supports access via
–Web Application - iServe Browser
–Read&Write RESTful API
–Linked Data principles
• SPARQL endpoint
• Content negotiation (RDF, HTML)
• All RDF, interlinked with other schemas and
datasets
• Support for several SWS formalisms
62
67. Service Discovery
• Several Mechanisms
–Simple SPARQL-based
–Inputs/Outputs logic-based using RDFS
reasoning
–Functional Classifications with RDFS reasoning
–Similarity analysis based on iMatcher
68. Discovery RESTful API
/data/disco/func-rdfs?class=C1 &class=C2 &...
uses RDFS functional classification annotations and returns those services
that are related to all the functional categories Ci (which are URIs).
/data/disco/io-rdfs?f={and|or}&i=C1I &i=C2I &o=C1O &...
uses ontology annotations of inputs and outputs and returns services for
which the client has suitable input data (CiI) and/or (depending on the
parameter f for function) which provide the outputs requested by the client
(CiO ).
/data/disco/imatch?name=L
returns all services ranked according to the Levenshtein (other mechanisms
available) string similarity of the service label with the string L.
69. Atom-based Discovery
• Discovery mechanisms return an Atom
feed with the results
• Provides Atom feed combinators
- Union, Intersection, Subtract
http://iserve.kmi.open.ac.uk/data/atom/intersection? f=/
data/disco/func-rdfs?class=
http://iserve.kmi.open.ac.uk/2010/05/s3eval/func.rdfs
%2523ProximitySearch &f=/data/disco/io-rdfs?
o=http://iserve.kmi.open.ac.uk/2010/05/s3eval/data.rdfs
%2523ATMLocation
80. Acknowledgements
• Jacek Kopecký, The Open University
• Reto Krummenacher, University of Innsbruck
• John Domingue, The Open University
• Maria Maleshkova, The Open University
• Dong Liu, The Open University
• Dave Lambert, The Open University
• 2 Slides from Tom Gruber (Siri)
Editor's Notes
WSMO-Lite ontology of service semantics describes services for SWS automation
SAWSDL puts pointers to WSMO-Lite semantics in WSDL
MicroWSMO and hRESTS are lightweight equivalents for SAWSDL and WSDL for RESTful services
WSDL has more detail than our simplified service model, therefore there are more ways of attaching semantics. Information semantics can be anywhere in the schema inside the types section, functional semantics can be either on the interface (general, reusable) or on the service (specific), and nonfunctional parameters can be on a binding (general, reusable) or on the service (specific).
Lifecycle:
Service provider creates the Web service, publishes its (WSDL) description in a registry (UDDI).
A client discovers suitable Web services for its application.
The client invokes the discovered service(s) as appropriate using SOAP.