• A helper function to find a hash with quad elements that have duplicate variables.

    Parameters

    • pattern: BaseQuad

      A quad pattern.

    Returns Record<string, QuadTermName[][]> | undefined

    If no equal variable names are present in the four terms, this returns undefined. Otherwise, this maps quad elements paths (['subject'], ['predicate'], ['object'], ['graph']) to the list of quad elements it shares a variable name with. For quoted triples, paths such as ['subject', 'object'] may occur. If no links for a certain element exist, this element will not be included in the hash. Note 1: Quad elements will never have a link to themselves. So this can never occur: { subject: [[ 'subject']] }, instead 'null' would be returned. Note 2: Links only exist in one direction, this means that { subject: [[ 'predicate']], predicate: [[ 'subject' ]] } will not occur, instead only { subject: [[ 'predicate']] } will be returned. Note 3: Keys can also be paths, but they are delimited by '_', such as: { subject_object_subject: [[ 'predicate']] }