G2Engine Finding Paths

Version 3.x Version 2.x

Finding Paths

findPathByEntityID

findPathByEntityID() finds the most efficient relationship path between two entities.

Returns a JSON document with an ENTITY_PATHS section that details the path between the entities. The ENTITIES sections details information on the entities. Paths are found using known relationships with other entities.

g2_engine.findPathByEntityID(start_entity_id, end_entity_id, max_degree, response_bytearray, g2_engine_flags)
Parameters
  • start_entity_id: (int) The ENTITY_ID for the starting entity of the search path.
  • end_entity_id: (int) The ENTITY_ID for the ending entity of the search path.
  • max_degree: (int) The maximum path length to from start_entity_id to end_entity_id.
  • response_bytearray: (bytearray) Object to store the output of the method.
  • g2_engine_flags: (int [optional]) One or more flags used to determine response document content. Applicable flags are listed here findPath* flags)
Click to expand `findPathByEntityID()` example

findPathByRecordID

findPathByEntityID() finds the most efficient relationship path between two entities by DATA_SOURCE and RECORD_ID values.

Returns a JSON document with an ENTITY_PATHS section that details the path between the entities. The ENTITIES sections details information on the entities. Paths are found using known relationships with other entities.

g2_engine.findPathByRecordID(start_data_source_code, start_record_id, end_data_source_code, end_record_id, max_degree, response_bytearray, g2_engine_flags)
Parameters
  • start_data_source_code: (str) The data source for the starting entity of the search path.
  • start_record_id: (str) The RECORD_ID for the starting entity of the search path.
  • end_data_source_code: (str) The data source for the ending entity of the search path.
  • end_record_id: (str) The RECORD_ID for the ending entity of the search path.
  • max_degree: (int) The maximum path length to from start_entity_id to end_entity_id.
  • response_bytearray: (bytearray) Object to store the output of the method.
  • g2_engine_flags: (int [optional]) One or more flags used to determine response document content. Applicable flags are listed here findPath* flags)
Click to expand `findPathByEntityID()` example

findPathExcludingByEntityID

findPathExcludingByEntityID() finds the most efficient relationship path between two entities, while preferentially excluding specific ENTITY_IDs.

Returns a JSON document with an ENTITY_PATHS section that details the path between the entities. The ENTITIES sections details information on the entities. Paths are found using known relationships with other entities.

By default, any excluded entities are strictly excluded. The G2_FIND_PATH_PREFER_EXCLUDE flag sets the exclusion to preferred instead of strict exclusion. Preferred exclusion means that if an excluded entity is the only one in the path, it will be used, but strict will never include excluded entities in the path.

g2_engine.findPathExcludingByEntityID(start_entity_id, end_entity_id, max_degree, excluded_entities_as_json, response_bytearray, g2)
Parameters
  • start_entity_id: (int) The entity ID for the starting entity of the search path.
  • end_entity_id: (int) The entity ID for the ending entity of the search path.
  • max_degree: (int) The maximum path length to from start_entity_id to end_entity_id.
  • excluded_entities_as_json: (str) Entities that should be avoided on the path (JSON document).
  • response_bytearray: (bytearray) Object to store the output of the method.
  • g2_engine_flags: (int [optional]) One or more flags used to determine response document content. Applicable flags are listed here findPath* flags)
Click to expand `findPathExcludingByEntityID()` example

findPathExcludingByRecordID

findPathExcludingByRecordID() finds the most efficient relationship path between two entities by DATA_SOURCE and RECORD_ID values, while preferentially excluding specific entities by DATA_SOURCE and RECORD_ID values.

Returns a JSON document with an ENTITY_PATHS section that details the path between the entities. The ENTITIES sections details information on the entities. Paths are found using known relationships with other entities.

By default, any excluded entities are strictly excluded. The G2_FIND_PATH_PREFER_EXCLUDE flag sets the exclusion to preferred instead of strict exclusion. Preferred exclusion means that if an excluded entity is the only one in the path, it will be used, but strict will never include excluded entities in the path.

g2_engine.findPathExcludingByRecordID(start_data_source_code, start_record_id, end_data_source_code, end_record_id, max_degree, excluded_records_as_json, response_bytearray, g2_engine_flags)
Parameters
  • start_data_source_code: (str) The data source for the starting entity of the search path.
  • start_record_id: (str) The RECORD_ID for the starting entity of the search path.
  • end_data_source_code: (str) The data source for the ending entity of the search path.
  • end_record_id: (str) The RECORD_ID for the ending entity of the search path.
  • max_degree: (int) The maximum path length to from start_entity_id to end_entity_id.
  • excluded_records_as_json: (str) Entities by DATA_SOURCE and RECORD_ID values that should be avoided on the path (JSON document).
  • response_bytearray: (bytearray) Object to store the output of the method.
  • g2_engine_flags: (int [optional]) One or more flags used to determine response document content. Applicable flags are listed here findPath* flags)
Click to expand `findPathExcludingByEntityID()` example

findPathIncludingSourceByEntityID

findPathIncludingSourceByEntityID() finds the most efficient relationship path between two entities, requiring a path entity to include a record from a specified list of data sources. Specific ENTITY_IDs to exclude can optionally be listed.

Returns a JSON document with an ENTITY_PATHS section that details the path between the entities. The ENTITIES sections details information on the entities. Paths are found using known relationships with other entities.

By default, any excluded entities are strictly excluded. The G2_FIND_PATH_PREFER_EXCLUDE flag sets the exclusion to preferred instead of strict exclusion. Preferred exclusion means that if an excluded entity is the only one in the path, it will be used, but strict will never include excluded entities in the path.

g2_engine.findPathIncludingSourceByEntityID(start_entity_id, end_entity_id, max_degree, excluded_entities_as_json, required_dsrcs_as_json, response_bytearray, g2_engine_flags)
Parameters
  • start_entity_id: (int) The entity ID for the starting entity of the search path
  • end_entity_id: (int) The entity ID for the ending entity of the search path
  • max_degree: (int) The maximum path length to from start_entity_id to end_entity_id.
  • excluded_entities_as_json: (str) Entities that should be avoided on the path (JSON document).
  • required_dsrcs_as_json: (str) The list of data sources to watch for (JSON document).
  • response_bytearray: (bytearray) Object to store the output of the method.
  • g2_engine_flags: (int [optional]) One or more flags used to determine response document content. Applicable flags are listed here findPath* flags)
Click to expand `findPathIncludingSourceByEntityID()` example

findPathIncludingSourceByRecordID

findPathIncludingSourceByEntityID() finds the most efficient relationship path between two entities by DATA_SOURCE and RECORD_ID values, requiring a path entity to include a record from a specified list of data sources, while preferentially excluding specific entities by DATA_SOURCE and RECORD_ID values.

Returns a JSON document with an ENTITY_PATHS section that details the path between the entities. The ENTITIES sections details information on the entities. Paths are found using known relationships with other entities.

By default, any excluded entities are strictly excluded. The G2_FIND_PATH_PREFER_EXCLUDE flag sets the exclusion to preferred instead of strict exclusion. Preferred exclusion means that if an excluded entity is the only one in the path, it will be used, but strict will never include excluded entities in the path.

g2_engine.findPathIncludingSourceByRecordID(start_data_source_code, start_record_id, end_data_source_code, end_record_id, max_degree, excluded_records_as_json, required_dsrcs_as_json, response_bytearray, g2_engine_flags)
Parameters
  • start_data_source_code: (str) The data source for the starting entity of the search path.
  • start_record_id: (str) The RECORD_ID for the starting entity of the search path.
  • end_data_source_code: (str) The data source for the ending entity of the search path.
  • end_record_id: (str) The RECORD_ID for the ending entity of the search path.
  • max_degree: (int) The maximum path length to from start_entity_id to end_entity_id.
  • excluded_records_as_json: (str) Entities by DATA_SOURCE and RECORD_ID values that should be avoided on the path (JSON document)
  • required_dsrcs_as_json: (str) Entities that should be avoided on the path (JSON document).
  • response_bytearray: (bytearray) Object to store the output of the method.
  • g2_engine_flags: (int [optional]) One or more flags used to determine response document content. Applicable flags are listed here findPath* flags)
Click to expand `findPathIncludingSourceByRecordID()` example