code: def edge_to_query(
      d: dict,
      from_col: str,
      to_col: str,
      type_col: Optional[str] = None,
      untyped: bool = False,
  ) -> str:
      """
      Assumes properties from, to, type
      * If type is None, try to default to fields  'edgeType', 'category', or 'type'. Skip via untyped=True.
      """
      if (not untyped) and (type_col is None):
          if "edgeType" in d:
              type_col = "edgeType"
          elif "category" in d:
              type_col = "category"
          elif "type" in d:
              type_col = "type"
          else:
              raise Exception(
                  "Must specify edge type_col or provide edge column edgeType, category, or type"
              )
  
      addE = (
          f"addE('{clean_str(d[type_col])}')"
          if not untyped
          else "addE()"
      )
      base = f"g.v('{clean_str(d[from_col])}').{addE}.to(g.v('{clean_str(d[to_col])}'))"
      if True:
          skiplist = [from_col, to_col, type_col]
          for p in d.keys():
              if not pd.isna(d[p]) and (p not in skiplist):
                  base += f".property('{clean_str(p)}', '{clean_str(d[p])}')"
      return base
  
imports: from typing import Any, Callable, Iterable, List, Optional, Set, Union, TYPE_CHECKING
  import os, pandas
  from .Plottable import Plottable
  from .util import setup_logger
label_desc: Use image node_id 5 for calling a global function with example usage: edge_to_query(d, from_col, to_col, type_col, untyped) and returns: base