def add_to_quadruples(h_v, d_v, r, r_inver):
     if is_core(r):
         quadruples.append([
             graph.node[h_v]['value'], graph.node[d_v]['value'], r, h_v,
             d_v
         ])
     else:
         quadruples.append([
             graph.node[d_v]['value'], graph.node[h_v]['value'],
             r_inver, d_v, h_v
         ])
 def cannonical(r):
     return "-of" in r and not is_core(r) or "-of" not in r and is_core(
         r)