没有合适的资源?快使用搜索试试~ 我知道了~
通过知识图上的随机游走的面向Mashup的API推荐
0 下载量 22 浏览量
2021-03-14
07:50:08
上传
评论
收藏 1.87MB PDF 举报
温馨提示
试读
12页
随着Web API经济的日益繁荣,面向混搭的API推荐已成为一项重要要求。 已经使用了基于不同技术原理的各种方法来解决这个问题。 近年来,Web API生态系统已经积累了丰富的知识,可用于增强推荐模型,但是,目前仍然对此表示关注。 为了解决这个问题,我们为面向mashup的API推荐任务提供了一个基于图的算法框架。 特别是,我们设计了一个简洁的知识图模式,以对特定于混搭的上下文进行编码,并使用图形实体对混搭需求进行建模。 然后,我们利用重启进行随机游走,以根据知识图评估mashup需求与Web API之间的潜在相关性。 此外,我们提出了针对查询的加权策略,以增强知识图的构建。 实验结果表明,我们提出的方法远远优于某些最新方法,在减少计算开销方面也达到了鲁棒的效果,并抑制了API推荐中的负面Matthew效应。
资源推荐
资源详情
资源评论
Received November 22, 2018, accepted December 19, 2018, date of publication December 28, 2018,
date of current version January 23, 2019.
Digital Object Identifier 10.1109/ACCESS.2018.2890156
Mashup-Oriented API Recommendation via
Random Walk on Knowledge Graph
XIN WANG
1
, HAO WU
1
, AND CHING-HSIEN HSU
2
, (Senior Member, IEEE)
1
School of Information Science and Engineering, Yunnan University, Kunming 650500, China
2
Department of Computer Science and Information Engineering, National Chung Cheng University, Chiayi 62102, Taiwan
This work was supported in part by the National Natural Science Foundation of China under Grant 61562090, Grant 61472345,
and Grant 61562092, and in part by the China Postdoctoral Science Foundation under Grant 2016M592721.
ABSTRACT With the growing prosperity of the Web API economy, mashup-oriented API recommendation
has become an important requirement. Various methods based on different principles of technology have
been used to deal with this issue. In recent years, the Web API ecosystem has accumulated a wealth of
knowledge that can be used to enhance the recommendation models, and however, current concerns in this
regard still remain. To cope with this issue, we present a graph-based algorithmic framework for the task
of mashup-oriented API recommendation. Especially, we design a concise schema of the knowledge graph
to encode the mashup-specific contexts and model the mashup requirement with graphic entities. We then
exploit random walks with restart to assess the potential relevance between the mashup requirement and
the Web APIs according to the knowledge graph. In addition, we propose the query-specific weighting
strategies to enhance the knowledge graph construction. The experimental results demonstrate that our
proposed method is much superior to some state-of-the-art methods, also achieves robust effects on reducing
computational overhead, and suppresses the negative Matthew effect in APIs’ recommendation.
INDEX TERMS Mashup development, API recommendation, random walks with restart, knowledge graph.
I. INTRODUCTION
Web APIs are application programming interfaces through
which web applications can realize storage services, mes-
sage services, computing services and other capabilities. The
number of accessible Web APIs has grown consistently over
the past years. ProgrammableWeb, the largest online API
registry, has tracked more than 20,000 Web APIs recently.
As Web APIs become the backbone of the Web, cloud,
mobile and machine learning applications, API ecosystem
has gradually formed and an API economy is emerging [1].
However, in the face of rapid development of the information
society and the emergence of a large number of additional
requirements, the functions of existing APIs have become
increasingly unable to respond to complex business needs.
Regarding this issue, mashup has emerged as a technology
for today’s challenges by integrating multiple services to
match requirements of users even with users who have little
programming skills [2].
Unfortunately, with the rapid growth of the number of
Web APIs, quickly selecting the right Web APIs from a large
number of candidates covering a wide range of functionali-
ties has become increasingly challenging for inexperienced
developers. Therefore, it is necessary to develop recommen-
dation techniques and help developers to better identify rele-
vant Web APIs satisfying the need of mashup developments
in a shorter amount of time [3], [4]. In recent years, numer-
ous efforts have been made to address this issue. Existing
works can be coarsely classified into two categories, one
focuses on the principle of collaborative filtering [5]–[8],
and the other focuses on estimating the relevance between
the mashup requirements and the candidate APIs [9]–[13].
Various technologies, e.g., matrix factorization [7], [8], topic
modeling [9], [10], link analysis [11] and various features,
e.g., texts, tags, topics and popularity are exploited to enhance
the accuracy of recommendations [13]–[17].
Nevertheless, most of the existing works which use sin-
gle source information are vulnerable to data sparsity. For
example, methods based on text similarity or topic mining
will get worse effect once the text description is poor or
insufficient [7]. In contrast, knowledge graph usually con-
tains much more fruitful facts and connections of APIs,
mashups and other items. A knowledge graph is a type of
directed heterogeneous graph in which nodes correspond to
entities and edges correspond to relations. These semantics
VOLUME 7, 2019
2169-3536 2018 IEEE. Translations and content mining are permitted for academic research only.
Personal use is also permitted, but republication/redistribution requires IEEE permission.
See http://www.ieee.org/publications_standards/publications/rights/index.html for more information.
7651
X. Wang et al.: Mashup-Oriented API Recommendation via Random Walk on Knowledge Graph
can help us to understand mashup patterns accurately. The
Web API ecosystem has accumulated a wealth of knowledge
that can be used to enhance recommendation models [18],
however, the current concerns in this regard are still limited.
Particularly, there is the absence of a unified and easy-to-use
way. As to take advantage of these knowledge, they usually
combine different technologies, resulting in the relatively
complex algorithms which are hard to understand and prac-
tice. Moreover, how to exploit key knowledge instead of all
the knowledge to benefit recommendation of APIs and how
to effectively express users’ requirements need to be further
explored.
Inspired by these, we propose a simple yet effective rec-
ommendation framework based on random walks on the
knowledge graph for mashup developments. In this approach,
we use knowledge graph to capture the most relevant infor-
mation which is related to Web APIs and mashups. Then,
we use Random Walks with Restart(RWR) to estimate the
relatedness between the mashup requirements and the can-
didate APIs. Also, we propose three query-specific weight-
ing strategies to improve the relatedness estimation. In this
way, we can effectively address the problem of data sparsity,
providing an elegant way to utilize the abundant knowledge
in the API ecosystem and achieving better recommendation
performance.
The main contributions of this paper can be summarized as
follows:
• We have proposed an effective schema of knowl-
edge graph to capture the most useful knowledge for
mashup-oriented API recommendation and proposed
three query weighting strategies to enhance the recom-
mendation effectiveness of RWR.
• Through comprehensive experimental analyses, our
proposed method can provide highly accurate recom-
mendation results in comparison with the state-of-
the-art methods. Particularly, RWR using our graph
schema promotes that case of using a full graph
schema by at least 5.9-9.5% on Recall@{5,10} and at
least 4.5-5.7% on NDCG@{5,10}. With query-specific
weighting strategies, we further improve the recom-
mendation effects of RWR by at least 11.9-17.7%
on Recall@{5,10} and at least 12.9-13.3% on
NDCG@{5,10}.
The rest of the paper is structured as follows. Section II
provides some backgrounds to API-specific knowledge graph
and the random walk method. Section III presents our
enhanced model by introducing refined knowledge graph and
query weighting strategies. We evaluate our methods via a set
of experiments in Section IV. We review some works which
are most relevant to ours in Section V. Finally, we conclude
our works and point to future works.
II. PRELIMINARY MODEL
A. KNOWLEDGE GRAPH FOR APIS RECOMMENDATION
In the past decades, the use of Web API has increased
significantly. However, the lack of semantic descriptions of
FIGURE 1. A full schema of knowledge graph for mashup-oriented API
recommendation.
Web APIs limits their discovery, sharing, integration and
consumption [18]. To cope with this problem, Dojchinovski
and Vitvar [18] have presented the Linked Web APIs dataset
with semantic descriptions of Web APIs to capture the prove-
nance, temporal, technical, functional, and non-functional
aspects. Specially, the Linked Web APIs ontology is designed
to capture the most relevant information which is related to
Web APIs and mashups. This provides us with a knowledge
base (graph) to guide APIs recommendation.
A full schema of knowledge graph is presented as Fig.1,
which includes key entities: Tag, Category, Mashup, WebAPI,
Agent, Protocol, DataFormat as well as relationships among
them and attributes associated with, such as isPrimary-
Topicof, created, creator, rating, title, name, type, label,
publisher, homepage, wasAttributedTo, supportedProtocol,
supportedDataFormat, sslSupport, etc. There are totally
3286 tag entities and 66 category entities. Here, we specially
distinguish entities of Tag from entities of Category consider-
ing that tags are usually user-generated in the free way while
categories are assigned adopting to a standard vocabulary.
B. RANDOM WALKS WITH RESTART
PageRank is an ordering node technique based on Markovian
walks in a directed graph G = (V , E), where V (|V | = n) is
the node set and E is the edge set. The surfer jumps from one
node to another with a consistent probability of α (damping
factor) or gets bored, and then jumps to a random node with
a probability of 1 − α. Assuming P is the ranking vector
for all nodes in G, the PageRank value of P
i
is the surfer’s
probability at a given node of i. The method of fast computing
PageRank is to use the power iteration method,
P
(t)
= αM
T
P
(t−1)
+ (1 − α)e (1)
where M is a row-stochastic matrix (n × n). Beginning with
an arbitrary vector P
(0)
, the solving of Eq.1 is to apply the
operator
d
M
T
= αM
T
+(1 −α)e in succession, until |P
(t+1)
−
P
(t)
| < . When setting the personalized vector e to prefer
a subset of V [19], the PageRank model is usually called as
Random Walks with Restart(RWR) [20], [31].
7652 VOLUME 7, 2019
X. Wang et al.: Mashup-Oriented API Recommendation via Random Walk on Knowledge Graph
RWR has been used as a measure of relatedness in var-
ious recommendation scenes and been proved to achieve
superior performance with the ability to alleviate data
sparsity [20], [21]. It can be adapted to recommend Web
APIs for the mashup development as follows: a) Given a
knowledge graph, we treat the edges with different types as
a bidirectional link with a unified weight of 1; b) set e to
prefer the node representing a mashup; c) find the vector
P
(t)
(where t is the state after convergence) using Eq.1;
d) sort APIs by their rankings in P
(t)
and generate the top-N
recommendations [22]. Specially, given the source node i,
the target node j and the number of links from i to j can be
expressed as L(i, j). L(i, k) is the same, in which, k represents
the node connected to node i. The matrix M is initialized as
follows:
M
ij
=
L(i, j)
P
k
L(i, k)
if L(i, j) > 0,
0 otherwise
(2)
RWR is simple and effective, however, it has a cou-
ple of drawbacks which lead to unsatisfying results in
mashup-oriented API recommendation. One problem con-
cerns the computational efficiency. As the computational
complexity of RWR is O(n
2
t), the computational cost will
be high when the number of entities in the knowledge graph
is larger. Also, not all the information in the knowledge graph
contributes to the accuracy of recommendations. Thus we
are required to refine the knowledge graph to reduce the
computational cost. Another problem is about the negative
Matthew effect which means that the APIs of high popularity
will always achieve higher ranking values [23]. This negative
effect will reduce the diversity of recommendation lists and
lower the accuracy of recommendations [22]. For instance,
Google Maps API has been used more than 2000 times in
mashup developments and frequently ranks higher in the rec-
ommendation lists, even if it does not match any requirement.
III. ENHANCED MODEL
A. REFINING KNOWLEDGE GRAPH
To improve RWR-based recommendation model, one feasi-
ble approach is to initialize a walking boundary to reduce
unnecessary random surfing. We customize the query bound-
aries based on the mashup requirements: (I) only nodes of
typed Tag or Category with rich semantic information and
a strong transitivity ability are used to represent the mashup
requirements. Other nodes are either unique or lack sufficient
feature information; (II) only the nodes and edges within the
boundary will be used to create the knowledge graph, and
the other nodes and edges are omitted. Figure 2 specifies the
walking boundary. Formally, we use the following notations
to model requirements of mashups:
Defintion 1: A mashup requirementis specified by Q =
Q
cat
∪ Q
tag
, where Q
cat
is the set of entities typed Category,
and Q
tag
is the set of entities typed Tag.
Defintion 2: A query node q represents a mashup to be
established (i.e., test node in Figure 2).
FIGURE 2. A refined schema of knowledge graph where the boundary of
the dotted box is used to create a data graph. The node named test
represents the node of target mashup.
The APIs recommendation corresponds to repeat a spread
process from the query node q to the nodes in Q, and in
turn to other nodes, until a stable global state is achieved.
By employing this strategy, the number of visited nodes by
RWR is greatly reduced, and thus the computational cost will
be less. By the way, the negative Matthew effect will also be
suppressed to some extent. According to our experiments,
the number of visited nodes can be reduced by 98%, while
the recommendation accuracy can be increased by around
10%. To distinguish from the original RF model using the
full knowledge graph, we call this approach using the refined
knowledge graph as RR.
It is worth noting that we use tags and categories to describe
user needs for the following reasons: (1) Tags/categories
can be regarded as precise summaries of API functions,
so they carry more rich information. (2) Tags/categories have
been recognized as successful in organizing and sharing
resources in information systems, especially in the era of
social Web, such as Flickr, YouTube, Delicious and other
websites. This is also true for service/API repositories, e.g.,
ProgrammableWeb and Seekda.
B. QUERY-SPECIFIC WEIGHTI NG
Up to now, we use uniform weight for different links when
constructing knowledge graph, and do not consider the
impact of different weights of links on the recommendation
effects. It is almost impossible to find the global optimal
configuration of all link weights. For this reason, we intro-
duce some simple but easy-to-operate heuristic strategies to
adjust weights of specific links, to reflect the influence of user
preferences on mashup developments.
Q1: In a common sense, the APIs contain more information
related to Q, the more important they should be. Therefore,
we strengthen the weights of links between Q and those APIs
to reflect this principle.
Q2: In many cases, sets Q
cat
and Q
tag
contain the same
keywords. For example, a mashup requirement may include
both social_tag and social_category. In our dataset, 95.5%
keywords in the Q
cat
appears in the Q
tag
, so we should give
more weights to the APIs they point together.
VOLUME 7, 2019 7653
剩余11页未读,继续阅读
资源评论
weixin_38518074
- 粉丝: 6
- 资源: 927
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功