def __getattr__(self,
                  rel_name):
    """Allow x.rel_name() to be used instead of x.follow('rel_name').

    Args:
      rel_name: a string naming a declared KG relation

    Returns:
      Function that creates the appropriate 'follow' construct.
    """
    if self.context.is_relation(rel_name):
      return lambda inverted=+1: self.follow(rel_name, inverted=inverted)
    else:
      raise AttributeError()
Allow x.rel_name() to be used instead of x.follow('rel_name').

    Args:
      rel_name: a string naming a declared KG relation

    Returns:
      Function that creates the appropriate 'follow' construct.
    
language/nql/nql/__init__.py