Skip to content

Commit

Permalink
fix directed/undirected check in coordinator
Browse files Browse the repository at this point in the history
Signed-off-by: Lei Wang <jiede.wl@alibaba-inc.com>
  • Loading branch information
doudoubobo committed Oct 18, 2024
1 parent a66aa55 commit 7eb11f9
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 40 deletions.
76 changes: 39 additions & 37 deletions apps/rdbms/insert_db_txn.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,79 +455,81 @@ def process_forum(line):
total_timer = Timer()
total_timer.start()

insert_vertices("01", "/organisation_0_0.csv", "organisation", process_organisation)
if True:
insert_vertices("01", "/organisation_0_0.csv", "organisation", process_organisation)

insert_vertices("02", "/place_0_0.csv", "place", process_place)
insert_vertices("02", "/place_0_0.csv", "place", process_place)

insert_vertices("03", "/tag_0_0.csv", "tag", process_tag)
insert_vertices("03", "/tag_0_0.csv", "tag", process_tag)

insert_vertices("04", "/tagclass_0_0.csv", "tagclass", process_tagclass)
insert_vertices("04", "/tagclass_0_0.csv", "tagclass", process_tagclass)

insert_vertices("05", "/person_0_0.csv", "person", process_person)
insert_vertices("05", "/person_0_0.csv", "person", process_person)

insert_vertices("06", "/comment_0_0.csv", "comment", process_comment)
insert_vertices("06", "/comment_0_0.csv", "comment", process_comment)

insert_vertices("07", "/post_0_0.csv", "post", process_post)
insert_vertices("07", "/post_0_0.csv", "post", process_post)

insert_vertices("08", "/forum_0_0.csv", "forum", process_forum)
insert_vertices("08", "/forum_0_0.csv", "forum", process_forum)

for process in vertex_process:
process.join()
for process in vertex_process:
process.join()

total_timer.end()
print("Load vertex time: {:.2f} {}".format(total_timer.total(), total_timer.unit()))
total_timer.end()
print("Load vertex time: {:.2f} {}".format(total_timer.total(), total_timer.unit()))

# insert edge tables without additional properties
# insert edge tables without additional properties


insert_simple_edges("09", "/organisation_isLocatedIn_place_0_0.csv", "org_islocationin")
insert_simple_edges("09", "/organisation_isLocatedIn_place_0_0.csv", "org_islocationin")

insert_simple_edges("10", "/place_isPartOf_place_0_0.csv", "ispartof")
insert_simple_edges("10", "/place_isPartOf_place_0_0.csv", "ispartof")

insert_simple_edges("11", "/tagclass_isSubclassOf_tagclass_0_0.csv", "issubclassof")
insert_simple_edges("11", "/tagclass_isSubclassOf_tagclass_0_0.csv", "issubclassof")

insert_simple_edges("12", "/tag_hasType_tagclass_0_0.csv", "hastype")
insert_simple_edges("12", "/tag_hasType_tagclass_0_0.csv", "hastype")

insert_simple_edges("13", "/comment_hasCreator_person_0_0.csv", "comment_hascreator")
insert_simple_edges("13", "/comment_hasCreator_person_0_0.csv", "comment_hascreator")

insert_simple_edges("14", "/comment_hasTag_tag_0_0.csv", "comment_hastag")
insert_simple_edges("14", "/comment_hasTag_tag_0_0.csv", "comment_hastag")

insert_simple_edges("15", "/comment_isLocatedIn_place_0_0.csv", "comment_islocationin")
insert_simple_edges("15", "/comment_isLocatedIn_place_0_0.csv", "comment_islocationin")

insert_simple_edges("16", "/comment_replyOf_comment_0_0.csv", "replyof_comment")
insert_simple_edges("16", "/comment_replyOf_comment_0_0.csv", "replyof_comment")

insert_simple_edges("17", "/comment_replyOf_post_0_0.csv", "replyof_post")
insert_simple_edges("17", "/comment_replyOf_post_0_0.csv", "replyof_post")

insert_simple_edges("18", "/post_hasCreator_person_0_0.csv", "post_hascreator")
insert_simple_edges("18", "/post_hasCreator_person_0_0.csv", "post_hascreator")

insert_simple_edges("19", "/post_hasTag_tag_0_0.csv", "post_hastag")
insert_simple_edges("19", "/post_hasTag_tag_0_0.csv", "post_hastag")

insert_simple_edges("20", "/post_isLocatedIn_place_0_0.csv", "post_islocationin")
insert_simple_edges("20", "/post_isLocatedIn_place_0_0.csv", "post_islocationin")

insert_simple_edges("21", "/forum_containerOf_post_0_0.csv", "forum_containerof")
insert_simple_edges("21", "/forum_containerOf_post_0_0.csv", "forum_containerof")

insert_simple_edges("22", "/forum_hasModerator_person_0_0.csv", "forum_hasmoderator")
insert_simple_edges("22", "/forum_hasModerator_person_0_0.csv", "forum_hasmoderator")

insert_simple_edges("23", "/forum_hasTag_tag_0_0.csv", "forum_hastag")
insert_simple_edges("23", "/forum_hasTag_tag_0_0.csv", "forum_hastag")

insert_simple_edges("24", "/person_hasInterest_tag_0_0.csv", "person_hasinterest")
if True:
insert_simple_edges("24", "/person_hasInterest_tag_0_0.csv", "person_hasinterest")

insert_simple_edges("25", "/person_isLocatedIn_place_0_0.csv", "person_islocationin")
insert_simple_edges("25", "/person_isLocatedIn_place_0_0.csv", "person_islocationin")

# insert edge tables with additional properties
# insert edge tables with additional properties


insert_prop_edges("26", "/forum_hasMember_person_0_0.csv", "forum_hasmember")
insert_prop_edges("26", "/forum_hasMember_person_0_0.csv", "forum_hasmember")

insert_prop_edges("27", "/person_knows_person_0_0.csv", "knows")
insert_prop_edges("27", "/person_knows_person_0_0.csv", "knows")

insert_prop_edges("28", "/person_likes_comment_0_0.csv", "likes_comment")
insert_prop_edges("28", "/person_likes_comment_0_0.csv", "likes_comment")

insert_prop_edges("29", "/person_likes_post_0_0.csv", "likes_post")
insert_prop_edges("29", "/person_likes_post_0_0.csv", "likes_post")

insert_prop_edges("30", "/person_studyAt_organisation_0_0.csv", "studyat")
insert_prop_edges("30", "/person_studyAt_organisation_0_0.csv", "studyat")

insert_prop_edges("31", "/person_workAt_organisation_0_0.csv", "workat")
insert_prop_edges("31", "/person_workAt_organisation_0_0.csv", "workat")

for process in edge_process:
process.join()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def get_deployment_info(): # noqa: E501
result_dict["creation_time"] = f.read()
result_dict["instance_name"] = "gart"
result_dict["frontend"] = "Cypher/Gremlin"
result_dict["engine"] = "Gaia"
result_dict["engine"] = "gart"
result_dict["storage"] = "MutableCSR"
result_dict["version"] = "0.1.0"
return (RunningDeploymentInfo.from_dict(result_dict), 200)
Expand Down
2 changes: 1 addition & 1 deletion coordinator/flex/server/controllers/graph_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def get_graph_schema():
# FIXME: hard code to MANY_TO_MANY
vertex_type_pair_relation["relation"] = "MANY_TO_MANY"
edge_type_dict["vertex_type_pair_relations"] = [vertex_type_pair_relation]
edge_type_dict["directed"] = not edge_types[idx]["type_pair"].get(
edge_type_dict["directed"] = not edge_types[idx].get(
"undirected", False
)
properties_array = []
Expand Down
2 changes: 1 addition & 1 deletion coordinator/flex/server/models/running_deployment_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def engine(self, engine: str):
:param engine: The engine of this RunningDeploymentInfo.
:type engine: str
"""
allowed_values = ["Hiactor", "Gaia"] # noqa: E501
allowed_values = ["Hiactor", "Gaia", "gart"] # noqa: E501
if engine not in allowed_values:
raise ValueError(
"Invalid value for `engine` ({0}), must be one of {1}"
Expand Down
1 change: 1 addition & 0 deletions coordinator/flex/server/openapi/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2299,6 +2299,7 @@ components:
enum:
- Hiactor
- Gaia
- gart
title: engine
type: string
storage:
Expand Down

0 comments on commit 7eb11f9

Please sign in to comment.