Gets the related entity references of the given interaction,
@param conv conversion interaction
@param direction which side(s) participants of the conversion to consider
@param taboo skip list of entities
@return entity references
496521
protected Collection<BioPAXElement> generate(Conversion conv, Direction direction,
		Set<Entity> taboo)
	{
		if (direction == null) throw new IllegalArgumentException("Direction cannot be null");

		if (!(direction == Direction.BOTHSIDERS || direction == Direction.ONESIDERS))
		{
			Set<BioPAXElement> simples = new HashSet<BioPAXElement>();

			for (Entity part : direction == Direction.ANY ? conv.getParticipant() :
				direction == Direction.LEFT ? conv.getLeft() : conv.getRight())
			{
				if (part instanceof PhysicalEntity && !taboo.contains(part))
				{
					simples.addAll(linker.getLinkedElements((PhysicalEntity) part));
				}
			}

			return pe2ER.getValueFromBeans(simples);
		}
		else
		{
			Set<BioPAXElement> leftSimples = new HashSet<BioPAXElement>();
			Set<BioPAXElement> rightSimples = new HashSet<BioPAXElement>();

			for (PhysicalEntity pe : conv.getLeft())
			{
				if (!taboo.contains(pe)) leftSimples.addAll(linker.getLinkedElements(pe));
			}
			for (PhysicalEntity pe : conv.getRight())
			{
				if (!taboo.contains(pe)) rightSimples.addAll(linker.getLinkedElements(pe));
			}

			Set leftERs = pe2ER.getValueFromBeans(leftSimples);
			Set rightERs = pe2ER.getValueFromBeans(rightSimples);

			if (direction == Direction.ONESIDERS)
			{
				// get all but intersection
				Set temp = new HashSet(leftERs);
				leftERs.removeAll(rightERs);
				rightERs.removeAll(temp);
				leftERs.addAll(rightERs);
			}
			else // BOTHSIDERS
			{
				// get intersection
				leftERs.retainAll(rightERs);
			}

			return leftERs;
		}
	}
1116782
@Override
  public Stream<Entity> findAll(Stream<Object> ids) {
    Stream<Entity> entities = delegate().findAll(ids);
    return resolveEntityReferences(entities);
  }
1356931
function getEntity(urls, entityId) {
  // Add xhtml11.dtd to prevent missing entity errors with XHTML files
  urls.push("resource:///res/dtd/xhtml11.dtd");

  // Build a string of external entities
  var extEntities = "";
  for (i = 0; i < urls.length; i++) {
    extEntities += '<!ENTITY % dtd' + i + ' SYSTEM "' +
                   urls[i] + '">%dtd' + i + ';';
  }

  var parser = Cc["@mozilla.org/xmlextras/domparser;1"]
                  .createInstance(Ci.nsIDOMParser);
  var header = '<?xml version="1.0"?><!DOCTYPE elem [' + extEntities + ']>';
  var elem = '<elem id="elementID">&' + entityId + ';</elem>';
  var doc = parser.parseFromString(header + elem, 'text/xml');
  var elemNode = doc.querySelector('elem[id="elementID"]');

  if (elemNode == null)
    throw new Error(arguments.callee.name + ": Unknown entity - " + entityId);

  return elemNode.textContent;
}
1245396
public List<RelationshipInterface> execute(NodeInterface sourceNode, RelationshipType relType, Direction dir) throws FrameworkException {

		RelationshipFactory factory        = new RelationshipFactory(securityContext);
		List<RelationshipInterface> result = new LinkedList<>();
		Node node                          = sourceNode.getNode();
		Iterable<Relationship> rels;

		if (node == null) {

			return Collections.EMPTY_LIST;

		}

		if (relType != null) {

			rels = node.getRelationships(dir, relType);

		} else {

			rels = node.getRelationships(dir);
		}

		try {

			for (Relationship r : rels) {

				result.add(factory.instantiate(r));
			}

		} catch (RuntimeException e) {

			logger.warn("Exception occured: ", e.getMessage());

			/**
				* ********* FIXME
				*
				* Here an exception occurs:
				*
				* org.neo4j.kernel.impl.nioneo.store.InvalidRecordException: Node[5] is neither firstNode[37781] nor secondNode[37782] for Relationship[188125]
				* at org.neo4j.kernel.impl.nioneo.xa.ReadTransaction.getMoreRelationships(ReadTransaction.java:131)
				* at org.neo4j.kernel.impl.nioneo.xa.NioNeoDbPersistenceSource$ReadOnlyResourceConnection.getMoreRelationships(NioNeoDbPersistenceSource.java:280)
				* at org.neo4j.kernel.impl.persistence.PersistenceManager.getMoreRelationships(PersistenceManager.java:100)
				* at org.neo4j.kernel.impl.core.NodeManager.getMoreRelationships(NodeManager.java:585)
				* at org.neo4j.kernel.impl.core.NodeImpl.getMoreRelationships(NodeImpl.java:358)
				* at org.neo4j.kernel.impl.core.IntArrayIterator.hasNext(IntArrayIterator.java:115)
				*
				*
				*/
		}

		return result;
	}
524890
protected ConversionDirectionType getDirection(Conversion conv, Pathway pathway)
	{
		Set<StepDirection> dirs = new HashSet<StepDirection>();

		// find the direction in the pathway step
		for (PathwayStep step : conv.getStepProcessOf())
		{
			if (step.getPathwayOrderOf().equals(pathway) && step instanceof BiochemicalPathwayStep)
			{
				StepDirection dir = ((BiochemicalPathwayStep) step).getStepDirection();
				if (dir != null) dirs.add(dir);
			}
		}

		if (dirs.size() > 1) return ConversionDirectionType.REVERSIBLE;
		else if (!dirs.isEmpty()) return convertStepDirection(dirs.iterator().next());

		return getDirection(conv);
	}
1250780
public Map<String, String> getUriVariablesForQueryWithPost(BullhornEntityInfo entityInfo, Set<String> fieldSet, QueryParams params) {

        Map<String, String> uriVariables = params.getParameterMap();

        this.addCommonUriVariables(fieldSet, entityInfo, uriVariables);

        return uriVariables;
    }
247216
protected ConversionDirectionType getDirection(Conversion conv, Control cont)
	{
		return getDirection(conv, null, cont);
	}
608753
public Map<String, String> getUriVariablesForAddFile(BullhornEntityInfo entityInfo, Integer entityId, String externalId, FileParams params) {
		if (params == null) {
			params = ParamFactory.fileParams();
		}

		Map<String, String> uriVariables = params.getParameterMap();

		String bhRestToken = bullhornApiRest.getBhRestToken();
		uriVariables.put(BH_REST_TOKEN, bhRestToken);
		uriVariables.put(EXTERNAL_ID, externalId);
		uriVariables.put(ENTITY_TYPE, entityInfo.getName());
		uriVariables.put(ENTITY_ID, entityId.toString());
		return uriVariables;
	}
1363515
def get_entity_uuid_coords(self, uuid):
        
        if uuid in self._entity_to_region_map:
            coords = self._entity_to_region_map[uuid]
            entities = self.get_entities(*coords)
            for entity in entities:
                if 'uniqueId' in entity.data and entity.data['uniqueId'] == uuid:
                    return tuple(entity.data['tilePosition'])
        return None
1239934
private String getRelatedIDs(SmallMoleculeReference smr)
	{
		String ids = smr.getUri();

		for (Object o : new PathAccessor(
			"SmallMoleculeReference/entityReferenceOf").getValueFromBean(smr))
		{
			SimplePhysicalEntity spe = (SimplePhysicalEntity) o;
			ids += "\n" + spe.getUri();
		}
		return ids;
	}
74030
private Object handleAssociation(final Object entity, final Map<String, Object> relationsMap,
            final EntityMetadata m, final PersistenceDelegator pd, boolean lazilyloaded,
            Map<Object, Object> relationStack)
    {

        for (Relation relation : m.getRelations())
        {
            if (relation != null)
            {
                ForeignKey relationType = relation.getType();

                Object relationalObject = PropertyAccessorHelper.getObject(entity, relation.getProperty());

                if (KunderaCoreUtils.isEmptyOrNull(relationalObject)
                        || ProxyHelper.isProxyOrCollection(relationalObject))
                {
                    onRelation(entity, relationsMap, m, pd, relation, relationType, lazilyloaded, relationStack);
                } // a bit of hack for neo4j only
                else if (!ProxyHelper.isProxyOrCollection(relationalObject)
                        && Map.class.isAssignableFrom(relationalObject.getClass()))
                {
                    Map relationalMap = (Map) relationalObject;
                    for (Map.Entry entry : (Set<Map.Entry>) relationalMap.entrySet())
                    {
                        Object entityObject = entry.getValue();
                        if (entityObject != null)
                        {
                            EntityMetadata metadata = KunderaMetadataManager.getEntityMetadata(kunderaMetadata,
                                    entityObject.getClass());
                            PersistenceCacheManager.addEntityToPersistenceCache(entityObject, pd,
                                    PropertyAccessorHelper.getId(entityObject, metadata));
                        }
                    }
                }
            }
        }
        return entity;
    }
400830
private CmsResource findReferencingPage(CmsResource source) throws CmsException {

        List<CmsRelation> relationsToFile = m_cms.readRelations(
            CmsRelationFilter.relationsToStructureId(source.getStructureId()));
        for (CmsRelation relation : relationsToFile) {
            try {
                CmsResource referencingPage = relation.getSource(m_cms, CmsResourceFilter.DEFAULT);
                if (CmsResourceTypeXmlContainerPage.isContainerPage(referencingPage)) {
                    return referencingPage;
                }
            } catch (CmsException e) {
                LOG.info(e.getLocalizedMessage(), e);
            }
        }
        return null;
    }
463458
public List<Object> fromThriftRow(Class<?> clazz, EntityMetadata m, List<String> relationNames, boolean isWrapReq,
            ConsistencyLevel consistencyLevel, Object... rowIds) throws Exception
    {
        List<Object> entities = new ArrayList<Object>();
        if (rowIds != null)
        {
            for (Object rowKey : rowIds)
            {
                Object e = fromThriftRow(clazz, m, rowKey, relationNames, isWrapReq, consistencyLevel);
                if (e != null)
                {
                    entities.add(e);
                }
            }
        }
        return entities;
    }
569964
@Override
    public Direction direction(Vertex vertex) {
        for (int i=0;i<getArity();i++) {
            if (it().getVertex(i).equals(vertex)) return EdgeDirection.fromPosition(i);
        }
        throw new IllegalArgumentException("Relation is not incident on vertex");
    }
201104
public Map<String, String> getUriVariablesForEntityDelete(BullhornEntityInfo entityInfo, Integer id) {
		Map<String, String> uriVariables = new LinkedHashMap<String, String>();
        addModifyingUriVariables(uriVariables, entityInfo);
        uriVariables.put(ID, id.toString());
		return uriVariables;
	}
111056
public Collection<EntityAnnotation> getEntityAnnotations(TextAnnotation ta) {
        Collection<EntityAnnotation> eas = getEntityAnnotations();
        Collection<EntityAnnotation> result = Sets.newHashSet();

        for (EntityAnnotation ea : eas) {
            if (ea.getRelations() != null && ea.getRelations().contains(ta)) {
                result.add(ea);
            }
        }

        return result;
    }
544813
public BoxRequestsShare.DeleteCollaboration getDeleteRequest(String collaborationId) {
        BoxRequestsShare.DeleteCollaboration collab = new BoxRequestsShare.DeleteCollaboration(collaborationId, getCollaborationInfoUrl(collaborationId), mSession);
        return collab;
    }