annotate index.html @ 12:b2605d77692c draft default tip

fix
author Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
date Sat, 08 Sep 2012 08:46:15 +0900
parents 39c917cdb30d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 <!DOCTYPE html>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 <html>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 <head>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 <style type="text/css">
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 .center {
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 margin-left: auto;
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 margin-right: auto;
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 text-align: center;
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 }
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 </style>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
11
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 <title>Presentation</title>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 <meta charset='utf-8'>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 <script src='./slides.js'></script>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 </head>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 <body style='display: none'>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 <section class='slides layout-regular template-default'>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 <article>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 <h1>GraphDB 入門<br>TinkerPop の使い方</h1>
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
20 <p>Shoshi Tamaki<br>Nobuyasu Oshiro<br>08 Sep 2012</p>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 </article>
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
22
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 <article>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
24 <h3>もくじ</h3>
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
25 <br/>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
26 <small>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
27 <ul>
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
28 <li>ストライクウィッチーズで,GraphDB/TinkerPop入門</li>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
29 <ul>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
30 <li>GraphDBとは</li>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
31 <li>PropertyGraphについて</li>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
32 <li>TinkerPopとは</li>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
33 <li>TinkerPopを使ってストライクウィッチーズの相関図を解析</li>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
34 </ul>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
35 <li>TinkerPop による PageRank の実装</li>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
36 <ul>
7
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
37 <li>PageRank アルゴリズム</li>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
38 <li>Page と PageRank の GraphDB による表現</li>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
39 <li>TinkerPop による PageRank の計算</li>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
40 <li>Pipes による走査</li>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
41 <li>PageRank の計算にかかる時間</li>
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
42 </ul>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
43 </ul>
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
44 </small>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
45 </article>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
46
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
47 <article>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
48 <h3>GraphDB とは?</h3>
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
49 <p>Graph構造を保存するためのデータベース.</p>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
50 <p>Graph構造とは,たとえばこんなもの</p>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
51 <br/>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
52 <img src="./images/de2bf86e.jpeg" class="centered" height="470px"/>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
53 </article>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
54
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
55 <article>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
56 <h3>GraphDB とは?</h3>
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
57 <p>このような構造をしたGraphは<span style="color: red">PropertyGraph</span>と呼ばれる.</p>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
58 <p>PropertyGraphとは,</p>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
59 <br/>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
60 <img src="./images/propertygraph_sw.png" height="470px" class="centered"/>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
61 </article>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
62
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
63 <article>
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
64 <h3>PropertyGraph</h3>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
65 <p><span color="red">関係・人物・名前・特徴</span>は<span color="red">Vertex・Edge・Label・Property</span>と呼ばれる.</p>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
66 <small>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
67 <ul>
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
68 <li>Edge(関係)が方向を持つ</li>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
69 <li>Vertex(人物)とEdge(関係)はLabel(名前)を持つ</li>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
70 <li><span style="color: red">VertexとEdgeはKey/Valueのマップ(Property)を持っている.</span></li>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
71 </ul>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
72 </small>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
73 <img src="./images/propertygraph_sw2.png" height="400px" class="centered"/>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
74 </article>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
75
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
76 <article>
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
77 <h3>GraphDBとは?</h3>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
78 <p>GraphDBは,保存されたGraphのVertex,Edgeを渡り歩き,目的のデータを取得するようなデータベースである.</p>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
79 <p>渡り歩くことをTraverseという.</p>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
80 <br/>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
81 <img src="./images/traverse_sw.png" class="centered"/>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
82 </article>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
83
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
84 <!--
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
85 <article>
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
86 <h3>GraphDB入門</h3>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
87 <p>ここまでに,GraphDB とそのデータ構造である,Property Graph とは何か説明してきた.</p>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
88 <p>今日は,この<span style="color: red">ストライクウィッチーズの相関図</span>を GraphDB に叩きこみ <span style="color:red">TinkerPop</span> を使って解析する.</p>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
89 <br/>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
90 <img src="./images/today-demo.png" class="centered"/>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
91 </article>
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
92 -->
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
93
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
94 <article>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
95 <h3>TinkerPop</h3>
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
96 <p>TinkerPopはGraphDBを利用するためのツール群である.</p>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
97 <br/>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
98 <br/>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
99 <img height="300px" src="./images/tinkerpop_with_name.png" class="centered"/>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
100 </article>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
101
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
102 <article>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
103 <h3>Blueprints</h3>
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
104 <p>Blueprintsは,PropertyGraphのJavaのinterfaceを提供する.</p>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
105 <p>GraphDBの世界のJDBCの立場を目指している.</p><br/>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
106 <small>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
107 Blueprints を実装している GraphDB の一例
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
108 <ul>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
109 <li>Neo4j<li>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
110 <li>OrientDB</li>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
111 <li>MongoDB</li>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
112 <li>etc...</li>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
113 </ul>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
114 </small>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
115 <img src="./images/blueprints-logo.png" height="100px"/>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
116 </article>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
117
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
118 <article>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
119 <h3>Gremlin</h3>
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
120 <p>GraphをTraverseするための言語.Groovyがベースである.GraphDBに対してQueryを発行することが出来る.コンソールも利用できる.</p>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
121 <pre>gremlin&gt; graph.v(1).out.name
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
122 ==>vadas
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
123 ==>lop
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
124 ==>josh</pre>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
125 <p>GremlinはPipesを利用して,GraphをTraverseする..out.nameがPipeである..</p>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
126 <img src="./images/gremlin-logo.png"/>
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
127 </article>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
128
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
129 <article>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
130 <h3>Pipes</h3>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
131 <p>PipesはGraphを処理するためのフレームワークである.Pipeという処理の単位を複数連結し,複雑なTraverseを実現する.</p>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
132 <img src="./images/pipes.png" height="150px" class="center"/>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
133 <p>graph.v(1)はGraphからIDか1のVertexを取得する,.out .name がぞれぞれPipeに値する.</p>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
134 <img src="./images/pipes-logo.png" height="200px"/>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
135 </article>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
136
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
137 <article>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
138 <h3>Pipes</h3>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
139 <p>この例題の動作は・・・</p>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
140 <br/>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
141 <br/>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
142 <img style="float: left; margin-right:10px" src="./images/pipes-mario-2.png" height="300px"/>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
143 <br/>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
144 <img src="./images/pipes-mario-4.png" height="75px"/>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
145 <pre>gremlin&gt; g.v(1).out.name
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
146 ==>vadas
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
147 ==>lop
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
148 ==>josh</pre>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
149 <br style="clear: both;"/>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
150 <small>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
151 <p>outはVertexから外向きのEdgeで繋がっているVertex一覧を取得する,nameはProperty名でPipeではVertexのnameを取得している.</p>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
152 </small>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
153 </article>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
154
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
155 <article>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
156 <h3>ストライクウィッチーズの相関図を解析するには?</h3>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
157 <br/>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
158 <ol>
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
159 <li>BlueprintsでTinkerGraphにストライクウィッチーズの相関図を入力する.</li>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
160 <li>作成したTinkerGraphを,</li>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
161 <ul>
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
162 <li>Gremlinのコンソールから解析してみる.</li>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
163 <li>JavaからGremlinを使って解析してみる.</li>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
164 </ul>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
165 </ol>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
166 <br/>
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
167 <p>まずは,TinkerGraphにストライクウィッチーズの相関図を入力する.</p>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
168 </article>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
169
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
170 <article>
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
171 <h3>この発表のサンプルコードについて</h3>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
172 <br/>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
173 <p><span style="color:red">hg clone https://bitbucket.org/suikwasha/graphdb_javakuche</span></p>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
174 <br/>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
175 <small>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
176 <p>Mavenというプロジェクト管理ツールを利用したプロジェクトになってます.</p>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
177 </small>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
178 <pre>ビルド方法・解凍したディレクトリに移動して
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
179 $ mvn compile</pre>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
180 </article>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
181
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
182 <article>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
183 <h3>ストライクウィッチーズの相関図を解析するには?</h3>
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
184 <p>Blueprintsは,GraphDBへのインターフェイスを提供する.TinkerGraphはBlueprintsを用いて利用できる.</p>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
185 <small>
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
186 <p>相関図のGraphを作るためには,<span style="color:red">Graph</span>を作成し<span style="color:red">人物(Vertex)</span>と<span style="color:red">関係(Edge)</span>,<span style="color:red">特徴(Property)</span>を作る必要がある.</p>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
187 </small>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
188 <small>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
189 <pre>// 相関図(Graph)の作成,データを保存するディレクトリを引数に取る
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
190 Graph g = new TinkerGraph();</pre>
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
191 <pre>// 人物(Vertex)の作成,設定したいIDを引数に取る
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
192 Vertex character = g.addVertex(ID);</pre>
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
193 <pre>// 関係(Edge)の作成,設定したいIDを引数に取る
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
194 Edge relation = g.addEdge(ID,From,To,Label);</pre>
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
195 <pre>// 特徴(Property)の作成 , Vertex・Edgeともに同様のメソッド
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
196 character.setProperty(PropertyName,PropertyValue);</pre>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
197 </small>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
198 </article>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
199
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
200 <article>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
201 <h3>ストライクウィッチーズの相関図を解析するには?</h3>
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
202 <p>これを入力します.</p>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
203 <img src="./images/de2bf86e.jpeg" height="550px" class="centered"/>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
204 </article>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
205
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
206 <article>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
207 <h3>ストライクウィッチーズの相関図を解析するには?</h3>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
208 <p>画像を見ながらコードに書き起こすと・・・</p>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
209 <small>
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
210 <pre>Graph g = new TinkerGraph("./strikewitches"); // 保存ディレクトリ
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
211 Vertex strikeWitches = g.addVertex("StrikeWitches");
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
212 Vertex yoshika = g.addVertex("yoshika");
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
213 yoshika.setProperty(propName,"宮藤芳佳");
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
214 yoshika.setProperty(propRank,"軍曹");
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
215 yoshika.setProperty(propAge,14);
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
216 yoshika.setProperty(propCV,"福圓美里");
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
217 yoshika.setProperty(propUnit,"扶桑皇国海軍遣欧艦隊");
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
218 yoshika.setProperty(propPersonality,"明るく前向きで一生懸命");
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
219 Vertex lynett = g.addVertex("lynett");
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
220 lynett.setProperty(propName,"リネット・ビショップ");
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
221 lynett.setProperty(propRank,"軍曹");
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
222 lynett.setProperty(propAge, 15);
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
223 lynett.setProperty(propCV,"名塚佳織");
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
224 lynett.setProperty(propUnit,"ブリタニア空軍");
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
225 lynett.setProperty(propPersonality,"家庭的で戦闘は苦手");
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
226 g.addEdge(null,yoshika,lynett,"仲良し新人コンビ");
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
227 g.addEdge(null,lynett,yoshika,"仲良し新人コンビ");</pre>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
228 </small>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
229 </article>
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
230
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
231 <article>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
232 <h3>CreateStrikeWitchesGraph</h3>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
233 <p>実際にコードを動作させてTinkerGraphに入力する.</p>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
234 <br/>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
235 <small>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
236 <p>mvn exec:java -Dexec.mainClass=suikwasha.javakuche.CreateStrikeWitchesGraph</p>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
237 </small>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
238 <br/>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
239 <p>プロジェクトのディレクトリにstrikwitchesが作成される.</p>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
240 </article>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
241
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
242 <article>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
243 <h3>ストライクウィッチーズの相関図を解析するには?</h3>
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
244 <p>Blueprintsを用いてTinkerGraphに相関図を書き込むことが出来た.</p>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
245 <p>今回は,Graph探索のサンプルのため"StrikeWitches"というキャラクター全員が所属する頂点を追加してある.</p>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
246 <br/>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
247 <ol>
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
248 <li>BlueprintsでTinkerGraphにストライクウィッチーズの相関図を入力する.</li>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
249 <span style="color:red">
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
250 <li>Gremlinを使って,TinkerGraphを読み込み,</li>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
251 <ul>
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
252 <li>Gremlinのコンソールから解析してみる.</li>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
253 <li>JavaからGremlinを使って解析してみる.</li>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
254 </ul>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
255 </span>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
256 </ol>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
257 <br/>
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
258 <p>では,Gremlinを利用して相関図を解析してみる.</p>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
259 </article>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
260
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
261 <article>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
262 <h3>ストライクウィッチーズの相関図を解析するには?</h3>
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
263 <p>Gremlinのセットアップ</p>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
264 <ul>
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
265 <li>github tinkerpop/gremlin &gt; Wiki のdownloadsから<span style="color:red">gremlin-groovy-2.1.0.zip</span>を利用する.</span></li>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
266 <li>解凍して展開する.</li>
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
267 <li>bin/gremlin.shを実行</li>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
268 </ul>
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
269 <pre>% ./gremlin.sh [~/Downloads/gremlin-groovy-2.1.0/bin]
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
270 \,,,/
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
271 (o o)
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
272 -----oOOo-(_)-oOOo-----
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
273 gremlin&gt;</pre>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
274 <p>こんなの表示される.</p>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
275 </article>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
276
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
277 <article>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
278 <h3>ストライクウィッチーズの相関図を解析するには?</h3>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
279 <p>Gremlin に相関図を食べさせて,解析開始.</p>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
280 <pre>gremlin&gt; g = new TinkerGraph("path_to_graph");
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
281 ==>tinkergraph[vertices:12 edges:32 directory:path_to_graph]
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
282 gremlin&gt; </pre>
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
283 <p>Vertexの一覧を取得してみる.</p>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
284 <pre>gremlin> g.V // GraphのVertex一覧
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
285 ==>v[mio]
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
286 ...
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
287 ==>v[minna]
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
288 ==>v[lynett]
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
289 ...
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
290 ==>v[gertrud]
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
291 ==>v[francesca]</pre>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
292 </article>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
293
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
294 <article>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
295 <h3>ストライクウィッチーズの相関図を解析するには?</h3>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
296 <p><span style="color:red">宮藤芳佳</span>の<span style="color:red">年齢</span>を取得.</p>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
297 <pre>gremlin&gt; g.v("yoshika").age
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
298 ==&gt;14</pre>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
299 <p><span style="color:red">宮藤芳佳</span>を<span style="color:red">指導</span>しているのは誰?</p>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
300 <pre>gremlin&gt; g.v("yoshika").in("指導").name
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
301 ==&gt;坂本美緒</pre>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
302 <p><small><span style="color:red">宮藤芳佳</span>のことを<span style="color:red">きっー!なんなんですのアナタは!?</span>と思っている人が<span style="color:red">勤務態度に不満</span>を持っている人たち</small></p>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
303 <pre>gremlin&gt; g.v("yoshika").in("きっー!なんなんですのアナタは!?")
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
304 .out("勤務態度に不満").name
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
305 ==&gt;シャーロット・E・イエーガー
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
306 ==&gt;フランチェスカ・ルッキーニ</pre>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
307 </article>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
308
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
309 <article>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
310 <h3>ストライクウィッチーズの相関図を解析するには?</h3>
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
311 <p><small><span style="color:red">宮藤芳佳</span>のことを<span style="color:red">きっー!なんなんですのアナタは!?</span>と思っている人が<span style="color:red">勤務態度に不満</span>を持っている人たち</small></p>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
312 <pre>gremlin&gt; g.v("yoshika").in("きっー!なんなんですのアナタは!?")
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
313 .out("勤務態度に不満").name
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
314 ==&gt;シャーロット・E・イエーガー
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
315 ==&gt;フランチェスカ・ルッキーニ</pre>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
316 <img src="./images/traverse_demo.png" height="250px" class="centered"/>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
317 </article>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
318
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
319 <article>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
320 <h3>ストライクウィッチーズの相関図を解析するには?</h3>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
321 <p><span style="color:red">16歳以下</span>の<span style="color:red">ウィッチ一覧</span></p>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
322 <pre>gremlin&gt; g.v("StrikeWitches").out.filter{it.age &lt; 16}.name
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
323 ==&gt;宮藤芳佳
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
324 ==&gt;エイラ・イルマタル・ユーティライネン
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
325 ==&gt;サーニャ・V・リトヴャク
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
326 ==&gt;リネット・ビショップ
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
327 ==&gt;ペリーヌ・クロステルマン
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
328 ==&gt;フランチェスカ・ルッキーニ</pre>
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
329 <small>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
330 <p>{it.age &lt; 16}はクロージャである.outで出力されたキャラクターのVertexが,それぞれitに格納される.Groovyでitは暗黙に定義されるクロージャの変数であり,第一引数が自動的に割り当てられる.</p>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
331 </small>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
332 </article>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
333
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
334 <article>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
335 <h3>ストライクウィッチーズの相関図を解析するには?</h3>
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
336 <p>GremlinをJavaから使うためには,Mavenを利用するのが簡単である.</p>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
337 <p>Mavenはプロジェクト管理ツールであり,他のプロジェクトのライブラリを簡単に取り込むことができる.</p>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
338 <p>pom.xmlにGremlinを取り込むように記述する.</p>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
339 <pre>&lt;dependency&gt;
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
340 &lt;groupId&gt;com.tinkerpop.gremlin&lt;/groupId&gt;
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
341 &lt;artifactId&gt;gremlin-java&lt;/artifactId&gt;
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
342 &lt;version&gt;2.1.0&lt;/version&gt;
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
343 &lt;/dependency&gt;</pre>
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
344 <p>"Using Gremlin through Java" よりtinkerpop/gremlin wiki</p>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
345 </article>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
346
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
347 <article>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
348 <h3>ストライクウィッチーズの相関図を解析するには?</h3>
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
349 <p>TinkerGraphで作った,相関図を読み込む</p>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
350 <pre>Graph g = new TinkerGraph("path_to_graph");</pre>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
351 <p>GremlinPipeline の作成</p>
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
352 <pre>GremlinPipeline&lt;Vertex,String&gt; pipe
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
353 = new GremlinPipeline&lt;Vertex,String&gt;();
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
354 pipe.start(g.getVertex("yoshika"))....</pre>
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
355 <p>GremlinはGraphに対して処理をするPipeをつなげて,複雑な探索を可能にする.Gremlin コンソールでは見えないが,JavaではPipesを利用しているのが確認できる.</p>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
356 </article>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
357
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
358 <article>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
359 <h3>ストライクウィッチーズの相関図を解析するには?</h3>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
360 <p><span style="color:red">宮藤芳佳</span>を<span style="color:red">指導</span>しているのは誰?</p>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
361 <pre>pipe.start(g.getVertex("yoshika")).in("指導").property("name");
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
362 for(String name : pipe){
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
363 System.out.println("name")
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
364 }</pre>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
365 <p><small><span style="color:red">宮藤芳佳</span>のことを<span style="color:red">きっー!なんなんですのアナタは!?</span>と思っている人が<span style="color:red">勤務態度に不満</span>を持っている人たちの年齢</small></p>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
366 <pre>pipe.start(g.getVertex("yoshika")).in("きっー!なんなんですのアナタは!?")
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
367 .out("勤務態度に不満").property("age");
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
368 for(Integer age : pipe){
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
369 System.out.println(age);
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
370 }</pre>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
371 </article>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
372
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
373 <article>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
374 <h3>ストライクウィッチーズの相関図を解析するには?</h3>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
375 <p><span style="color:red">15歳以上</span>の<span style="color:red">ウィッチーズの名前</span></p>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
376 <pre>pipe.start(g.getVertex("StrikeWitches")).out("member")
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
377 .filter(new PipeFunction&lt;Vertex,Boolean&gt;(){
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
378 public Boolean compute(Vertex _argument){
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
379 return (Integer)_argument.getProperty("age") >= 15;
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
380 }
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
381 }).name;
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
382 for(String name : pipe){
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
383 System.out.println(name);
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
384 }</pre>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
385 <p>書き方としては,Gremlin コンソールでのほうが簡潔.</p>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
386 <pre>gremlin&gt; g.v("StrikeWitches").out.filter{it.age &gt; 15}.name</pre>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
387 </article>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
388
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
389 <article>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
390 <h3>ストライクウィッチーズの相関図を解析するには?</h3>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
391 <p>Gremlin コンソールでの書き方を Java で利用することができる.</p>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
392 <pre>Pipe pipe = Gremlin.compile("_().out.filter{it.age &gt; 15}.name");
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
393 pipe.setStarts(
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
394 new SingleIterator&lt;Vertex&gt;(g.getVertex("StrikeWitches"));
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
395 for(Object name : pipe){
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
396 System.out.println(name);
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
397 }</pre>
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
398 <p>_()はGremlinePipelineに定義されている何もしないPipe</p>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
399 <p>JavaでPipeを直接構築するより,こっちのほうが簡単である.</p>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
400 </article>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
401
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
402 <article>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
403 <h3>まとめ</h3>
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
404 <p>これまでに,ストライクウィッチーズの相関図を利用してGraphDBの概要とTinkerPopの簡単な使い方を見てきた.</p>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
405 <p>この発表で大体のイメージが掴めてもらえれば幸いです.</p>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
406 <ul>
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
407 <li>GraphDBは,GraphのEdgeをTraverseして,目的のデータを取得するデータベース</li>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
408 <li>GraphDBは,PropertyGraphを格納する.</p>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
409 <li>TinkerPopは,GraphDBを利用するためのツールの集合</li>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
410 </ul>
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
411 <br/>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
412 <p>次に,具体的な利用例としてPageRankのGraphDBでの表現について発表する.</p>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
413 </article>
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
414
9
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
415 <article>
10
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 9
diff changeset
416 <h3>TinkerPopによるPageRankの実装</h3>
9
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
417 <ul>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
418 <li>PageRankアルゴリズム</li>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
419 <li>PageとPageRankのGraphDBによる表現</li>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
420 <li>TinkerPopによるPageRankの計算</li>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
421 <li>Pipesによる走査</li>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
422 <li>PageRankの計算にかかる時間</li>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
423 </ul>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
424 </article>
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
425
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
426 <article>
9
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
427 <h3>GoogleのPageRankアルゴリズム</h3>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
428 <ul>
9
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
429 <li>GoogleのWebページ検索エンジンに使われているアルゴリズム。</li>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
430 <li>あるページの『重要度』を示す値で、各ページ毎に持っている。 </li>
9
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
431 <li>PageRankが高いほど検索結果の上位に表示される。</li>
1
a5e7d50b110a fix presentation
nobuyasu
parents: 0
diff changeset
432 <li>『多くの良質なページからリンクされているページは、やはり良質なページである』という考えのアルゴリズム<br></li>
9
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
433 <li>GraphDBはPageRankの計算に向いている。</li>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
434 </ul>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
435 </article>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
436
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
437
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
438 <article>
9
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
439 <h3>PageとPageRankのGraphDBによる表現</h3>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
440 <ul>
9
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
441 <li>アンサイクロペディアの各ページをGraphDBで表す。</li>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
442 <li>1Vertexが1つのページを表す。</li>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
443 <li>各VertexはPageTitleとPageRankをPropertyとして持つ。</li>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
444 <li>リンクは "HAS_LINK" という関係で表される。</li>
9
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
445 <li>PageRankはdoubleで初期値は 0.15 , 最大値はページ数*0.15</li>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
446 <li>アンサイクロペディアではURIはページタイトルと同じ。</li>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
447 <li>URIに対してユニークなVertexID を割り振る。</li>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
448 </ul>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
449 </article>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
450
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
451 <article>
9
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
452 <h3>TinkerPopによるPageRankの計算</h3>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
453 <ul>
9
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
454 <li>○はVertexを、→ はEdgeを表す。</li>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
455 <p class="center">
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
456 <img src="./pic/graph.png" style="height:70%;">
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
457 </p>
2
c7316a75c5ea fix index.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
458 <small><p>例:アンサイクロペディア内のページ『琉球大学』のリンクの関係 </p></small>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
459 </ul>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
460 </article>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
461
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
462 <article>
9
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
463 <h3>PageRankアルゴリズム</h3>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
464 <ul>
9
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
465 <li>PageRankは次の計算式で求めることができる。</li>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
466 <pre>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
467 PR(A) = (1-d) + d (PR(T1)/C(T1) + ... + PR(Tn)/C(Tn))</pre>
9
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
468 <li>PR(A) は A というページのPageRankを表す。</li>
1
a5e7d50b110a fix presentation
nobuyasu
parents: 0
diff changeset
469 <li>d は定数で 0.85</li>
a5e7d50b110a fix presentation
nobuyasu
parents: 0
diff changeset
470 <li>C(T1) は T1 というページがリンクを張っている数を表す。 </li>
2
c7316a75c5ea fix index.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
471 <li>T1...Tn は A をリンクしているページなので、C(T1)...C(Tn) は 0 にならない。</li>
9
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
472 <li>GoogleのPageRankはこれを改良したものである。</li>
11
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 10
diff changeset
473 <li>今回はこのアルゴリズムを使ってPageRankを求める。</li>
2
c7316a75c5ea fix index.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
474 <!--
9
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
475 <li>PageRankはリンクを張ってくるページのPageRankが加算される。 </li>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
476 <li>この時加算されるPageRankはリンクの数で割られた値となる。</li>
2
c7316a75c5ea fix index.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
477 -->
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
478 </ul>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
479 </article>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
480
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
481 <article>
9
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
482 <h3>PageRankの取得</h3>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
483 <ul>
12
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
484 <p class="center">
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
485 <img src="./pic/page_rank.png" style="height:40%;">
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
486 </p>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
487 <li>TinkerGraph上でPageRankの値を出すために以下の2つの値が必要</li>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
488 <ul>
9
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
489 <li>リンク("HasLink")の関係を張ってくるVertexの取得</li>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
490 <li>リンクしてくるVertexがどれだけリンクを張っているかを取得</li>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
491 <small><p>*各ページの情報はXMLから取り出しBlueprintsを用いてTinkerGraphに書き込み済み。</p></small>
2
c7316a75c5ea fix index.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
492
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
493 </ul>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
494 </ul>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
495 </article>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
496
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
497 <article>
9
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
498 <h3>Pipesによる走査</h3>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
499 <ul>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
500 <li>あるページへとリンクを張るページ(Vertex)の取得</li>
12
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
501 <small><p>「id」はVertexのIDを表す。</p></small>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
502 <pre>
2
c7316a75c5ea fix index.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
503 Graph graph = ...
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
504 GremlinPipeline pipe = new GremlinPipeline();
2
c7316a75c5ea fix index.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
505 pipe.start(graph.getVertex(id));
c7316a75c5ea fix index.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
506 pipe.in("HasLink");
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
507 for (Object inVerObj : pipe) {
9
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
508 VertexinVer = (Vertex)inVerObj;
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
509 :
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
510 } </pre>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
511 <p class="center">
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
512 <img src="./pic/inHasLink.png" style="height:30%;">
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
513 </p>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
514 </ul>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
515 </article>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
516
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
517 <article>
9
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
518 <h3>Pipesによる走査</h3>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
519 <ul>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
520 <li>あるページが張っているリンクの数の取得</li>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
521 <pre>
2
c7316a75c5ea fix index.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
522 Graph graph = ...
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
523 GremlinPipeline pipe = new GremlinPipeline();
2
c7316a75c5ea fix index.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
524 pipe.start(graph.getVertex(id));
c7316a75c5ea fix index.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
525 pipe.out("HasLink");
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
526 long linkNum = pipe.count();
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
527 </ul>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
528 <p class="center">
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
529 <img src="./pic/outHasLink.png" style="height:30%;">
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
530 </p>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
531
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
532 </article>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
533
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
534 <article>
9
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
535 <h3>TinkerPopによるPageRankの計算</h3>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
536 <ul>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
537 <pre>
2
c7316a75c5ea fix index.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
538 final double weight = 0.85;
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
539 double sum = 0.0;
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
540 double pageRank = 0.0;
9
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
541 Vertexv = graph.getVertex(id);
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
542 GremlinPipeline pipe = new GremlinPipeline();
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
543 pipe.start(graph.getVertex(id)).in("HasLink");
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
544 for (Object inVerObj : pipe) {
9
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
545 VertexinVer = (Vertex) inVerObj;
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
546 Object inVerId = inVer.getId();
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
547 GremlinPipeline inPipe = new GremlinPipeline();
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
548 inPipe.start(graph.getVertex(inVerId)).out("HasLink");
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
549 long linkNum = inPipe.count();
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
550 double pr = (Double) inVer.getProperty(PAGE_RANK);
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
551 sum += (double) pr / linkNum;
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
552 }
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
553 pageRank = (double) 1 - weight + (double) sum * weight;
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
554 v.setProperty(PAGE_RANK, pageRank);
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
555 </pre>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
556 </ul>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
557 </article>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
558
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
559 <article>
7
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
560 <h3>計算結果</h3>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
561 <ul>
9
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
562 <li>アンサイクロペディア内でPageRankの高いページ</li>
2
c7316a75c5ea fix index.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
563 <li>総ページ数: 242014 ページ</li>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
564 <table>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
565 <tr>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
566 <td>ページ名</td>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
567 <td>リンク数</td>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
568 <td>PageRank</td>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
569 </tr>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
570 <tr>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
571 <td>ユーモア枯渇症</td>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
572 <td>7162</td>
4
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
573 <td>71.120</td>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
574 <!-- <td>2.9387157726301383E-4</td> -->
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
575 </tr>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
576 <tr>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
577 <td>日本</td>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
578 <td>3537</td>
4
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
579 <td>54.584</td>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
580 <!-- <td>2.2555002445844352E-4</td> -->
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
581 </tr>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
582 <tr>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
583 <td>アンサイクロペディア</td>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
584 <td>3887</td>
4
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
585 <td>54.164</td>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
586 <!-- <td>2.2381320294806578E-4</td> -->
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
587 </tr>
4
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
588 <tr>
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
589 <td>ウィキペディア </td>
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
590 <td>2414</td>
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
591 <td>44.617</td>
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
592 </tr>
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
593 <tr>
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
594 <td>ニンジャスター</td>
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
595 <td>177</td>
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
596 <td>36.167</td>
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
597 </tr>
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
598
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
599 </table>
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
600 </ul>
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
601 </article>
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
602
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
603 <article>
9
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
604 <h3>PageRankの計算にかかる時間</h3>
4
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
605 <ul>
12
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
606 <li>PageRankは 10 回かからずの計算でほぼ収束した。</li>
4
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
607 <table>
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
608 <td>
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
609 <img src="./pic/pageRank.png" style="height:70%;">
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
610 </td>
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
611 <td>
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
612 <img src="./pic/computePageRank.png" style="height:70%;">
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
613 </td>
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
614 </table>
9
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
615 <li>PageRankの計算は10回行うとして、ページ数に対してかかる時間を測ってみた。</li>
4
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
616 </ul>
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
617 </article>
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
618
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
619 <article>
9
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
620 <h3>PageRankの計算にかかる時間</h3>
4
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
621 <ul>
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
622 <li>各ページ数で行う10回計算をそれぞれ10回ずつタイムを測り平均をとった。</li>
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
623 <table>
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
624 <tr>
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
625 <td>ページ数</td>
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
626 <td>10回の計算にかかった時間(単位:ms)</td>
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
627 </tr>
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
628 <tr>
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
629 <td>100</td>
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
630 <td>21</td>
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
631 </tr>
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
632 <tr>
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
633 <td>1000</td>
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
634 <td>67</td>
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
635 </tr>
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
636 <tr>
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
637 <td>10000</td>
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
638 <td>976</td>
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
639 </tr>
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
640 <tr>
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
641 <td>50000</td>
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
642 <td>7140</td>
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
643 </tr>
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
644 <tr>
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
645 <td>100000</td>
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
646 <td>26150</td>
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
647 </tr>
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
648 <tr>
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
649 <td>200000</td>
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
650 <td>74130</td>
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
651 </tr>
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
652 <tr>
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
653 <td>242014</td>
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
654 <td>93512</td>
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
655 </tr>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
656 </table>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
657 </ul>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
658 </article>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
659
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
660
4
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
661 <article>
9
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
662 <h3>PageRankの計算にかかる時間</h3>
4
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
663 <ul>
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
664 <img src="./pic/pageRankCompare.png">
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
665 </ul>
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
666 </article>
125ab02ad634 add some pic
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
667
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
668 <article>
7
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
669 <h3>まとめ</h3>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
670 <ul>
9
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
671 <li>今回、TinkerPopを用いてアンサイクロペディアの各ページのPageRankを求めた。</li>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
672 <li>各ページとVertex, リンクの関係をEdgeで表すことで各ページ間の関係をTinkerPop上で表した。 </li>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
673 <li>Gremlin を用いて各Vertexを渡り歩ことでPageRankの計算を行った。</li>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
674 <li>全Vertexに対しての計算量はVertexの数に比例していることが確認できた。 </li>
7
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
675 </ul>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
676 </article>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
677
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
678 <article>
8
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
679 <h3>今日の勉強会で覚えておきたいこと</h3>
7
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
680 <ul>
9
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
681 <li>Graph の関係を表すようなデータはGraphDBで表現しやすい。</li>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
682 <li>GraphDBではVertex間を渡り歩く(Traverse)ことでデータの取得を行う。 </li>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
683 <li>GraphDBは局所性のあるデータを高速に計算することができる。</li>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
684 </ul>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
685 </article>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
686
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
687 <article>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
688 <h3>参考文献・サイト</h3>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
689 <ul>
9
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
690 <small><li>[1]Googleの秘密 -PageRank徹底解説<br>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
691 <a href="http://homepage2.nifty.com/baba_hajime/wais/pagerank.html">http://homepage2.nifty.com/baba_hajime/wais/pagerank.html</a></li></small>
9
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
692 <small><li>[2] LawrencePage, Sergey Brin, Rajeev Motwani, Terry Winograd, 'ThePageRankCitation Ranking: Bringing Order to the Web', 1998,<br>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
693 <a href="http://www-db.stanford.edu/~backrub/pageranksub.ps">http://www-db.stanford.edu/~backrub/pageranksub.ps</a></li></small>
9
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
694 <small><li>[3] ThePageRankAlgorithm<br>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
695 <a href="http://pr.efactory.de/e-pagerank-algorithm.shtml">http://pr.efactory.de/e-pagerank-algorithm.shtml</a></li></small>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
696
9
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
697 <small><li>[4] グラフデータベースを用いたPageRank実装の試み:スケーラブルなグラフ処理系に向けて<br>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
698 <a href="http://live-e.naist.jp/sensor_overlay/5/doc/hanai.pdf">http://live-e.naist.jp/sensor_overlay/5/doc/hanai.pdf</a></li></small>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
699 <!--
9
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
700 <small><li>Taher H. Haveliwala, 'Efficient Computation ofPageRank', Stanford Technical Report, 1999,<br>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
701 <a href="http://dbpubs.stanford.edu:8090/pub/1999-31">http://dbpubs.stanford.edu:8090/pub/1999-31</a></li>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
702 -->
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
703 </small>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
704 </ul>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
705 </article>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
706
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
707
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
708
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
709 <article>
9
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
710 <h3>なぜPageRankなのか</h3>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
711 <ul>
9
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
712 <li>PageRankはPageとPageのリンクの有無を利用して計算できる。</li>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
713 <li>GraphDBはVertexとVertexを結ぶEdgeを走査(Traverse)することで、
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
714 目的のデータを得るようなデータベースである。</li>
9
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
715 <li>また、GraphDBは局所性のあるデータを高速に計算することができる。 </li>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
716 <li>PageRankのPageの関係はGraphDBのVertexとEdgeで表すことができる<li>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
717 <li>また、Pageの数が増えても局所的な計算ができるためGraphDBはPageRank
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
718 を求める DB に向いている。</li>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
719 </ul>
5
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
720 </article>
0
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
721
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
722
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
723 </section>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
724 </body>
7f57cb53663a add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
725 </html>