Semantics-enabled Web API Organization and Recommendation Devis Bianchini, Valeria De Antonellis, Michele Melchiori Department of Information Engineering Università di Brescia - Italy 1
Fast Web app development: “Deployment of situational, short-living Web applications with focus on Web Interface integration of components independently originated from third parties and that are made available through Web APIs”
2
Fast Web application development Which open issues? Allowing a Web designer to explore and understand the space of available APIs: • dynamicity of this space and large number of available APIs (>4k APIs in ProgrammableWeb.com) • heterogeneity in Web API description • limited time usually allocated for the development of this kind of Web applications Our contributions: 1. A browsable registry of semantics-enriched Web APIs 2. Semi-automated selection patterns for Web APIs aggregation
3
Our vision
Focus of this talk
We rely on existing technologies and tools
See [1]
[1] D. Bianchini, V. De Antonellis, M. Melchiori. A semantics-enabled Web API registry, Int. Workshop on Web Semantics, 2010.
4
Talk Outline •
Web API organization in a semantics-enabled registry
•
Web API Selection patterns
•
The prototype tool implementation
•
Conclusions and future work
5
Semantic annotation of Web APIs (I) Web APIs are usually described using plain, unstructured HTML
semantic annotation of Web APIs is still a difficult task
Few efforts have been made to solve these limitations
Web Application Description Language (WADL), to propose a counterpart of the WSDL standard for WSDL/SOAP-based Web Services (too complex, not widespread)
Combined use of hRESTS (to structure Web API description) and MicroWSMO (for Web API semantic annotation)
6
Semantic annotation of Web APIs (II) Web APIs are usually described using plain, unstructured HTML - semantic annotation of Web APIs is still a difficult task
Semantic annotation of APIs in our framework is therefore performed according to the steps suggested in the SWEET tool [2]: (a)
identification of elements (that is, operations, inputs, outputs) in the unstructured HTML document which represents the API, to produce an hRESTS description
(b)
search for ontologies suitable for elements annotation and of taxonomies of categories for API classification
(c)
annotation and classification of the API according to the MicroWSMO notation
[2] M. Maleshkova, C. Pedrinaci, and J. Domingue. Semantic annotation of Web APIs with SWEET. In Proc. of 6th Workshop on Scripting and Development for the Semantic Web, 2010.
7
SWEET-style annotation (I)
Description of the ACME Hotels service:
The operation getHotelDetails
is invoked using the method GET at http://example.com/h/fidg
, with the ID of the particular hotel replacing the parameter id
. It returns the hotel details in an ex:hotelInformation
document.
Example hRESTS description
8
SWEET-style annotation (II)
Description of the ACME Hotels service:
The operation getHotelDetails
is invoked using the method GET at http://example.com/h/fidg
, with the ID of the particular hotel replacing the parameter id
. It returns the hotel details in an ex:hotelInformation
document.
Insertion of MicroWSMO annotations
9
Wi = urii,CAT(Wi),OP(Wi),EV(Wi) opl OP(Wi) opl = methodl,addrl,IN(opl),OUT(opl) concept
set of concepts
evm EV(Wi) evm = typem,OUTev(evm) set of concepts
10
Functional similarity between Web APIs
•
A Web API descriptor Wi is functionally similar to another Web API descriptor Wj if: 1. 2.
The categories of Wi and Wj are compatible SimIO(Wi, Wj) ≥ [0..1] (functional similarity degree)
Union of the input sets of all the Wj operations
Union of the output sets of all the Wi operations
Concept affinity
11
Functional coupling between Web APIs
•
A Web API descriptor Wi can be functionally coupled with another Web API descriptor Wj if: 1.
CouplIO(Wi, Wj) ≥
[0..1] (functional coupling degree)
Union set of the outputs of the event evi
12
Web application development scenario (I) Building a Web app from the scratch – The Web designer proceeds step by step by selecting a Web API and mapping events with operations 1.
The designer specifies a requested Web API in terms of categories, operations and/or inputs/outputs
2.
The system suggests APIs that can be coupled with Web APIs already included in the Web app under construction
13
Search selection pattern
I need a Web API to find movie theatres
14
Search selection pattern
I need a Web API to find movie theatres
15
Completion selection pattern
What functionalities could be added to my Web app?
16
Completion selection pattern
What functionalities could be added to my Web app?
17
Web application development scenario (II) Modifying an existing application – The Web designer finds an existing Web app on the Web of Data and desires to replace one of the component Web APIs, since 1.
they became unavailable
2.
application requirements have been changed
3.
the designer needs to improve the QoS of the Web application
The system suggests APIs that can substitute Web APIs already included in the Web app under construction 18
Substitution selection pattern
I need a different Web API to convert coordinates
19
Substitution selection pattern
I need a different Web API to convert coordinates
20
Web API Selection Patterns We define a Selection Pattern as a 4-uple = W ,m , , •
W is the Web API descriptor to be searched for (search pattern), coupled (completion pattern), substituted (substitution pattern)
•
m is the metric used to evaluate the degree of matching (search pattern), of coupling (completion pattern) or similarity (substitution pattern)
• •
is the threshold to filter out not relevant Web APIs is a ranking function to present the suggested Web APIs
Wi Wj
m (W ,Wi) ≥ m (W ,Wj) 21
Web API Selection Patterns Goal
= WGoal, mGoal,
Goal = search
Goal = completion
Goal,