Skip to content

Commit

Permalink
feat(interactive): Introduce new version of graph_algo example graph (#…
Browse files Browse the repository at this point in the history
…4153)

Update the raw data and graph definition of `graph_algo`.

- [x] Keep the old graph_alg graph. 
- [x] Move the csv files to gstest?

---------

Co-authored-by: liulx20 <liulexiao.llx@alibaba-inc.com>
  • Loading branch information
zhanglei1949 and liulx20 authored Sep 18, 2024
1 parent 627092e commit c7df2ca
Show file tree
Hide file tree
Showing 6 changed files with 405 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/interactive.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ jobs:
mkdir -p ${INTERACTIVE_WORKSPACE}/data/graph_algo
cp ${GITHUB_WORKSPACE}/flex/tests/interactive/graph_algo_test.yaml ${INTERACTIVE_WORKSPACE}/data/graph_algo/graph.yaml
cp ${GITHUB_WORKSPACE}/flex/interactive/examples/graph_algo/import.yaml ${INTERACTIVE_WORKSPACE}/data/graph_algo/import.yaml
mkdir -p ${INTERACTIVE_WORKSPACE}/data/new_graph_algo
cp ${GITHUB_WORKSPACE}/flex/interactive/examples/new_graph_algo/graph.yaml ${INTERACTIVE_WORKSPACE}/data/new_graph_algo/graph.yaml
cp ${GITHUB_WORKSPACE}/flex/interactive/examples/new_graph_algo/import.yaml ${INTERACTIVE_WORKSPACE}/data/new_graph_algo/import.yaml
mkdir -p ${INTERACTIVE_WORKSPACE}/data/modern_graph
cp ${GITHUB_WORKSPACE}/flex/interactive/examples/modern_graph/graph.yaml ${INTERACTIVE_WORKSPACE}/data/modern_graph/graph.yaml
Expand All @@ -113,6 +116,8 @@ jobs:
GLOG_v=10 ./bin/bulk_loader -g ${INTERACTIVE_WORKSPACE}/data/movies/graph.yaml -l ${INTERACTIVE_WORKSPACE}/data/movies/import.yaml -d ${INTERACTIVE_WORKSPACE}/data/movies/indices/
export FLEX_DATA_DIR=../interactive/examples/graph_algo
GLOG_v=10 ./bin/bulk_loader -g ${INTERACTIVE_WORKSPACE}/data/graph_algo/graph.yaml -l ${INTERACTIVE_WORKSPACE}/data/graph_algo/import.yaml -d ${INTERACTIVE_WORKSPACE}/data/graph_algo/indices/
export FLEX_DATA_DIR=${GS_TEST_DIR}/flex/new_graph_algo
GLOG_v=10 ./bin/bulk_loader -g ${INTERACTIVE_WORKSPACE}/data/new_graph_algo/graph.yaml -l ${INTERACTIVE_WORKSPACE}/data/new_graph_algo/import.yaml -d ${INTERACTIVE_WORKSPACE}/data/new_graph_algo/indices/
export FLEX_DATA_DIR=../interactive/examples/modern_graph
GLOG_v=10 ./bin/bulk_loader -g ${INTERACTIVE_WORKSPACE}/data/modern_graph/graph.yaml -l ../interactive/examples/modern_graph/bulk_load.yaml -d ${INTERACTIVE_WORKSPACE}/data/modern_graph/indices/
Expand Down
6 changes: 3 additions & 3 deletions flex/bin/load_plan_and_gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -368,19 +368,19 @@ compile_hqps_so() {

################### now copy ##########################
# if dst_so_path eq output_so_path, skip copying.
if [ ${dst_so_path} == ${output_so_path} ]; then
if [[ ${dst_so_path} == ${output_so_path} ]]; then
info "Output dir is same as work dir, skip copying."
exit 0
fi
# copy output to output_dir
if [ ! -z ${output_dir} ]; then
if [[ ! -z ${output_dir} ]]; then
mkdir -p ${output_dir}
else
info "Output dir not set, skip copying."
exit 0
fi
# check output_dir doesn't contains output_so_name
if [ -f ${dst_so_path} ]; then
if [[ -f ${dst_so_path} ]]; then
emph "Output dir ${output_dir} already contains ${procedure_name}.so,overriding it."
fi
cp ${output_so_path} ${output_dir}
Expand Down
6 changes: 6 additions & 0 deletions flex/interactive/examples/new_graph_algo/1.cypher
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
MATCH (p: Paper)-[:WorkOn]->(t:Task),
(p)-[:Has]->(c:Challenge)-[:SolvedBy]->(s:Solution),
(p)-[:Use]->(s:Solution)
WHERE t.name = "Distributed Subgraph Matching Efficiency"
WITH t, c, count(p) AS num
RETURN t.name, c.name, num
13 changes: 13 additions & 0 deletions flex/interactive/examples/new_graph_algo/2.cypher
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
MATCH (p1:Paper)<-[:Cite]-(p2:Paper)<-[:Cite]-(p3:Paper),
(p1)-[:Has]->(c)-[:SolvedBy]->(s1:Solution)
WHERE c.name = "Optimizing Load Balance in Distributed Systems" and p1.title = "Parallel Subgraph Listing in a Large-Scale Graph"
WITH p1.title AS paper1, p2, p3, c, collect(s1.description) AS solutions1
MATCH (p2)-[:Has]->(c)-[:SolvedBy]->(s2:Solution),
(p2)-[:Use]->(s2)
WHERE p2.title = "Scalable distributed subgraph enumeration"
WITH paper1, p2.title AS paper2, p3, c, solutions1, collect(s2.description) AS solutions2
MATCH (p3)-[:Has]->(c)-[:SolvedBy]->(s3:Solution),
(p3)-[:Use]->(s3)
WHERE p3.title = "HUGE: An Efficient and Scalable Subgraph Enumeration System"
WITH paper1, paper2, p3.title as paper3, c.name as challenge, solutions1, solutions2, collect(s3.description) as solutions3
RETURN paper1, paper2, paper3, challenge, solutions1, solutions2, solutions3
168 changes: 168 additions & 0 deletions flex/interactive/examples/new_graph_algo/graph.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
name: graph_algo
version: v0.1
schema:
vertex_types:
- type_id: 0
type_name: Challenge
properties:
- property_id: 0
property_name: id
property_type:
string:
long_text: ''
- property_id: 1
property_name: name
property_type:
string:
long_text: ''
- property_id: 2
property_name: description
property_type:
string:
long_text: ''
primary_keys:
- id
- type_id: 1
type_name: Task
properties:
- property_id: 0
property_name: id
property_type:
string:
long_text: ''
- property_id: 1
property_name: name
property_type:
string:
long_text: ''
- property_id: 2
property_name: description
property_type:
string:
long_text: ''
primary_keys:
- id
- type_id: 2
type_name: Solution
properties:
- property_id: 0
property_name: id
property_type:
string:
long_text: ''
- property_id: 1
property_name: name
property_type:
string:
long_text: ''
- property_id: 2
property_name: description
property_type:
string:
long_text: ''
primary_keys:
- id
- type_id: 3
type_name: Paper
properties:
- property_id: 0
property_name: id
property_type:
string:
long_text: ''
- property_id: 1
property_name: published
property_type:
string:
long_text: ''
- property_id: 2
property_name: year
property_type:
primitive_type: DT_SIGNED_INT32
- property_id: 3
property_name: month
property_type:
primitive_type: DT_SIGNED_INT32
- property_id: 4
property_name: title
property_type:
string:
long_text: ''
- property_id: 5
property_name: authors
property_type:
string:
long_text: ''
- property_id: 6
property_name: summary
property_type:
string:
long_text: ''
- property_id: 7
property_name: journal_ref
property_type:
string:
long_text: ''
- property_id: 8
property_name: doi
property_type:
string:
long_text: ''
- property_id: 9
property_name: primary_category
property_type:
string:
long_text: ''
- property_id: 10
property_name: categories
property_type:
string:
long_text: ''
- property_id: 11
property_name: problem_def
property_type:
string:
long_text: ''
- property_id: 12
property_name: keywords
property_type:
string:
long_text: ''
primary_keys:
- id
edge_types:
- type_id: 0
type_name: SolvedBy
properties: []
vertex_type_pair_relations:
- destination_vertex: Solution
relation: MANY_TO_MANY
source_vertex: Challenge
- type_id: 1
type_name: Cite
properties: []
vertex_type_pair_relations:
- destination_vertex: Paper
relation: MANY_TO_MANY
source_vertex: Paper
- type_id: 2
type_name: Has
properties: []
vertex_type_pair_relations:
- destination_vertex: Challenge
relation: MANY_TO_MANY
source_vertex: Paper
- type_id: 3
type_name: WorkOn
properties: []
vertex_type_pair_relations:
- destination_vertex: Task
relation: MANY_TO_MANY
source_vertex: Paper
- type_id: 4
type_name: Use
properties: []
vertex_type_pair_relations:
- destination_vertex: Solution
relation: MANY_TO_MANY
source_vertex: Paper
Loading

0 comments on commit c7df2ca

Please sign in to comment.