Remove the link with the given relation and href
@param relation Link relation
@param href to identify the link to remove
@return this HAL resource
427550
public HalResource removeLinkWithHref(String relation, String href) {

    List<Link> links = getLinks(relation);
    for (int i = 0; i < links.size(); i++) {
      if (href.equals(links.get(i).getHref())) {
        return removeLink(relation, i);
      }
    }

    return this;
  }
338347
public final void removeRelationshipsWithTag(@Nonnull String tag) {
        getRelationships().stream()
                .map(RelationshipView::getRelationship)
                .filter(r -> r.hasTag(tag))
                .forEach(this::remove);
    }
1282755
public function removeRelation(\TechPromux\DynamicQueryBundle\Entity\MetadataRelation $relation)
    {
        $this->relations->removeElement($relation);
    }
1364092
public HalResource addLinks(String relation, Link... links) {
    return addResources(HalResourceType.LINKS, relation, true, links);
  }
1142574
def _delete_single_relation(self, src, relation, dst):
        '''  '''
        self.__require_string__(relation)
        src_id = self._id_of(src)
        dst_id = self._id_of(dst)
        with self._write_lock:
            self._execute('''
                DELETE from relations where src=? and name=? and dst=?
            ''', (src_id, relation, dst_id))
            self.autocommit()
1145536
public Links without(LinkRelation relation) {

		Assert.notNull(relation, "LinkRelation must not be null!");

		return this.links.stream() //
				.filter(it -> !it.hasRel(relation)) //
				.collect(Links.collector());
	}
1327926
@Override
	public Optional<Link> findLinkWithRel(LinkRelation relation, String representation) {
		return firstOrEmpty(findLinksWithRel(relation, representation));
	}
900502
public Relation<V,K> revert(final Relation<V,K> result) {
	forAllEntries(new EntryVisitor<K,V>() {
		public void visit(K key, V value) {
		    result.add(value, key);
		}
	    });
	return result;
    }
1196425
@Override
    public void delete() {
        //Remove links to relations and return them
        Set<Relation> relations = castingsInstance().map(casting -> {
            Relation relation = casting.getRelation();
            Role role = casting.getRole();
            relation.unassign(role, this);
            return relation;
        }).collect(toSet());

        vertex().tx().cache().removedInstance(type().id());
        deleteNode();

        relations.forEach(relation -> {
            if (relation.type().isImplicit()) {//For now implicit relations die
                relation.delete();
            } else {
                RelationImpl rel = (RelationImpl) relation;
                rel.cleanUp();
            }
        });
    }
459891
public Link getRequiredLink(LinkRelation relation) {

		Assert.notNull(relation, "Link relation must not be null!");

		return getRequiredLink(relation.value());
	}
236937
@Override
	public Links findLinksWithRel(LinkRelation relation, String representation) {

		Assert.notNull(relation, "LinkRelation must not be null!");
		Assert.notNull(representation, "Representation must not be null!");

		return relation.isSameAs(IanaLinkRelations.SELF) //
				? addSelfLink(super.findLinksWithRel(relation, representation), representation) //
				: super.findLinksWithRel(relation, representation);
	}
1353235
public static List<Link> getAllLinksForRelation(HalResource hal, String relation) {

    List<Link> links = Lists.newArrayList(hal.getLinks(relation));
    List<Link> embeddedLinks = hal.getEmbedded().values().stream()
        .flatMap(embedded -> getAllLinksForRelation(embedded, relation).stream())
        .collect(Collectors.toList());
    links.addAll(embeddedLinks);
    return links;
  }
400415
private void resolve(LinkRelation rel) {
    Iterator<LinkRelationRef> refs = rel.getLinkRelationRefs().iterator();
    while (refs.hasNext()) {
      LinkRelationRef ref = refs.next();
      LinkRelation referencedRel = linkRelations.stream()
          .filter(item -> StringUtils.equals(item.getRel(), ref.getRel()))
          .findFirst().orElse(null);
      if (referencedRel == null) {
        refs.remove();
      }
      else {
        if (StringUtils.isBlank(ref.getShortDescription())) {
          ref.setShortDescription(referencedRel.getShortDescription());
        }
      }
    }
  }
118047
function(links, resource) {
        var link, association, id, route, relationshipLink, cleanedRoute;

        // Clear the old format
        resource.links = {};

        for (link in links) {
          association = links[link];
          link = Ember.String.camelize(link.split('.').pop());

          if(!association) {
            continue;
          }

          if (typeof association === 'string') {
            if (association.indexOf('/') > -1) {
              route = association;
              id = null;
            } else { // This is no longer valid in JSON API. Potentially remove.
              route = null;
              id = association;
            }
            relationshipLink = null;
          } else {
            if (association.links) {
              relationshipLink =  association.links[this.relationshipKey];
              route = association.links[this.relatedResourceKey];
            }
            id = getLinkageId(association.data);
          }

          if (route) {
            cleanedRoute = this.removeHost(route);
            resource.links[link] = cleanedRoute;

            // Need clarification on how this is used
            if (cleanedRoute.indexOf('{') > -1) {
              DS._routes[link] = cleanedRoute.replace(/^\//, '');
            }
          }
          if (id) {
            resource[link] = id;
          }
        }
        return resource.links;
      }
1052445
@Override
	public Optional<Link> findLinkWithRel(LinkRelation relation, String representation) {

		Assert.notNull(relation, "LinkRelation must not be null!");
		Assert.notNull(representation, "Representation must not be null!");

		return relation.isSameAs(IanaLinkRelations.SELF) //
				? findSelfLink(representation) //
				: super.findLinkWithRel(relation, representation);
	}
1000513
public void remove() {

    if (context == null) {
      throw new IllegalStateException("link with href=" + getHref() + " can not be removed, because it's not part of a HAL resource tree");
    }

    // iterate over all links grouped by relation (because for removal we need to know the relation)
    ListMultimap<String, Link> allLinks = context.getLinks();
    for (String relation : allLinks.keySet()) {
      List<Link> links = allLinks.get(relation);

      // use an indexed for-loop, because we need to know the index to properly remove the link
      for (int i = 0; i < links.size(); i++) {
        if (links.get(i).getModel() == model) {
          context.removeLink(relation, i);
          context = null;
          return;
        }
      }
    }

    throw new IllegalStateException("the last known context resource of link with href=" + getHref() + " no longer contains this link");
  }
785024
final boolean unlink(Index<K,V> succ) {
            return node.value != null && casRight(succ, succ.right);
        }