Overloaded version of {@link #asTargetBy(String)} that uses the
{@link org.hawkular.inventory.api.Relationships.WellKnown} as the name of the relationship.

@param relationship the type of the relationship
@return a new "related" filter instance
5714
public static Related asTargetBy(Relationships.WellKnown relationship) {
        return new Related(null, relationship.name(), EntityRole.TARGET);
    }
879628
public void addRelation(String property, Relation relation)
    {
        relationsMap.put(property, relation);
        addRelationName(relation);
    }
128837
public Field getRelationshipLinksField(Class<?> clazz, String relationshipName) {
		return relationshipLinksFieldMap.get(clazz).get(relationshipName);
	}
1215543
protected function createRelationship($object, RelationshipDefinition $definition, MappingContext $context): AbstractRelationship
    {
        if (! $definition->isDataIncluded()) {
            return new NoDataRelationship();
        }

        return $definition->isCollection()
            ? $this->createIdentifierCollectionRelationship($object, $definition, $context)
            : $this->createSingleIdentifierRelationship($object, $definition, $context);
    }
1367948
private Relationship getOrCreateRelationshipWithUniqueFactory(Object entity, EntityMetadata m,
            GraphDatabaseService graphDb)
    {
        Object id = PropertyAccessorHelper.getObject(entity, (Field) m.getIdAttribute().getJavaMember());
        final String idFieldName = m.getIdAttribute().getName();

        UniqueFactory<Relationship> factory = new UniqueFactory.UniqueRelationshipFactory(graphDb, m.getIndexName())
        {

            @Override
            protected Relationship create(Map<String, Object> paramMap)
            {
                return null;
            }

            @Override
            protected void initialize(Relationship relationship, Map<String, Object> properties)
            {
                relationship.setProperty(idFieldName, properties.get(idFieldName));
            }
        };

        return factory.getOrCreate(idFieldName, id);
    }
936366
public Class<?> getRelationshipMetaType(Class<?> clazz, String relationshipName) {
		return relationshipMetaTypeMap.get(clazz).get(relationshipName);
	}
298330
RelationBuilder getRelationBuilder(Object target, Relation relation, Node source)
    {
        RelationBuilder relationBuilder = new RelationBuilder(target, relation, source);
        relationBuilder.assignGraphGenerator(this.generator);
        return relationBuilder;
    }
423211
@ManyToOne(targetEntity = org.openprovenance.prov.sql.QualifiedName.class, cascade = {
        CascadeType.ALL
    })
    @JoinColumn(name = "INFLUENCEE")
    public org.openprovenance.prov.model.QualifiedName getInfluencee() {
        return influencee;
    }
645655
private String getPropertyName(final String targetTypeName, final boolean outgoing, final String relationshipTypeName, final Cardinality cardinality) {

		final String sourceTypeName   = getName();
		final String relatedClassName = outgoing ? targetTypeName : sourceTypeName;

		String _sourceMultiplicity = null;
		String _targetMultiplicity = null;

		switch (cardinality) {

			case OneToOne:
				_sourceMultiplicity = "1";
				_targetMultiplicity = "1";
				break;

			case OneToMany:
				_sourceMultiplicity = "1";
				_targetMultiplicity = "*";
				break;

			case ManyToOne:
				_sourceMultiplicity = "*";
				_targetMultiplicity = "1";
				break;

			case ManyToMany:
				_sourceMultiplicity = "*";
				_targetMultiplicity = "*";
				break;
		}

		return SchemaRelationshipNode.getPropertyName(relatedClassName, root.getExistingPropertyNames(), outgoing, relationshipTypeName, sourceTypeName, targetTypeName, null, _targetMultiplicity, null, _sourceMultiplicity);
	}
969067
private void readRelation(Relationship relation)
   {
      Task predecessor = m_activityMap.get(relation.getPredecessor());
      Task successor = m_activityMap.get(relation.getSuccessor());
      if (predecessor != null && successor != null)
      {
         Duration lag = relation.getLag();
         RelationType type = relation.getType();
         successor.addPredecessor(predecessor, type, lag);
      }
   }
146034
@Nullable
    public Relationship getRelationship(@Nonnull String id) {
        if (id == null || id.trim().length() == 0) {
            throw new IllegalArgumentException("A relationship ID must be specified.");
        }

        return relationshipsById.get(id);
    }
750102
private void prefetchRelationships(Query query)
    {
        List prefetchedRel;
        Collection owners;
        String relName;
        RelationshipPrefetcher[] prefetchers;

        if (query == null || query.getPrefetchedRelationships() == null || query.getPrefetchedRelationships().isEmpty())
        {
            return;
        }

        if (!supportsAdvancedJDBCCursorControl())
        {
            logger.info("prefetching relationships requires JDBC level 2.0");
            return;
        }

        // prevent releasing of DBResources
        setInBatchedMode(true);

        prefetchedRel = query.getPrefetchedRelationships();
        prefetchers = new RelationshipPrefetcher[prefetchedRel.size()];

        // disable auto retrieve for all prefetched relationships
        for (int i = 0; i < prefetchedRel.size(); i++)
        {
            relName = (String) prefetchedRel.get(i);
            prefetchers[i] = getBroker().getRelationshipPrefetcherFactory()
                    .createRelationshipPrefetcher(getQueryObject().getClassDescriptor(), relName);
            prefetchers[i].prepareRelationshipSettings();
        }

        // materialize ALL owners of this Iterator
        owners = getOwnerObjects();

        // prefetch relationships and associate with owners
        for (int i = 0; i < prefetchedRel.size(); i++)
        {
            prefetchers[i].prefetchRelationship(owners);
        }

        // reset auto retrieve for all prefetched relationships
        for (int i = 0; i < prefetchedRel.size(); i++)
        {
            prefetchers[i].restoreRelationshipSettings();
        }

        try
        {
            getRsAndStmt().m_rs.beforeFirst(); // reposition resultset jdbc 2.0
        }
        catch (SQLException e)
        {
            logger.error("beforeFirst failed !", e);
        }

        setInBatchedMode(false);
        setHasCalledCheck(false);
    }
1160153
public RelationshipRepository<Resource, String, Resource, String> getRepositoryForPath(String sourceResourceType,
                                                                                           String targetResourceType) {
        init();

        ResourceInformation sourceResourceInformation =
                new ResourceInformation(moduleRegistry.getTypeParser(), Resource.class, sourceResourceType, null, null,
                        PagingSpec.class);
        return (RelationshipRepository<Resource, String, Resource, String>) decorate(new RelationshipRepositoryStubImpl<>(this, Resource.class, Resource.class, sourceResourceInformation, urlBuilder));
    }
993922
public RelationshipView getRelationshipView(@Nonnull Relationship relationship) {
        Optional<RelationshipView> relationshipView = this.relationshipViews.stream().filter(rv -> rv.getId().equals(relationship.getId())).findFirst();
        return relationshipView.orElse(null);
    }
1155494
@Override
	public final Security getSecurityRelationship(final Principal p) {

		if (p != null) {

			// try filter predicate to speed up things
			final Predicate<GraphObject> principalFilter = (GraphObject value) -> {
				return (p.getUuid().equals(value.getUuid()));
			};

			return getSecurityRelationship(p, mapSecurityRelationshipsMapped(getIncomingRelationshipsAsSuperUser(Security.class, principalFilter)));
		}

		return getSecurityRelationship(p, mapSecurityRelationshipsMapped(getIncomingRelationshipsAsSuperUser(Security.class)));
	}
1298737
public RelationshipTuple[] getRelationships(Context context,
                                                String pid,
                                                String relationship)
            throws ServerException {
        return worker.getRelationships(context, pid, relationship);
    }
627568
public List<TargetRelationship> getLinkListLevelRelationships() {
        final ArrayList<TargetRelationship> relationships = new ArrayList<TargetRelationship>();
        for (final TargetRelationship relationship : levelRelationships) {
            if (relationship.getType() == RelationshipType.LINKLIST) {
                relationships.add(relationship);
            }
        }
        return relationships;
    }