вход по аккаунту


978-3-319-68136-8 17

код для вставкиСкачать
Towards Rules-Based Mapping Framework
for RESTful Web Services
Khanh Duc Hoang Le(B)
The School of Computer Science and Engineering,
University of New South Wales, Sydney, NSW 2052, Australia
Abstract. Integrating web services is usually time-consuming and
requires a lot of programming efforts and experiences due to documentation burden and coding style convention overhead provided by external
parties. Fortunately, RESTful web services simplify the integration task
compared to the traditional web service WSDL as coding convention is
significantly reduced. However, the documentation burden is still evident and developers usually rely on running examples to gain better
knowledge and use web service documentation efficiently. The subject
of my PhD thesis is to propose a novel rules-based mapping method
for mapping a desired web service to potential candidates from a predefined web service repository. In this research, the assumption is that web
services are made of RESTful APIs specified in Javascript Object Notation (JSON) format. My significant thesis contributions are: (1) a hybrid
model for web service similarity, (2) a rules-based mapping approach for
identifying and classifying the most related and similar services against
a given desired web service, and lastly (3) a concrete and detailed evaluation to show the effectiveness of the proposed approach and framework.
Keywords: Web services · RESTful APIs
mapping · Web service programming
· Web service matching and
Services on the cloud are ubiquitous and are grown exponentially. Nowadays, the
demand for integration with external platforms from existing application software is enormous, especially more and more software platforms become publicly
available. On one side, software vendors wish to integrate their system with other
systems. On the other side, their software platform needs to open its features to
the public to increase its popularity and usage locally and globally through its
dedicated APIs and web services facility. With such constant increasing of web
services on the cloud in size and quantity, it becomes a challenge to developers
and researchers on the field to manage and control services over time.
Supervised by Prof. Boualem Benatallah and Prof. Fethi Rabhi.
c Springer International Publishing AG 2017
K. Drira et al. (Eds.): ICSOC 2016 Workshops, LNCS 10380, pp. 158–164, 2017.
Towards Rules-Based Mapping Framework for RESTful Web Services
In terms of specifying a web service, there are many common specifications
used for this purpose such as Web Service Description Language (WSDL) [1] or
Web Application Description Language (WADL) [1,2]. WSDL is used to describe
a web service in a traditional way while WADL is used mainly for RESTful web
services. In this paper, we only consider RESTful web services that are specified
in JSON specification [3] which is inspired from the work of Swagger [4].
In the rest of this paper, I shall briefly discuss the related works which cover
the state of the art in web service matching and mapping in Sect. 2. Section 3
discusses the proposed methodology in short. Section 4 provides a preliminary
evaluation of our approach. Finally, a conclusion and sketches of future work are
discussed in Sect. 5.
Related Works
Service mapping is a well-defined research area which is closely related to service
discovery, interface matching and schema matching techniques. Service mapping
is considered as a foundation for other fields such as service integration and service composition. In web service discovery, the search for a desired web service
is occurred on the web service repository (usually UDDI Universal Directory
Discovery and Integration). Some common search engine systems provide search
capability based on keywords that result in some shortcomings. For example,
when users search for web services with the keyword “zipcode”, all services which
are linked to “zip” or “postal code” but not “zipcode” will not be returned [5].
Fortunately, recent research in this research area has incorporated keyword
search with semantics to produce better results. Usually the semantics used is
based on semantic terms (i.e. synonym) of words in the online dictionary WordNet [6]. This approach significantly improves search results, however, it leads to
another shortcoming. For instance, when a user searches for search methods with
“bookmark”, service methods with “tag” but not “bookmark” are not returned
as “bookmark” and “tag” are not synonyms according to English dictionary
The problem of service matching is closely related to the schema matching in
database field [7–9]. Schema matching refers to the process of matching two elements that are somehow semantically related and substitute each other. Schema
matching is also the process of developing semantic matches between two or
more schemas. The purpose of schema matching is generally either to merge two
or more databases, or to enable queries on multiple, heterogeneous databases to
be formulated on a single schema. Schema and Ontology matching (COMA) [10]
provides a generic matching and mapping tool for schema and ontology matching. It focuses on splitting a big matching task into smaller tasks and combines
matching results together. Previous matching results can be used for subsequent
matching. COMA firstly attempts to provide mapping outcomes then users are
required to provide feedback upon the correctness of mapping results. COMA++
[11,12] extends from its previous prototype COMA by providing more features
to facilitate users with the reuse of previous mapping and user interaction. However, due to focusing on matching for inferring explicit mapping, there are some
K.D.H. Le
aspects of service entities are not considered such as parameter types or constraints which are not suitable for mapping in COMA. Hence, COMA mainly
focuses on matching of more coarse-grain objects.
By considering a web service as a composition of service, operation and parameter entities, my approach differs from the existing approaches in the literature
in the way that it focuses on the semantic relationships of parameters and operations with the introduction of different relationship operators in the rules-based
The Proposed Methodology
In this section, I mainly discuss the approach by introducing a hybrid model
which is used to measure similarities between different service artifacts. Then
different rules are discussed for triggering service mapping.
Hybrid Service Model
In order to leverage service matching, I have developed an object-oriented model
for a web service. In this model, a web service object is a composition of service
(S), operation (O) and parameter (P) objects. An operation object is in turn a
composition of operation and parameter objects. Eventually, a parameter object
is composed of different parameter attributes like name, description, datatype
(i.e. String, Integer) and type (i.e. input or output). Denote Weight(name),
Weight(endpoint) and Weight(desc) as the weighted values of name, endpoint
and desc (description) respectively, then Weight(name) > Weight(endpoint)
> Weight(desc). Similarly, denote Weight(service), Weight(operation) and
Weight(parameter) are weighted values for service, operation and parameter
accordingly. Following a top-down approach, the weight of each element level
is increased from service level to parameter level. That means that we have
Weight(service) < Weight(operation) < Weight(parameter). The generic weighting functions for comparing service elements are defined below:
δ(e) ∗ Sim(s1 .e, s2 .e) where 1 =
Simser (s1 , s2 ) =
Simop (op1 , op2 ) =
δ(e) ∗ Sim(op1 .e, op2 .e)
Simpar (par1 , par2 ) =
δ(e) ∗ Sim(par1 .e, par2 .e)
δ(e) (3)
For example, by considering the above rules for selecting suitable variables
in weight functions, we use three empirical set of values ({0.3,0.1,0.2,0.4},
{0.5,0.2,0.1,0.2},{0.5,0.3,0.2}) for variables in the generic formula.
Towards Rules-Based Mapping Framework for RESTful Web Services
Semantic Relationships and Rules
This subsection introduces a number of semantic relationships/operators that
can be used for matching and mapping.
CONCAT Operator. When considering two strings s and t, we form a new
string by concatenate string s and string t together with a delimiter (<DIM>).
For example, suppose we have two strings denoted as s: abc, t: def, then CONCAT(s,t) := abc<DIM>def. For simplicity, we can choose <DIM> as a blank
or a single space.
AGGRE Operator. The AGGRE of two operations Op1 and Op2 are happened by aggregation of all corresponding attributes/artifacts of Op1 and Op2.
The result of an AGGRE of two operations is a newly formed operation,
Op12, in which its input and output parameters are defined as a result of
aggregation of input and output parameters from two operations respectively,
Op12 := AGGRE(Op1, Op2).
COMPO Operator. COMPO operator is used to generalise two matched operations into more generic operation. This assumes that two operations are considered to be matched as they have high matching score according to similarity
metrics. The result of COMPO relationship is another operation. Like other
relationships, COMPO processing happens in each corresponding attribute of
two given operations. Firstly, the COMPO process starts with some string-value
attributes like verb, name, description using one of different strategies like generic
terms, hypernyms, synonyms, categories, dictionary lookup. For example, search
:= COMPO(lookup, find). Secondly, the COMPO process continues with Input
and Output parameter sets in which each input(output) set from each operation
are combined. Any two input(output) parameters, each from each operation, are
matched, COMPO relationship can be established to form a new input(output)
parameter. The composite operation has all attributes to be defined as the following formula:
COM P O(a, b) =
COM P O(a.xi , b.xj )
xi ⊂a,xj ⊂b
PIPELINE Operator. A series of mapping operations can form a pipeline
if and only if the output of an Operation is mapped with the input of another
Operation. We call a mapping process as a mapper; a Source operation is the
operation in which its inputs are not connected to any output of other operations.
An Output operation is the operation in which its inputs are connected to other
operations’ outputs and its outputs are not connected to any other operations’
K.D.H. Le
Mapping Rules
There are two main types of mapping rules namely one-one mapping and onemany mapping. One-one mapping rule focuses one single mapping between operations. The rule decides a source operation is mapped to a target operation if and
only if some conditions are held. Once the mapping is established, the matched
operations pair can be expressed by one of the above semantic operators in
Sect. 3.2. The one-many mapping focuses on the mapping of a source operation
with many operations on the target set as a result of combining possible semantic operators. The one-many mapping rules defines the mapping conditions and
works on the instruction of specifying appropriate semantic operators in each
mapping stage. For example, considering a source operation doABC(4, 2) and
the set of target operations such as SET{doA(3, 1), doB(1, 1) and doC(1, 1)}
where X(m, n) is a notation of the X operation which has m input parameters
and n output parameters. When some conditions are matched, we can express
the following mapping:
doABC(4, 2) := AGGRE(P IP ELIN E(doA(3, 1), doB(1, 1)), doC(1, 1))
Preliminary Experiment and Results
For our mapping rules validation, at the first stage, I have collected more
than 100 APIs in different categories such as Bookmarking, Maps, Payment,
Social Networks and Language Translation services. For simplicity, my preassumption for all the APIs with the operation syntax is in the form of
[VERB][OBJECT1][OBJECT2][...][OBJECTn] such as translateText, buyShare
or buyNavelOrange. I have prototyped an implementation of our approach known
as the Rule-based mapping system in Java with some open-source components.
We have used the implementation of similarity metrics from SecondString library
[13,14] for a collection atomic similarity metrics along with JSON library and
Build Tools. Two similarity metrics have been used in the prototype are Jaro and
Jaccard [13]. Jaccard is the metric that is suitable for comparing long texts (i.e.
description) while Jaro is selected for essential metric for string matching such
as name, type or path. The combination of these two metrics make an effectively
harmonic outcome compared to using any single similarity metric.
I have also conducted experiments on a number of single metrics; the results
confirm that using a hybrid of Jaro and Jaccard bring a dominant performance
in similarity matching as shown in Fig. 1 when searching Translate Text operation with unbiased syntax from the list of four operations Translate (top line),
TranslateArray, Detect and GetLanguagesForTranslate.
The system has copped well with the predefined ubiquitous set of APIs for a
given web service API. In our hybrid model, we have setup an offset Threshold
variable (α) in order to decide if two entities are matched. By changing different
parameters, we obtained different datasets of precision and recall.
Towards Rules-Based Mapping Framework for RESTful Web Services
Fig. 1. Comparing similarity metrics in hybrid weighting scheme model
Discussion and Conclusion
Our initial evaluation has shown a great potential of using Rules-based system to
address the problem of ubiquitous web service matching and mapping. We continue to collect various APIs from different domains to leverage our algorithms.
At this stage, we have collected more than 100 APIs in different categories such
as Book-marking, Maps, Payment, Social Networks and Language Translation
services. During the wrapping of web service APIs in the JSON format, we
try to maintain the originality of these web services as much as possible. Our
JSON convention is much closed to Swagger specification, thus it is possible
for potential API providers to register new services into our service repository
automatically. Our next goal involves improving our current Rules-based system
with the ability to reuse previous mapping outcomes. Although the system is
designed to provide automatic mappings to the users but due to complexity and
ubiquity of APIs, it is important to enable the system to interact with users for
their feedbacks.
1. Walsh, A.E. (ed.): UDDI, SOAP, and WSDL: The Web Services Specification
Reference Book. Prentice Hall Professional Technical Reference, Englewood Cliffs
2. Richardson, L., Ruby, S. (eds.): RESTful Web Services. O’Reilly Media, Sebastopol
3. JSON: Javascript object notation. Accessed 09 Jan 2016
4. Swagger: A simple, open standard for describing REST APIs with JSON (2016). Accessed 10 Jan 2016
5. Dong, X., Halevy, A., Madhavan, J., Nemes, E., Zhang, J.: Similarity search for
web services. In: Proceedings of the Thirtieth International Conference on Very
Large Data Bases (VLDB 2004), vol. 30. pp. 372–383. VLDB Endowment (2004).
K.D.H. Le
6. Fellbaum, C. (ed.): WordNet: An Electronic Lexical Database. Language, Speech,
and Communication. MIT Press, Cambridge (1998)
7. Rahm, E., Bernstein, P.A.: A survey of approaches to automatic schema matching.
VLDB J. 10(4), 334–350 (2011).
8. Islam, A., Inkpen, D., Kiringa, I.: Database schema matching using corpus-based
semantic similarity and word segmentation
9. Doan, A., Halevy, A.Y.: Semantic-integration research in the database community.
AI Mag. 26(1), 83–94 (2005).
10. Do, H.H., Rahm, E.: COMA: a system for flexible combination of schema matching
approaches. In: Proceedings of the 28th International Conference on Very Large
Data Bases (VLDB 2002), pp. 610–621. VLDB Endowment (2002). http://dl.acm.
11. Aumueller, D., Do, H.H., Massmann, S., Rahm, E.: Schema and ontology matching
with COMA++. In: Proceedings of the 2005 ACM SIGMOD International Conference on Management of Data (SIGMOD 2005), New York, pp. 906–908 (2005).
12. Engmann, D., Massmann, S.: Instance matching with COMA++. In: BTW (2007)
13. Cohen, W.W., Ravikumar, P., Fienberg, S.E.: Second string: an opensource Java
toolkit of approximate string-matching techniques (2003). http://secondstring.
14. Cohen, W.W., Ravikumar, P., Fienberg, S.E.: A comparison of string distance
metrics for name-matching tasks, pp. 73–78 (2003)
Без категории
Размер файла
248 Кб
978, 68136, 319
Пожаловаться на содержимое документа