G2Engine Finding Paths

Version 3.x Version 2.x

Finding Paths

findPathByEntityID

findPathByEntityID() finds the most efficient relationship between two entities path based on the parameters, and 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 between two entities path based on the parameters by RECORD_ID values, and 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 between two entities path based on the parameters while preferentially excluding specific ENTITY_IDs, and 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

findPathExcludingByEntityID() finds the most efficient relationship between two entities path based on the parameters by RECORD_IDs while preferentially excluding specific ENTITY_IDs, and 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_entities_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_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

findPathIncludingSourceByEntityID

findPathIncludingSourceByEntityID() finds the most efficient relationship between two entities path based on the parameters, requiring a path entity to include a RECORD_ID from specified data source. 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) 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 `findPathIncludingSourceByEntityID()` example

findPathIncludingSourceByRecordID

findPathIncludingSourceByRecordID() finds the most efficient relationship between two entities path based on the parameters by RECORD_IDs, requiring a path entity to include a RECORD_ID from specified data source. 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.findPathIncludingSourceByRecordID(start_data_source_code, start_record_id, end_data_source_code, end_record_id, max_degree, excluded_entities_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_entities_as_json: (str) Entities 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