diff --git a/agile_operations/supply_chain_management/meta/Insights_Supply_Chain.json b/agile_operations/supply_chain_management/meta/Insights_Supply_Chain.json index 955d55df..73a13827 100644 --- a/agile_operations/supply_chain_management/meta/Insights_Supply_Chain.json +++ b/agile_operations/supply_chain_management/meta/Insights_Supply_Chain.json @@ -441,7 +441,7 @@ } ] }, - "graphName": "AntiFraud", + "graphName": "Supply_Chain_Management", "hideWidgetName": false, "id": "jiFArchKghkbBhGC4d548q", "patternLimit": 5, @@ -853,7 +853,7 @@ } ] }, - "graphName": "AntiFraud", + "graphName": "Supply_Chain_Management", "hideWidgetName": false, "id": "7GwzFLnQ5dDDVtUtVx7mPv", "patternLimit": 5, @@ -1041,7 +1041,7 @@ "id": "input_35dZipma5w14zcPa9srhP7", "name": "vertType", "settings": { - "graphName": "AntiFraud", + "graphName": "Supply_Chain_Management", "open": false, "options": [ { @@ -1111,7 +1111,7 @@ } ] }, - "graphName": "AntiFraud", + "graphName": "Supply_Chain_Management", "hideWidgetName": false, "id": "wGYxHtNz9dmfUBHvh8vi8a", "patternLimit": 5, diff --git a/agile_operations/supply_chain_management/queries/explore_BOM_insights.gsql b/agile_operations/supply_chain_management/queries/explore_BOM_insights.gsql new file mode 100644 index 00000000..bc2d874a --- /dev/null +++ b/agile_operations/supply_chain_management/queries/explore_BOM_insights.gsql @@ -0,0 +1,60 @@ +CREATE OR REPLACE DISTRIBUTED QUERY explore_BOM_insights(STRING vertType,STRING id, INT depth, BOOL upstream) FOR GRAPH Supply_Chain_Management { + /* + Query Name: explore_BOM_insights + Multi-level BOM exploration (downstream) or where-used analysis (upstream) + starting from a vertex identified by (vertType, id). + + Key Use Cases: + . Explode a material/BOM into its components and related suppliers (downstream) + . Reverse trace: find BOMs/material relationships and supply paths (upstream) + . Useful for impact analysis, sourcing visibility, and BOM troubleshooting. + + Parameters: + vertType (STRING): + Vertex type name of the starting vertex (e.g., Material, BOM, Supplier) + id (STRING): + Primary/external ID of the starting vertex (converted via to_vertex(id, vertType)) + depth (INT): + Maximum traversal depth + upstream (BOOL): + TRUE -> Where-used / reverse trace + FALSE -> BOM explosion / forward trace + + Output: + Prints the traversed edge set (@@edges) and vertex set (@@nodes). + */ + SetAccum @@edges; + SetAccum @@nodes; + OrAccum @visited; + OrAccum @isSrc; + vertex vertss; + vertss = to_vertex(id,vertType); + // get src + verts = {vertss}; + verts = select s from verts:s ACCUM s.@isSrc += TRUE,@@nodes += s; + + // while loop + WHILE verts.size() > 0 LIMIT depth DO + // traverse up or down + IF upstream == TRUE THEN + verts = + SELECT t FROM verts:s -((Supplies|reverse_Has_Component_Material|reverse_Produced_By):e)- (Material|BOM):t + WHERE t.@visited == FALSE + ACCUM @@edges += e,@@nodes += t + POST-ACCUM + s.@visited = TRUE; + ELSE + verts = + SELECT t FROM verts:s -((reverse_Supplies|Has_Component_Material|Produced_By):e)- (Material|BOM|Supplier):t + WHERE t.@visited == FALSE + ACCUM @@edges += e,@@nodes += t + POST-ACCUM + s.@visited = TRUE; + END; + END; + + // print edges + PRINT @@edges; + nodes = {@@nodes}; + PRINT nodes; +} diff --git a/agile_operations/supply_chain_management/queries/explore_BOM_line_Insights.gsql b/agile_operations/supply_chain_management/queries/explore_BOM_line_Insights.gsql new file mode 100644 index 00000000..5e3b98b8 --- /dev/null +++ b/agile_operations/supply_chain_management/queries/explore_BOM_line_Insights.gsql @@ -0,0 +1,76 @@ +CREATE OR REPLACE DISTRIBUTED QUERY explore_BOM_line_Insights(STRING vertType,STRING id, INT depth, BOOL upstream, BOOL use_date_range, DATETIME start_date, DATETIME end_date) FOR GRAPH Supply_Chain_Management { + /* + Description: + End-to-end transactional lineage traversal (order-to-cash & procure-to-pay) + across actual production instances (SFC), sales orders, purchase orders, + shipments, and customers/suppliers. + + This is the "digital thread" query — it connects the physical flow + (what was actually built and shipped) with the commercial flow + (who ordered it and who supplied the components). + + Parameters: + vertType (STRING): + Vertex type name of the starting vertex — typically SFC_Material (actual batch), + Sales_Order, Purchase_Order, Customer, or Supplier + id (STRING): + Primary/external ID of the starting vertex (paired with vertType and converted + to a vertex via to_vertex(id, vertType)) + depth (INT): + Maximum traversal depth + upstream (BOOL): + FALSE → Follow the flow downstream + TRUE → Follow the flow upstream + use_date_range (BOOL): + If TRUE, only traverse through dated vertices (Sales_Order, Purchase_Order, + SFC_Assembly) that fall within the specified window + start_date / end_date (DATETIME): + Optional time fence for filtering transactional vertices + + */ + SetAccum @@nodes; + OrAccum @isSrc; + vertex vertss; + vertss = to_vertex(id,vertType); + // get src + verts = {vertss}; + verts = select s from verts:s ACCUM s.@isSrc += TRUE,@@nodes += s; + + SetAccum @@edges; + OrAccum @visited; + + + // while loop + WHILE verts.size() > 0 LIMIT depth DO + // traverse up or down + IF upstream == TRUE THEN + verts = + SELECT t FROM verts:s -((Has_Purchase_Order|Has_Line_Number|reverse_Used_For| + reverse_Has_Component_SFC|reverse_To_Be_Produced_By|reverse_For_Material| + reverse_Has_Sales_Order_Item|reverse_Has_Sales_Order):e)- + (Purchase_Order|Line_Number|SFC_Material|SFC_Assembly|Sales_Order_Item|Sales_Order|Customer):t + WHERE t.@visited == FALSE + // relevant vertices in date range (SFC_Assembly,Sales_Order,Purchase_Order) + ACCUM @@edges += e,@@nodes += t + POST-ACCUM + s.@visited = TRUE; + ELSE + verts = + SELECT t FROM verts:s -((reverse_Has_Purchase_Order|reverse_Has_Line_Number|Used_For| + Has_Component_SFC|To_Be_Produced_By|For_Material| + Has_Sales_Order_Item|Has_Sales_Order):e)- + (Supplier|Purchase_Order|Line_Number|SFC_Material|SFC_Assembly|Sales_Order_Item|Sales_Order):t + WHERE t.@visited == FALSE + // relevant vertices in date range (SFC_Assembly,Sales_Order,Purchase_Order) + ACCUM @@edges += e,@@nodes += t + POST-ACCUM + s.@visited = TRUE; + END;//Based_On,reverse_Based_On,Happens_At,reverse_Happens_At,Produced_By,reverse_Produced_By,Has_Component_Material,reverse_Has_Component_Material,SFC_To_Material,reverse_SFC_To_Material,Supplies,reverse_Supplies,Has,reverse_Has + END; + + // print edges + PRINT @@edges; + nodes = {@@nodes}; + PRINT nodes; + PRINT "explore_BOMLine works!"; +} diff --git a/financial_crime/entity_resolution_kyc/README.md b/financial_crime/entity_resolution_kyc/README.md index 3e2c96c3..99c4601f 100644 --- a/financial_crime/entity_resolution_kyc/README.md +++ b/financial_crime/entity_resolution_kyc/README.md @@ -4,6 +4,7 @@ and Know Your Customer (KYC) compliance. It enables the creation of a Single Cus View (SCV) by linking scattered records through weighted attribute matching, detecting fraud rings in real-time, and generating powerful graph features for downstream machine learning models. + --- ## Contents diff --git a/financial_crime/entity_resolution_kyc/meta/Insights_Application_Entity_Resolution_kyc.json b/financial_crime/entity_resolution_kyc/meta/Insights_Application_Entity_Resolution_kyc.json index c1740344..f2167dce 100644 --- a/financial_crime/entity_resolution_kyc/meta/Insights_Application_Entity_Resolution_kyc.json +++ b/financial_crime/entity_resolution_kyc/meta/Insights_Application_Entity_Resolution_kyc.json @@ -1,5 +1,5 @@ { - "defaultGraph": "AntiFraud", + "defaultGraph": "Entity_Resolution_KYC", "iconURL": "/insights/static/media/atom.14f5dd297b1a450cae3413a44f69a75b.svg", "id": "arDCiwHPNbgkqU51x1tBNY", "pageConfigSeparated": true, @@ -334,7 +334,7 @@ } ] }, - "graphName": "AntiFraud", + "graphName": "Entity_Resolution_KYC", "hideWidgetName": false, "id": "pWVjbPx54GYQyYYTHe8Qpj", "patternLimit": 5, diff --git a/financial_crime/mule_account_detection/meta/Insights_mule_analytics.json b/financial_crime/mule_account_detection/meta/Insights_mule_analytics.json index 94a7dfc5..eada1dd7 100644 --- a/financial_crime/mule_account_detection/meta/Insights_mule_analytics.json +++ b/financial_crime/mule_account_detection/meta/Insights_mule_analytics.json @@ -1,12 +1,12 @@ { "defaultGraph": "Mule_Account_Detection", "iconURL": "/studio/assets/gvis/icons/builtin/64/285-asset.png", - "id": "fHvaU5uuocyNTvLK1hvnhZ", + "id": "nm7u6Gfy5RyCjFn5a4XXvX", "owner": "tigergraph", "pageConfigSeparated": true, "title": "Mule Account Detection", "userRoleForApp": "owner", - "version": "1718182992759391308", + "version": "1772468490523977939", "pages": [ { "globalParameters": { @@ -56,7 +56,7 @@ ] }, "title": "Device Conflicts", - "version": "1718182992772794626", + "version": "1772468490536218944", "weight": 65, "chartMap": { "bRkhvjVhY1TWQcogdN5qWX": { @@ -156,7 +156,7 @@ "staticData": "{}", "title": "Device Sharing Table", "type": "table", - "version": "1718182992806038828" + "version": "1772468490570044181" }, "bsGHYaUbye71mmcqUw73hu": { "chartSettings": { @@ -193,7 +193,7 @@ "staticData": "{}", "title": "Device Sharing Graph", "type": "internal-graph", - "version": "1718182992813412007" + "version": "1772468490577999522" }, "eQZKGCXHQALSLsewAjs1ea": { "chartSettings": { @@ -220,7 +220,7 @@ "staticData": "{}", "title": "Input Account", "type": "Inputs", - "version": "1718182992819392426" + "version": "1772468490584087918" } } }, @@ -298,7 +298,7 @@ ] }, "title": "Account_Network_Pagerank", - "version": "1718182992778659189", + "version": "1772468490542439646", "weight": 20, "chartMap": { "4QYhdJVbfoeUnGjAzhi5sG": { @@ -359,7 +359,7 @@ "staticData": "{}", "title": "Top Pagerank Score Account", "type": "table", - "version": "1718182992825778629" + "version": "1772468490589993580" }, "d3UvsqzXpUWp8BroNYLgqM": { "chartSettings": { @@ -389,7 +389,7 @@ "staticData": "{}", "title": "Input", "type": "Inputs", - "version": "1718182992833516058" + "version": "1772468490595807693" }, "nLdSm9KfPcJrmCcdi8Y1gW": { "chartSettings": {}, @@ -403,7 +403,7 @@ "staticData": "{}", "title": "Account Network Pagerank", "type": "internal-graph", - "version": "1718182992840084316" + "version": "1772468490603726226" } } }, @@ -452,7 +452,7 @@ ] }, "title": "WCC Community", - "version": "1718182992784492285", + "version": "1772468490551008026", "weight": 35, "chartMap": { "jkio2L3Um2ufCJ7gkybBWw": { @@ -529,7 +529,7 @@ "staticData": "{}", "title": "WCC Table", "type": "table", - "version": "1718182992846644161" + "version": "1772468490609449424" }, "rVesAEnUrQfHxr86YV2rfy": { "chartSettings": {}, @@ -543,7 +543,7 @@ "staticData": "{}", "title": "Communities", "type": "internal-graph", - "version": "1718182992853827816" + "version": "1772468490615273082" }, "xsBfPK3EJ6n4J9gZMoxdhs": { "chartSettings": { @@ -573,11 +573,60 @@ "staticData": "{}", "title": "Input", "type": "Inputs", - "version": "1718182992859656801" + "version": "1772468490624413433" } } }, { + "globalParameters": { + "account": { + "id": "input_4bVYZSdcBZcMkXxvqLiAfC", + "name": "account", + "type": "VERTEX", + "value": { + "vertexID": "0448743965", + "vertexType": "Account" + } + } + }, + "iconURL": "/studio/assets/gvis/icons/builtin/64/052-cells.png", + "id": "sXcEF1LsFkipMZXidn8WoX", + "isDetail": true, + "isNew": false, + "layouts": { + "md": [ + { + "h": 45, + "i": "eGUYb6o4Lf5YaTokas5xi8", + "moved": false, + "static": false, + "w": 6, + "x": 0, + "y": 0 + }, + { + "h": 35, + "i": "m4XfGCnug9rZ6zMXUX8eth", + "moved": false, + "static": false, + "w": 6, + "x": 6, + "y": 10 + }, + { + "h": 10, + "i": "umcMFXKpivgT6ftHb3sf2R", + "moved": false, + "static": false, + "w": 6, + "x": 6, + "y": 0 + } + ] + }, + "title": "Shortest Path", + "version": "1772468490556807422", + "weight": 45, "chartMap": { "eGUYb6o4Lf5YaTokas5xi8": { "chartSettings": { @@ -618,28 +667,19 @@ }, { "data": "account", - "id": "87a48d71-cdd3-4317-91e9-512550c26af6", + "id": "ac6681b5-e84c-4694-8960-c1da25d2f256", "paramGlobalInput": "account", "paramName": "ver", "paramType": "VERTEX", "paramTypeReadonly": true, "type": "PARAM", "vertexType": "Account" - }, - { - "data": "number_paths", - "id": "f4ee8d07-3306-4f4c-8e03-ce502c62e0e4", - "paramGlobalInput": "number_paths", - "paramName": "print_number", - "paramType": "INT", - "paramTypeReadonly": true, - "type": "PARAM" } ], "staticData": "{}", "title": "shortest path", "type": "internal-graph", - "version": "1718226734254095335" + "version": "1772600035200321987" }, "m4XfGCnug9rZ6zMXUX8eth": { "chartSettings": { @@ -791,28 +831,19 @@ }, { "data": "account", - "id": "a8d8e336-d857-41b0-ab62-f87252703050", + "id": "f1427c4b-90db-4498-a62d-b37bb466db93", "paramGlobalInput": "account", "paramName": "ver", "paramType": "VERTEX", "paramTypeReadonly": true, "type": "PARAM", "vertexType": "Account" - }, - { - "data": "number_paths", - "id": "18491db9-f7a0-4546-a30f-45dbcc86e868", - "paramGlobalInput": "number_paths", - "paramName": "print_number", - "paramType": "INT", - "paramTypeReadonly": true, - "type": "PARAM" } ], "staticData": "{}", "title": "Shortest Path Table", "type": "table", - "version": "1718227114441036065" + "version": "1772600048009176957" }, "umcMFXKpivgT6ftHb3sf2R": { "chartSettings": { @@ -838,58 +869,9 @@ "staticData": "{}", "title": "Input", "type": "Inputs", - "version": "1718227489486288049" - } - }, - "globalParameters": { - "account": { - "id": "input_4bVYZSdcBZcMkXxvqLiAfC", - "name": "account", - "type": "VERTEX", - "value": { - "vertexID": "0448743965", - "vertexType": "Account" - } + "version": "1772468490644947116" } - }, - "iconURL": "/studio/assets/gvis/icons/builtin/64/052-cells.png", - "id": "sXcEF1LsFkipMZXidn8WoX", - "isDetail": true, - "isNew": false, - "layouts": { - "md": [ - { - "h": 45, - "i": "eGUYb6o4Lf5YaTokas5xi8", - "moved": false, - "static": false, - "w": 6, - "x": 0, - "y": 0 - }, - { - "h": 35, - "i": "m4XfGCnug9rZ6zMXUX8eth", - "moved": false, - "static": false, - "w": 6, - "x": 6, - "y": 10 - }, - { - "h": 10, - "i": "umcMFXKpivgT6ftHb3sf2R", - "moved": false, - "static": false, - "w": 6, - "x": 6, - "y": 0 - } - ] - }, - "title": "Shortest Path", - "version": "1718227489476782113", - "weight": 45 + } }, { "globalParameters": { @@ -939,7 +921,7 @@ ] }, "title": "IP Conflicts", - "version": "1718182992797652966", + "version": "1772468490562837106", "weight": 55, "chartMap": { "1dQRNR2aD7aFypgUHjQHRn": { @@ -967,7 +949,7 @@ "staticData": "{}", "title": "Input Account", "type": "Inputs", - "version": "1718182992883991368" + "version": "1772468490652793186" }, "2JscpDG7RsknwWoxrytfGT": { "chartSettings": { @@ -1004,7 +986,7 @@ "staticData": "{}", "title": "IP Sharing Graph", "type": "internal-graph", - "version": "1718182992890948957" + "version": "1772468490658972004" }, "gFu8x13AQTuCwQdnTTn18k": { "chartSettings": { @@ -1103,7 +1085,7 @@ "staticData": "{}", "title": "IP Sharing Table", "type": "table", - "version": "1718182992897871800" + "version": "1772468490665221019" } } }