Transform

class orion_notebook.graph.extensibility.transform.Transform

Bases: object

Class that defines an operation to transform an Entity into another Entity. For example, a transformation could be applied to an Entity “IP” to retrieve information about the domain.

classmethod create_entities(request: Any, response: orion_notebook.graph.extensibility.transform.TransformResponse)

This method MUST implement the necessary code to retrieve information from the source Entity and build the resulting entities

Parameters
  • request (Any) – source Entity

  • response (TransformResponse) – result of the Transformation where new entities can be added

classmethod run_transform(request: Any)Tuple[List[orion_notebook.graph.extensibility.entity.Entity], List[orion_notebook.graph.extensibility.link.Link], int]

Executes the transformation. This method is internally used by the library and MUST not be overridden by the user.

Parameters

request (Any) – source Entity

Returns

A tuple with a list of elements of type Entity, type Edge and total number of entities

Return type

Tuple[List[Entity], List[Edge], int]

class orion_notebook.graph.extensibility.transform.TransformResponse

Bases: object

Class that holds the output of the transformation.

add_entity(entity_type: Any, value: str)Any

Creates, stores and return the entity of the type defined in the transformation.

Parameters
  • entity_type (Any) – type of the Entity to create

  • value (str) – name of the Entity

Returns

an entity of type entity_type

Return type

Any

Creates a link between two entities

Parameters
  • source (str) – source Entity

  • target (str) – target Entity

  • label (str) – name of the link

return_output(request: Any)Tuple[List[orion_notebook.graph.extensibility.entity.Entity], List[orion_notebook.graph.extensibility.link.Link], int]

Builds the necessary links between the source Entity and the entities result of applying the transformation.

Parameters

request (Any) – source Entity

Returns

A tuple with a list of elements of type Entity, type Edge and total number of entities

Return type

Tuple[List[Entity], List[Edge], int]