Returns the uri variables needed for adding a file

@param entityInfo
@param entityId
@param fileMeta
@return
347490
public Map<String, String> getUriVariablesForAddFile(BullhornEntityInfo entityInfo, Integer entityId, FileMeta fileMeta) {
		Map<String, String> uriVariables = fileMeta.getParameterMap();

		String bhRestToken = bullhornApiRest.getBhRestToken();
		uriVariables.put(BH_REST_TOKEN, bhRestToken);
		uriVariables.put(ENTITY_TYPE, entityInfo.getName());
		uriVariables.put(ENTITY_ID, entityId.toString());

		if (fileMeta.getId() != null) {
			uriVariables.put(FILE_ID, fileMeta.getId().toString());
		}

		return uriVariables;
	}
444560
private static String initCreateEntityWithPropertiesQuery(EntityKeyMetadata entityKeyMetadata) {
		StringBuilder queryBuilder = new StringBuilder( "CREATE " );
		queryBuilder.append( "(n:" );
		queryBuilder.append( ENTITY );
		queryBuilder.append( ":" );
		appendLabel( entityKeyMetadata, queryBuilder );
		// We should not pass a map as parameter as Neo4j cannot cache the query plan for it
		queryBuilder.append( " {props})" );
		queryBuilder.append( " RETURN n" );
		return queryBuilder.toString();
	}
929477
public static URI stringAsURI(String s) throws IOException {
    URI u = null;
    // try to make a URI
    try {
      u = new URI(s);
    } catch (URISyntaxException e){
      LOG.error("Syntax error in URI " + s
          + ". Please check hdfs configuration.", e);
    }

    // if URI is null or scheme is undefined, then assume it's file://
    if(u == null || u.getScheme() == null){
      LOG.warn("Path " + s + " should be specified as a URI "
          + "in configuration files. Please update hdfs configuration.");
      u = fileAsURI(new File(s));
    }
    return u;
  }
400445
private static URI toFileSystemUri(URI uri) {
    try {
      return new URI(
          uri.getScheme(), uri.getUserInfo(), uri.getHost(), uri.getPort(), null, null, null);
    } catch (URISyntaxException e) {
      throw new AssertionError(e);
    }
  }
394256
public Map<String, EntityMetadata> getEntityMetadataMap()
    {
        if (entityMetadataMap == null)
        {
            entityMetadataMap = new HashMap<String, EntityMetadata>();
        }
        return entityMetadataMap;
    }
1051483
public void addFile(VariantFileMetadata fileMetadata, String studyId) {
        // Sanity check
        if (fileMetadata == null || StringUtils.isEmpty(fileMetadata.getId())) {
            logger.error("Variant file metadata (or its ID) is null or empty.");
            return;
        }

        VariantStudyMetadata variantStudyMetadata = getVariantStudyMetadata(studyId);
        if (variantStudyMetadata == null) {
            logger.error("Study not found. Check your study ID: '{}'", studyId);
            return;
        }
        if (variantStudyMetadata.getFiles() == null) {
            variantStudyMetadata.setFiles(new ArrayList<>());
        }
        for (VariantFileMetadata file: variantStudyMetadata.getFiles()) {
            if (file.getId() != null && file.getId().equals(fileMetadata.getId())) {
                logger.error("Variant file metadata with id '{}' already exists in study '{}'", fileMetadata.getId(),
                        studyId);
                return;
            }
        }
        // individual management
        if (variantStudyMetadata.getIndividuals() == null) {
            variantStudyMetadata.setIndividuals(new ArrayList<>());
        }
        if (!variantStudyMetadata.getIndividuals().isEmpty()) {
            // check if samples are already in study
            for (String sampleId: fileMetadata.getSampleIds()) {
                for (org.opencb.biodata.models.metadata.Individual individual: variantStudyMetadata.getIndividuals()) {
                    for (Sample sample: individual.getSamples()) {
                        if (sampleId.equals(sample.getId())) {
                            logger.error("Sample '{}' from file {} already exists in study '{}'",
                                    sampleId, fileMetadata.getId(), studyId);
                            return;
                        }
                    }
                }
            }
        }
        // by default, create individuals from sample, and individual ID takes the sample ID
        // TODO: manage multiple samples per individual
        for (String sampleId: fileMetadata.getSampleIds()) {
            List<Sample> samples = new ArrayList<>();
            Sample sample = new Sample();
            sample.setId(sampleId);
            sample.setAnnotations(new HashMap<>());
            samples.add(sample);

            org.opencb.biodata.models.metadata.Individual individual = new org.opencb.biodata.models.metadata.Individual();
            individual.setId(sampleId);
            individual.setSamples(samples);

            variantStudyMetadata.getIndividuals().add(individual);
        }


        variantStudyMetadata.getFiles().add(fileMetadata);
    }
1187377
protected function getEntityAttributeUri(string $entityId, string $name): UriInterface
    {
        $uri = $this->getEntityAttributesUri($entityId)->withPath(
            $this->getEntityAttributesUri($entityId) . '/' . $name
        );

        return $uri;
    }
854718
public Map<String, String> getUriVariablesForEntity(BullhornEntityInfo entityInfo, Integer id, Set<String> fieldSet, EntityParams params) {

		if (params == null) {
			params = ParamFactory.entityParams();
		}

		Map<String, String> uriVariables = params.getParameterMap();
		this.addCommonUriVariables(fieldSet, entityInfo, uriVariables);
		
		uriVariables.put(ID, id == null ? "" : id.toString());
		return uriVariables;
	}
712662
public URI attachmentUri(String documentId, String attachmentId) {
        String base_uri = String.format(
                "%s/%s/%s",
                this.rootUriString,
                this.encodeId(documentId),
                this.encodeId(attachmentId)
        );
        return uriFor(base_uri);
    }
1123327
def add_entity_meta(self, datastream, options, data):
        
        url = '/datastream/' + str(datastream) + '/entityMeta'
        response = self.http.post(url, data)
        entityMetaList = []
        for entityMeta in response:
            entityMetaList.append(Schemas.EntityMeta(entityMeta=entityMeta))
        return entityMetaList
636318
private OWLOntology loadOntologyFromURI(URI uri) throws OWLIOException
    {
        try
        {
            return owlOntologyManager.loadOntologyFromOntologyDocument(IRI.create(uri));
        } catch (OWLOntologyCreationException ex)
        {
            throw new OWLIOException(ioErrorMsg, ex);
        }
    }
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;
	}
656755
public List<MetadataReference> queryByMetadata(long fileId)
			throws SQLException {

		QueryBuilder<MetadataReference, Void> qb = queryBuilder();
		qb.where().eq(MetadataReference.COLUMN_FILE_ID, fileId);
		List<MetadataReference> metadataReferences = qb.query();

		return metadataReferences;
	}
18725
protected void loadSamlMetadataIntoRequestContext(final RequestContext requestContext, final String entityId, final RegisteredService registeredService) {
        LOGGER.debug("Locating SAML MDUI for entity [{}]", entityId);
        val mdui = MetadataUIUtils.locateMetadataUserInterfaceForEntityId(
            this.metadataAdapter, entityId, registeredService, WebUtils.getHttpServletRequestFromExternalWebflowContext(requestContext));
        LOGGER.debug("Located SAML MDUI for entity [{}] as [{}]", entityId, mdui);
        WebUtils.putServiceUserInterfaceMetadata(requestContext, mdui);
    }
332310
def file_url(self, entity_id, filename, channel=None):
        '''
        '''
        url = '{}/{}/archive/{}'.format(self.url, _get_path(entity_id),
                                        filename)
        return _add_channel(url, channel)
86963
public static Observable<String> getPathFromUriForMediaDocument(final Context context,
      final Uri mediaUri, final String mediaDocumentId) {
    return Observable.fromCallable(new Func0<String>() {
      @Override
      public String call() {
        String pathFound = null;
        Cursor cursor = context.getContentResolver()
            .query(mediaUri, null, Constants.ID_COLUMN_VALUE + " =?",
                new String[] { mediaDocumentId }, null);
        if (cursor != null) {
          if (cursor.moveToFirst()) {
            pathFound =
                cursor.getString(cursor.getColumnIndexOrThrow(MediaStore.MediaColumns.DATA));
          }
          cursor.close();
          logDebug("Path found:" + pathFound);
        }
        return pathFound;
      }
    });
  }
416393
private void addEntityID(Map<String, String> requestParameters, StringBuilder uri) {
        if (StringUtils.hasText(requestParameters.get(RequestElements.REQ_PARAM_ENTITY_ID))) {
            uri.append("/").append(requestParameters.get(RequestElements.REQ_PARAM_ENTITY_ID));
        }
    }