Creates a new {@link Hop} for the given relation name.

@param rel must not be {@literal null} or empty.
@return
549682
public static Hop rel(String rel) {

		Assert.hasText(rel, "Relation must not be null or empty!");

		return new Hop(rel, Collections.emptyMap(), HttpHeaders.EMPTY);
	}
325902
function createMeta (args) {
    // resolve relation name to spec - will throw error if cant be resolved
    var relation = this.model.relation(args.relation)
    // args for creating related model
    var relatedArgs = {
        catch: false,
        data: args.data,
        session: args.session || this.session,
    }
    // add ids
    relatedArgs[this.model.columnName('id')] = this.id
    relatedArgs[this.model.columnName('originalId')] = this.originalId
    // create related model
    return relation.model.createMeta(relatedArgs)
    // create via model if any
    .then(related => {
        // if via model not specified then do not create
        if (!relation.viaModel) {
            return related
        }
        // args for via model
        var viaArgs = {
            session: defined(args.session) ? args.session : this.session,
        }
        // add id and original id for both instance and related models
        viaArgs[this.model.columnName('id')] = this.id
        viaArgs[this.model.columnName('originalId')] = this.originalId
        viaArgs[relation.model.columnName('id')] = related.id
        viaArgs[relation.model.columnName('originalId')] = related.originalId
        // create via model
        return relation.viaModel.createMeta(viaArgs)
        // resolve with related record
        .then(() => related)
    })
}
663983
@Description("apoc.index.between(node1,'TYPE',node2,'prop:value*') YIELD rel - lucene query on relationship index with the given type name bound by either or both sides (each node parameter can be null)")
    @Procedure(mode = Mode.READ)
    public Stream<WeightedRelationshipResult> between(@Name("from") Node from, @Name("type") String type, @Name("to") Node to, @Name("query") String query) throws Exception {
        if (!db.index().existsForRelationships(type)) return Stream.empty();
        return toWeightedRelationshipResult(db.index().forRelationships(type).query(query,from,to));
    }
553711
private Relation<?> addNewRelation(SimpleTypeInformation<?> meta) {
    @SuppressWarnings("unchecked")
    SimpleTypeInformation<Object> ometa = (SimpleTypeInformation<Object>) meta;
    Relation<?> relation = new MaterializedRelation<>(ometa, ids);
    relations.add(relation);
    getHierarchy().add(this, relation);
    // Try to add indexes where appropriate
    for(IndexFactory<?> factory : indexFactories) {
      if(factory.getInputTypeRestriction().isAssignableFromType(meta)) {
        @SuppressWarnings("unchecked")
        final IndexFactory<Object> ofact = (IndexFactory<Object>) factory;
        @SuppressWarnings("unchecked")
        final Relation<Object> orep = (Relation<Object>) relation;
        Index index = ofact.instantiate(orep);
        index.initialize();
        getHierarchy().add(relation, index);
      }
    }
    return relation;
  }
358884
def create_physical_relationship(manager, physical_handle_id, other_handle_id, rel_type):
    
    other_meta_type = get_node_meta_type(manager, other_handle_id)
    if other_meta_type == 'Physical':
        if rel_type == 'Has' or rel_type == 'Connected_to':
            return _create_relationship(manager, physical_handle_id, other_handle_id, rel_type)
    elif other_meta_type == 'Location' and rel_type == 'Located_in':
        return _create_relationship(manager, physical_handle_id, other_handle_id, rel_type)
    raise exceptions.NoRelationshipPossible(physical_handle_id, 'Physical', other_handle_id, other_meta_type, rel_type)
674850
public <NR> @NonNull Pair<L, NR> rmap(final @NonNull Function<? super R, ? extends NR> function) {
    return new Pair<>(this.left, function.apply(this.right));
  }
203635
public static HalLinkRelation curied(String curie, String rel) {

		Assert.hasText(curie, "Curie must not be null or empty!");

		return new HalLinkRelation(curie, rel);
	}
445759
public ClusterOrder run(Database db, Relation<V> rel) {
    DBIDs ids = rel.getDBIDs();
    DistanceQuery<V> dq = db.getDistanceQuery(rel, EuclideanDistanceFunction.STATIC);

    // initialize points used and reachability distance
    reachDist = DataStoreUtil.makeDoubleStorage(ids, DataStoreFactory.HINT_HOT | DataStoreFactory.HINT_TEMP, UNDEFINED_DISTANCE);

    // compute projections, density estimates and neighborhoods
    index.computeSetsBounds(rel, minPts, ids); // project points
    inverseDensities = index.computeAverageDistInSet(); // compute densities
    neighs = index.getNeighs(); // get neighbors of points

    // compute ordering as for OPTICS
    FiniteProgress prog = LOG.isVerbose() ? new FiniteProgress("FastOPTICS clustering", ids.size(), LOG) : null;
    processed = DBIDUtil.newHashSet(ids.size());
    order = new ClusterOrder(ids, "FastOPTICS Cluster Order", "fast-optics");
    for(DBIDIter it = ids.iter(); it.valid(); it.advance()) {
      if(!processed.contains(it)) {
        expandClusterOrder(DBIDUtil.deref(it), order, dq, prog);
      }
    }
    index.logStatistics();
    LOG.ensureCompleted(prog);
    return order;
  }
1119551
@Path("/new")
    @POST
    public Response addRelationship(
            @PathParam(RestParam.PID)
            String pid,
            @QueryParam(RestParam.SUBJECT)
            String subject,
            @QueryParam(RestParam.PREDICATE)
            String predicate,
            @QueryParam(RestParam.OBJECT)
            String object,
            @QueryParam(RestParam.IS_LITERAL)
            boolean isLiteral,
            @QueryParam(RestParam.DATATYPE)
            String datatype,
            @QueryParam(RestParam.FLASH)
            @DefaultValue("false")
            boolean flash) {
        Context context = getContext();
        try {
            if (subject == null) {
                // assume the subject is the object as denoted by the pid
                subject = PID.toURI(pid);
            }
            boolean result = m_management.addRelationship(context, subject, predicate, object, isLiteral, datatype);
            return Response.ok(Boolean.toString(result)).build(); // needs an entity to not be overridden with a 204
        } catch (ServerException e) {
            return handleException(e, flash);
        }
    }
1202017
public static RAExpression naturalJoin(RAExpression re1, RAExpression re2, TermFactory termFactory) throws IllegalJoinException {

        ImmutableSet<QuotedID> shared =
                RAExpressionAttributes.getShared(re1.attributes, re2.attributes);

        RAExpressionAttributes attributes =
                RAExpressionAttributes.joinUsing(re1.attributes, re2.attributes, shared);

        return new RAExpression(union(re1.dataAtoms, re2.dataAtoms),
                union(re1.filterAtoms, re2.filterAtoms,
                        getJoinOnFilter(re1.attributes, re2.attributes, shared, termFactory)),
                attributes, termFactory);
    }
156734
static <R, W> ConnectionImpl<R, W> create(Channel nettyChannel,
                                                                     ChannelOperations<W> delegate) {
        final ConnectionImpl<R, W> toReturn = new ConnectionImpl<>(nettyChannel, delegate);
        toReturn.connectCloseToChannelClose();
        return toReturn;
    }
379010
public Relation newRelation(Relational from, Relational to) {
	String newId = idManager.getNextId(AnnotationType.RELATION);
	Relation newRelation = new Relation(newId, from, to);
	annotationContainer.add(newRelation, Layer.RELATIONS, AnnotationType.RELATION);
	return newRelation;
    }
1158847
@Override
  public Streamlet<R> union(Streamlet<? extends R> otherStreamlet) {
    checkNotNull(otherStreamlet, "otherStreamlet cannot be null");

    StreamletImpl<? extends R> joinee = (StreamletImpl<? extends R>) otherStreamlet;
    UnionStreamlet<R> retval = new UnionStreamlet<>(this, joinee);
    addChild(retval);
    joinee.addChild(retval);
    return retval;
  }
570263
function createRelation(model, relationName, data) {
  if (!model) {
    throw new Error('No model provided.');
  }
  return _transact2['default'](model, function (transaction) {
    var existing = _related2['default'](model, relationName).map(function (rel) {
      return {
        id: _id2['default'](rel),
        type: _type2['default'](rel)
      };
    });
    var all = data.concat(existing);
    // TODO: should i be doing a deep comparison instead?
    var unique = _lodash2['default'].uniq(all, JSON.stringify.bind(null));
    return _relate2['default'](model, {
      name: relationName,
      data: unique
    }, 'add', transaction);
  });
}
470708
public RemoteReceiveQueue createRemoteReceiveQueue(String strQueueName, String strQueueType) throws RemoteException
    {
        BaseTransport transport = this.createProxyTransport(CREATE_REMOTE_RECEIVE_QUEUE);
        transport.addParam(MessageConstants.QUEUE_NAME, strQueueName);
        transport.addParam(MessageConstants.QUEUE_TYPE, strQueueType);
        String strID = (String)transport.sendMessageAndGetReply();
        return new ReceiveQueueProxy(this, strID);
    }
346035
public static ObjectGraph create(MortarScope parent, Object... daggerModules) {
    ObjectGraph parentGraph = getObjectGraph(parent);

    return parentGraph == null ? ObjectGraph.create(daggerModules)
        : parentGraph.plus(daggerModules);
  }
862370
public static SamplingResult getSamplingResult(final Relation<?> rel) {
    Collection<SamplingResult> selections = ResultUtil.filterResults(rel.getHierarchy(), rel, SamplingResult.class);
    if(selections.isEmpty()) {
      final SamplingResult newsam = new SamplingResult(rel);
      ResultUtil.addChildResult(rel, newsam);
      return newsam;
    }
    return selections.iterator().next();
  }