EPM_encode_meta_to_xml: Encode Metadata to an XML String.

View source: R/epm_all_fx.R

EPM_encode_meta_to_xmlR Documentation

Encode Metadata to an XML String.

Description

Encode a list of meta information from an easyPubMed object into an XML string. These meta-information are used to keep track of easyPubMed query jobs and/or to re-build objects starting from XML files saved on a local disk.

Usage

EPM_encode_meta_to_xml(meta, job_list, i, encoding)

Arguments

meta

List including metadata associated with an easyPubMed query job. It corresponds to the contents of the 'meta' slot of an easyPubMed object.

job_list

Data.frame that defines the list of sub-queries of an easyPubMed query job. It corresponds to the 'job_list' data.frame included in the 'misc' slot of an easyPubMed object.

i

Integer, index of the batch (query sub-job) being written to file.

encoding

String, this is the Encoding of the contents/text being retrieved from the Entrez server (typically, 'UTF-8').

Value

String, chunck of XML-decorated text including meta information.

Author(s)

Damiano Fantini, damiano.fantini@gmail.com

References

https://www.data-pulse.com/dev_site/easypubmed/

Examples

tmp_meta <- list(max_records_per_batch = 1000, 
                 exp_count = 10, 
                 exp_num_of_batches = 1, 
                 all_records_covered = TRUE, 
                 exp_missed_records = 0, 
                 query_date = "2023-10-16 23:13:29", 
                 UID = 'EPMJ_20231017141741_c4das',
                 EPM_version = "3.01")
tmp_jobs <- data.frame(query_string = 'my test query', 
                       init_date = '1990/01/01', 
                       end_date = '2023/01/01', 
                       diff_days = 12053,
                       exp_count = 10, 
                       stringsAsFactors = FALSE)
easyPubMed:::EPM_encode_meta_to_xml(meta = tmp_meta, job_list = tmp_jobs, 
                                    i = 1, encoding = 'UTF-8' )




dami82/easyPubMed documentation built on Jan. 4, 2024, 6:21 a.m.