Skip to content

Commit

Permalink
[#] add genome for upstream fetching
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhongFuze committed May 14, 2024
1 parent 29ed546 commit e67bc47
Show file tree
Hide file tree
Showing 4 changed files with 484 additions and 20 deletions.
34 changes: 17 additions & 17 deletions src/config/tdb/migrations/LoadingJob_SocialGraph.gsql
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ CREATE OR REPLACE QUERY find_expand_identity(STRING platform, STRING identity) F
SetAccum<Address> @owner_address;
SetAccum<Address> @resolve_address;

ListAccum<STRING> @@domainSystems = ["dotbit", "lens", "unstoppabledomains", "space_id", "crossbell", "ENS", "ens", "sns"];
ListAccum<STRING> @@domainSystems = ["dotbit", "lens", "unstoppabledomains", "space_id", "crossbell", "ENS", "ens", "sns", "genome"];
IF @@domainSystems.contains(platform) == TRUE THEN
tmp = SELECT domain FROM seed:domain-((<Hold_Identity):e)-Identities:owner
ACCUM domain.@owner_address += Address(owner.platform, owner.identity);
Expand Down Expand Up @@ -523,7 +523,7 @@ CREATE OR REPLACE QUERY find_identity_graph(STRING p, INT reverse_flag=0) FOR GR
POST-ACCUM @@minUpdateTime += MinUpdatedTimeTuple(tgt.updated_nanosecond, tgt.id);
graph_id = @@minUpdateTime.id;

ListAccum<STRING> @@domainSystems = ["dotbit", "lens", "unstoppabledomains", "space_id", "crossbell", "ENS", "ens", "sns"];
ListAccum<STRING> @@domainSystems = ["dotbit", "lens", "unstoppabledomains", "space_id", "crossbell", "ENS", "ens", "sns", "genome"];

IF reverse_flag == 1 THEN
vset = SELECT v FROM Identities:v-((PartOfIdentitiesGraph>):e)-identities_graph
Expand All @@ -534,21 +534,21 @@ CREATE OR REPLACE QUERY find_identity_graph(STRING p, INT reverse_flag=0) FOR GR
tmp2 = SELECT v1 FROM vset:v1-((<Proof_Forward|<Proof_Backward):e2)-vset:v2
ACCUM @@edges += IdentityConnection(v2, v1, e2.source, "Proof");
tmp4 = SELECT v1 FROM vset:v1-((Hold_Identity>):e1)-vset:i-((Resolve>):e2)-vset:v2
WHERE i.platform != "ENS" AND i.platform != "ens" AND i.platform != "sns"
WHERE i.platform != "genome" AND i.platform != "ens" AND i.platform != "sns"
ACCUM @@edges += IdentityConnection(v1, i, e1.source, "Hold"),
i.@owner_address += Address(v1.platform, v1.identity),
i.@resolve_address += Address(v2.platform, v2.identity);
tmp5 = SELECT v1 FROM vset:v1-((Hold_Identity>):e1)-vset:v2
WHERE v2.platform != "ENS" AND v2.platform != "ens" AND v2.platform != "sns"
WHERE v2.platform != "genome" AND v2.platform != "ens" AND v2.platform != "sns"
ACCUM @@edges += IdentityConnection(v1, v2, e1.source, "Hold"),
v2.@owner_address += Address(v1.platform, v1.identity);
tmp3 = SELECT v1 FROM vset:v1-((Resolve>):r)-vset:v2
WHERE v1.platform == "ENS" OR v1.platform == "ens" OR v1.platform != "sns"
WHERE v1.platform == "genome" OR v1.platform == "ens" OR v1.platform != "sns"
ACCUM
@@edges += IdentityConnection(v1, v2, r.source, "Resolve"),
v1.@resolve_address += Address(v2.platform, v2.identity);
tmp3_1 = SELECT v1 FROM vset:v1-((Hold_Identity>):e1)-vset:v2
WHERE v2.platform == "ENS" OR v2.platform == "ens" OR v2.platform == "sns"
WHERE v2.platform == "genome" OR v2.platform == "ens" OR v2.platform == "sns"
ACCUM v2.@owner_address += Address(v1.platform, v1.identity);

tmp6 = SELECT v1 FROM vset:v1-((Reverse_Resolve>):e1)-vset:v2
Expand All @@ -564,21 +564,21 @@ CREATE OR REPLACE QUERY find_identity_graph(STRING p, INT reverse_flag=0) FOR GR
tmp2 = SELECT v1 FROM vset:v1-((<Proof_Forward|<Proof_Backward):e2)-vset:v2
ACCUM @@edges += IdentityConnection(v2, v1, e2.source, "Proof");
tmp4 = SELECT v1 FROM vset:v1-((Hold_Identity>):e1)-vset:i-((Resolve>):e2)-vset:v2
WHERE i.platform != "ENS" AND i.platform != "ens" AND i.platform != "sns"
WHERE i.platform != "genome" AND i.platform != "ens" AND i.platform != "sns"
ACCUM @@edges += IdentityConnection(v1, i, e1.source, "Hold"),
i.@owner_address += Address(v1.platform, v1.identity),
i.@resolve_address += Address(v2.platform, v2.identity);
tmp5 = SELECT v1 FROM vset:v1-((Hold_Identity>):e1)-vset:v2
WHERE v2.platform != "ENS" AND v2.platform != "ens" AND v2.platform != "sns"
WHERE v2.platform != "genome" AND v2.platform != "ens" AND v2.platform != "sns"
ACCUM @@edges += IdentityConnection(v1, v2, e1.source, "Hold"),
v2.@owner_address += Address(v1.platform, v1.identity);
tmp3 = SELECT v1 FROM vset:v1-((Resolve>):r)-vset:v2
WHERE v1.platform == "ENS" OR v1.platform == "ens" OR v1.platform == "sns"
WHERE v1.platform == "genome" OR v1.platform == "ens" OR v1.platform == "sns"
ACCUM
@@edges += IdentityConnection(v1, v2, r.source, "Resolve"),
v1.@resolve_address += Address(v2.platform, v2.identity);
tmp3_1 = SELECT v1 FROM vset:v1-((Hold_Identity>):e1)-vset:v2
WHERE v2.platform == "ENS" OR v2.platform == "ens" OR v2.platform == "sns"
WHERE v2.platform == "genome" OR v2.platform == "ens" OR v2.platform == "sns"
ACCUM v2.@owner_address += Address(v1.platform, v1.identity);
tmp6 = SELECT v1 FROM vset:v1-((Reverse_Resolve>):e1)-vset:v2
ACCUM @@edges += IdentityConnection(v1, v2, e1.source, "Reverse_Resolve");
Expand All @@ -591,21 +591,21 @@ CREATE OR REPLACE QUERY find_identity_graph(STRING p, INT reverse_flag=0) FOR GR
tmp2 = SELECT v1 FROM vset:v1-((<Proof_Forward|<Proof_Backward):e2)-vset:v2
ACCUM @@edges += IdentityConnection(v2, v1, e2.source, "Proof");
tmp4 = SELECT v1 FROM vset:v1-((Hold_Identity>):e1)-vset:i-((Resolve>):e2)-vset:v2
WHERE i.platform != "ENS" AND i.platform != "ens" AND i.platform != "sns"
WHERE i.platform != "genome" AND i.platform != "ens" AND i.platform != "sns"
ACCUM @@edges += IdentityConnection(v1, i, e1.source, "Hold"),
i.@owner_address += Address(v1.platform, v1.identity),
i.@resolve_address += Address(v2.platform, v2.identity);
tmp5 = SELECT v1 FROM vset:v1-((Hold_Identity>):e1)-vset:v2
WHERE v2.platform != "ENS" AND v2.platform != "ens" AND v2.platform != "sns"
WHERE v2.platform != "genome" AND v2.platform != "ens" AND v2.platform != "sns"
ACCUM @@edges += IdentityConnection(v1, v2, e1.source, "Hold"),
v2.@owner_address += Address(v1.platform, v1.identity);
tmp3 = SELECT v1 FROM vset:v1-((Resolve>):r)-vset:v2
WHERE v1.platform == "ENS" OR v1.platform == "ens" OR v1.platform == "sns"
WHERE v1.platform == "genome" OR v1.platform == "ens" OR v1.platform == "sns"
ACCUM
@@edges += IdentityConnection(v1, v2, r.source, "Resolve"),
v1.@resolve_address += Address(v2.platform, v2.identity);
tmp3_1 = SELECT v1 FROM vset:v1-((Hold_Identity>):e1)-vset:v2
WHERE v2.platform == "ENS" OR v2.platform == "ens" OR v2.platform == "sns"
WHERE v2.platform == "genome" OR v2.platform == "ens" OR v2.platform == "sns"
ACCUM v2.@owner_address += Address(v1.platform, v1.identity);

tmp6 = SELECT v1 FROM vset:v1-((Reverse_Resolve>):e1)-vset:v2
Expand All @@ -628,7 +628,7 @@ CREATE OR REPLACE QUERY neighbors(VERTEX<Identities> p, INT depth) FOR GRAPH Soc
ACCUM v.@visited = TRUE, @@edges += pf, @@edges += pw
POST-ACCUM @@vertices += v, @@pool += v;
hold = SELECT v FROM seed-((Hold_Identity>|<Hold_Identity):e)-Identities:v
WHERE v.@visited2 == FALSE AND v.platform != "ENS" AND v.platform != "ens" AND v.platform != "sns"
WHERE v.@visited2 == FALSE AND v.platform != "genome" AND v.platform != "ens" AND v.platform != "sns"
ACCUM v.@visited2 = TRUE, @@edges += e
POST-ACCUM @@vertices += v, @@pool += v;
seed (Identities) = {@@pool};
Expand All @@ -645,7 +645,7 @@ CREATE OR REPLACE QUERY neighbors_with_source_reverse(VERTEX<Identities> p, INT
SetAccum<STRING> @source_list;
SetAccum<EDGE> @@edge_set;
SetAccum<VERTEX<Identities>> @@vertices;
ListAccum<STRING> @@domainSystems = ["dotbit", "lens", "unstoppabledomains", "space_id", "crossbell", "ENS", "ens", "sns"];
ListAccum<STRING> @@domainSystems = ["dotbit", "lens", "unstoppabledomains", "space_id", "crossbell", "ENS", "ens", "sns", "genome"];

##### Initialization #####
seed (Identities) = {p};
Expand Down Expand Up @@ -695,7 +695,7 @@ CREATE OR REPLACE QUERY neighbors_with_source_reverse(VERTEX<Identities> p, INT
ACCUM start.@reverse += true;

address2 = SELECT addr FROM ResultSet:addr-((Reverse_Resolve_Contract>):r)-Contracts:c
WHERE r.system == "ENS" OR r.system == "ens" OR r.system == "sns"
WHERE r.system == "genome" OR r.system == "ens" OR r.system == "sns"
ACCUM addr.@reverse += true;

IF reverse_flag == 0 THEN
Expand Down
Loading

0 comments on commit e67bc47

Please sign in to comment.