Set/create link with specified rel, set href and any other attributes.

        Any link element must have both rel and href values, the specification
        also defines the type attributes and others are permitted also. See
        description of allowed formats in

        http://www.openarchives.org/rs/resourcesync.html#DocumentFormats

        Be aware that adding links to a Resource object will
        significantly increase the size of the object.

def link_set(self, rel, href, allow_duplicates=False, **atts):
        """Set/create link with specified rel, set href and any other attributes.

        Any link element must have both rel and href values, the specification
        also defines the type attributes and others are permitted also. See
        description of allowed formats in

        http://www.openarchives.org/rs/resourcesync.html#DocumentFormats

        Be aware that adding links to a Resource object will
        significantly increase the size of the object.
        """
        if (self.ln is None):
            # automagically create a self.ln list
            self.ln = []
            link = None
        else:
            link = self.link(rel)
        if (link is not None and not allow_duplicates):
            # overwrite current value
            link['href'] = href
        else:
            # create new link
            link = {'rel': rel, 'href': href}
            self.ln.append(link)
        for k in atts:
            link[k] = atts[k]