Skip to content

Commit

Permalink
add control.sh & modify README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
lipanpan03 authored and tugraph committed Jun 6, 2023
1 parent f0e94cd commit f317b7c
Show file tree
Hide file tree
Showing 15 changed files with 31 additions and 42 deletions.
9 changes: 1 addition & 8 deletions three_kingdoms/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,7 @@
由于史料的缺失,一些即使为人们熟知的历史事件也往往存在着很多未解之谜。以三国历史为例,诸葛亮为什么出山帮助当时势力弱小的刘备,同为天下英雄的曹操和刘备为什么成就差距巨大等等。以往学者往往采用二维关系分析历史,这样得出的结论往往比较片面。使用TuGraph将三国的历史人物和事件导入图模型中,使用图计算方式进行分析,能够帮助我们从有限的信息中获得更有价值的知识,是一种非常有意义的跨学科尝试。
# 2. 数据建模
我们设计了5类顶点和5类边,点包括“主公”,“州”,“文臣”,“武将”,“战役”,边包括“父亲”,“兄长”,“隶属”,“籍贯”,“参战”。其具体建模信息如下所示:
5类点
![image.png](images/leader.png)
![image.png](images/states.png)
![image.png](images/officer.png)
![image.png](images/solider.png)
![image.png](images/war.png)
5类边
![image.png](images/edges.png)
![image.png](images/schema.png)
# 3. 数据导入
向TuGraph导入数据,既可以使用TuGraph的`lgraph_import`工具离线导入,也可以使用页面导入。lgraph_import导入命令如下所示
```shell
Expand Down
File renamed without changes.
30 changes: 30 additions & 0 deletions three_kingdoms/control.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash
set -x
TUGRAPH_PATH=${HOME}/project/tugraph-db/build/output
TUGRAPH_WEB=${TUGRAPH_PATH}/resource
function start {
"${TUGRAPH_PATH}"/lgraph_server -c ./lgraph_standalone.json --web "${TUGRAPH_WEB}" -d start
}
function stop {
"${TUGRAPH_PATH}"/lgraph_server -c ./lgraph_standalone.json -d stop
}
function load {
"${TUGRAPH_PATH}"/lgraph_import -c ./rawdata/import.json -d lgraph_db --overwrite true --graph default --verbose 2
}
function remove {
rm -rf lgraph_db .import_tmp
}
function restart {
stop
start
}
function reload {
remove
load
}
function reboot {
stop
reload && sleep 2 && start
}
# load or reload
$1
Binary file removed three_kingdoms/images/edges.png
Binary file not shown.
Binary file removed three_kingdoms/images/leader.png
Binary file not shown.
Binary file removed three_kingdoms/images/officer.png
Binary file not shown.
Binary file added three_kingdoms/images/schema.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed three_kingdoms/images/solider.png
Binary file not shown.
Binary file removed three_kingdoms/images/states.png
Binary file not shown.
Binary file removed three_kingdoms/images/war.png
Binary file not shown.
File renamed without changes.
File renamed without changes.
6 changes: 0 additions & 6 deletions three_kingdoms/run_import.sh

This file was deleted.

26 changes: 0 additions & 26 deletions three_kingdoms/run_query.sh

This file was deleted.

2 changes: 0 additions & 2 deletions three_kingdoms/run_server.sh

This file was deleted.

0 comments on commit f317b7c

Please sign in to comment.