Skip to main content


QueryModule Objects

class QueryModule()

Class representing a single MAGE query module.


def set_argument_values(**kwargs) -> None

Set values for QueryModule arguments so the module can be called.

Kwargs: Named arguments in self.arguments.


  • KeyError - Passed an argument not in the self.arguments list.


def get_arguments_for_call() -> str

return inputs in form "value1, value2, ..." for QueryBuilder call() method.


  • KeyError - Cannot get all values of arguments because one or more is not set.


def parse_query_module_signature(signature: str) -> Tuple[List[Dict[str, str]], List[Dict[str, str]]]

Query Modules signatures received from Memgraph are parsed into a list of dictionaries.

One list is for arguments and another for returns. For instance, if a query module signature is: dummy_module.dummy(lst :: LIST OF STRING, num = 3 :: NUMBER) :: (ret :: STRING) the method should return a list of arguments: [{"name": "lst", "type": "LIST OF STRING"}, {"name": "num", "type": "NUMBER", "default": 3}] and a list of returns: [{"name": "ret", "type": "STRING"}]

Dictionary consists of fields: "name" - argument name, "type" - data type of argument and "default" where default argument value is given


  • signature - module signature as returned by Cypher CALL operation


def parse_field(vars_field: str, name_type_delimiter: str = NAME_TYPE_DELIMITIER, default_value_delimiter: str = EQUALS_DELIMITER) -> List[Dict[str, str]]

Parse a field of arguments or returns from Query Module signature.


  • vars_field - signature field inside parentheses