code: def prefix_fragment(self, nid):
          
          sep=':'
          if nid.startswith('http'):
              if '#' in nid:
                 sep='#'
              else:
                  sep='/'
          parts = nid.split(sep)
          frag = parts.pop()
          prefix = sep.join(parts)
          return prefix, frag
docs: Return prefix and fragment/localid for a node