下载此文档

图数据库原理.pdf


文档分类:IT计算机 | 页数:约10页 举报非法文档有奖
1/10
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/10 下载此文档
文档列表 文档介绍
Report
Graph Databases
CS341 Distributed Information Systems
ed in further rec-
ommendations for Pizza places. The figure shows one possible (graphical) solution by
looking at other user’s recommendations based on Alex’ favorites.
Figure 1: An example graph illustrating a graphical solution for finding additional rec-
ommendations for user Alex based on his existing recommendations.
user recommends
Alex C
Alex D
Luke D
Luke E
Table 1
Table 1 shows the recommends edges for the presented graph in a relational database.
By a simple lookup, we find all recommendations of Alex. Then, we have to reach
other users that recommended the same places (Luke in our case). This is done by
self-joining the table. Now, we again have to use a self-join to ‘traverse’ from Luke to his
recommendations. The following SQL query shows a possible solution:3
SELECT * FROM recommendations r1
JOIN recommendations r2 ON
r2. user <> r1. user AND
r2. recommends = r1. recommends
JOIN recommendations r3 ON
r3. user = r2. user
Notice that the filtering of already r

图数据库原理 来自淘豆网www.taodocs.com转载请标明出处.

相关文档 更多>>
非法内容举报中心
文档信息
  • 页数10
  • 收藏数0 收藏
  • 顶次数0
  • 上传人gorynich
  • 文件大小966 KB
  • 时间2022-05-20
最近更新