diff --git a/.rubocop.yml b/.rubocop.yml index 4b4c293..78bad95 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -13,4 +13,7 @@ Metrics/MethodLength: Enabled: false Metrics/PerceivedComplexity: - Enabled: false \ No newline at end of file + Enabled: false + +AllCops: + NewCops: disable \ No newline at end of file diff --git a/Makefile b/Makefile index 8121def..9a97b1e 100644 --- a/Makefile +++ b/Makefile @@ -1,2 +1,12 @@ build: ## Build the app image - docker build -t datagov/mdtranslator . \ No newline at end of file + docker build -t datagov/mdtranslator . + +start: + rails server -b 0.0.0.0 -p 3000 + +lint: + bundle exec rubocop + +.PHONY: test +test: + rails test \ No newline at end of file diff --git a/app/controllers/translates_controller.rb b/app/controllers/translates_controller.rb index 4be72b9..c42704a 100644 --- a/app/controllers/translates_controller.rb +++ b/app/controllers/translates_controller.rb @@ -70,6 +70,6 @@ def create @response_info[:success] = false unless @md_return[:readerExecutionPass] @response_info[:success] = false unless @md_return[:writerPass] - render json: @response_info + render json: @response_info, status: @response_info[:success] ? 200 : 422 end end diff --git a/test/controllers/translates_controller_test.rb b/test/controllers/translates_controller_test.rb index 49f6d12..ef51565 100644 --- a/test/controllers/translates_controller_test.rb +++ b/test/controllers/translates_controller_test.rb @@ -3,11 +3,17 @@ require 'test_helper' class TranslatesControllerTest < ActionDispatch::IntegrationTest - test 'post transformation of fgdc to iso19115_3' do - @translate = translates(:fgdc_to_iso) - @file = File.read(File.expand_path("../../fixtures/#{@translate.file}", __FILE__)) - post '/translates', params: { translate: { file: @file, - reader: @translate.reader, writer: @translate.writer } }, as: :json + test 'post valid transformation of sbJson to mdJson' do + @translate = translates(:sbjson_to_mdjson) + @file = File.read(File.join(File.dirname(__FILE__), "../fixtures/#{@translate.file}")) + post '/translates', params: { file: @file, reader: @translate.reader, writer: @translate.writer }, as: :json assert_response 200 end + + test 'post invalid transformation of fgdc to iso19115_3' do + @translate = translates(:fgdc_to_iso) + @file = File.read(File.join(File.dirname(__FILE__), "../fixtures/#{@translate.file}")) + post '/translates', params: { file: @file, reader: @translate.reader, writer: @translate.writer }, as: :json + assert_response 422 + end end diff --git a/test/fixtures/files/fgdc.xml b/test/fixtures/files/fgdc.xml new file mode 100644 index 0000000..cf15c36 --- /dev/null +++ b/test/fixtures/files/fgdc.xml @@ -0,0 +1,1021 @@ + + + + + + Robert Wilson (ORCID: 0000-0003-1800-0183) + 201704 + Greater White-Fronted Goose (Anser albifrons) Microsatellite DNA Data, Alaska, 1989-2006 + spreadsheet + + Anchorage, AK + U.S. Geological Survey, Alaska Science Center + + Wilson, R. E., 2017, Greater White-Fronted Goose (Anser albifrons) Microsatellite DNA Data, Alaska, 1989-2006: U.S. Geological Survey data release, https://doi.org/10.5066/F71G0JGN + https://doi.org/10.5066/F71G0JGN + + + Talbot, S.L. + 19980101 + Developing and Applying Molecular Tools to Natural Resource Problems in Alaska + web site + + none + none + + + Anchorage, AK + U.S. Geological Survey, Alaska Science Center + + https://alaska.usgs.gov/portal/project.php?project_id=378 + + + + + + This data set describes nuclear microsatellite genotypes derived from eight autosomal loci (BCA6, BCA9, BCA11, Aaμ1, CRG, OXY13, TSP1.20.09 and TSP1.20.46 ). A total of 115 Greater White-fronted Geese were examined for genotyping with samples coming from the three primary breeding locales within Alaska that represent the Pacific Flyway (Cook Inlet, Bristol Bay Lowlands, and the Yukon Delta, Western Alaska). The sex of most samples was determined in the field. + To examine nuclear microsatellite allele variation and population genetic structure among samples of Greater White-fronted Geese (Anser albifrons) within the Pacific Flyway. + + + + + 1989 + 2006 + + + ground condition + + + Complete + None planned + + + Bristol Bay Lowlands (Alaska), Cook Inlet (Alaska), Yukon-Kuskokwim Delta (Alaska) + + -163.72 + -156.77 + 63.33 + 57.18 + + + + + 1.0 + 1.0 + + + 2.0 + 21.0 + + + 9.0 + 25.0 + + + 10.0 + 6.0 + + + 1.0 + 1.0 + + + + + 6.0 + 10.0 + + + 7.0 + 14.0 + + + 8.0 + 13.0 + + + 8.0 + 7.0 + + + 6.0 + 10.0 + + + + 12.0 3.0, 18.0 4.0, 19.0 5.0, 12.0 5.0, 12.0 3.0 + + + + + + None + population genetic structure + genetic diversity + + + NASA GCMD Earth Science + Biological classification + Animals/vertebrates + Birds + Ducks/Geese/Swans + Terrestrial Ecosystems + + + ISO 19115 Topic Category + Biota + + + MeSH + Genetics, population + Genetic variation + + + CSA Biocomplexity + Molecular biology + Speciation (biological) + Population differentiation + Population genetics + + + Geographic Names Information System + Bristol Bay + Yukon Delta National Wildlife Refuge + Kuskokwim River + Innoko National Wildlife Refuge + Cook Inlet + + + + + Biological Classification + animals + birds + Ducks/Geese/Swans + + + + + + Integrated Taxonomic Information System + 2016 + Integrated Taxonomic Information System + database + + Online + ITIS-North America + + Retrieved (December 12, 2016], from Integrated Taxonomic Information System (ITIS) + https://www.itis.gov/ + + + + + + Ely, Craig R. and A. X. Dzubin + 1994 + Greater White-fronted Goose (Anser albifrons) + website + + The Birds of North America + Macaulay Library ML31124591 + + + Ithaca, New York + Cornell Lab of Ornithology + + https://birdsna.org/Species-Account/bna/species/gwfgoo + + + We identified birds to species following the description in the Identification Reference (Ely, C.R. and A.X. Dzubin 1994). + Taxonomy is complete for all samples. + + blood samples + + + + U.S. Geological Survey Alaska Science Center + + + mailing and physical +
4210 University Drive
+ Anchorage + Alaska + 99508 + USA +
+ 907-786-7000 + ascweb@usgs.gov +
+
+
+ + feather samples + + + + U.S. Geological Survey Alaska Science Center + + + mailing and physical +
4210 University Drive
+ Anchorage + Alaska + 99508 + USA +
+ 907-786-7000 + ascweb@usgs.gov +
+
+
+ + feathers + + + + U.S. Geological Survey Alaska Science Center + + + mailing and physical +
4210 University Drive
+ Anchorage + Alaska + 99508 + USA +
+ 907-786-7000 + ascweb@usgs.gov +
+
+
+ + muscle samples + + + + U.S. Geological Survey Alaska Science Center + + + mailing and physical +
4210 University Drive
+ Anchorage + Alaska + 99508 + USA +
+ 907-786-7000 + ascweb@usgs.gov +
+
+
+ + muscle sample + + + + U.S. Geological Survey Alaska Science Center + + + mailing and physical +
4210 University Drive
+ Anchorage + Alaska + 99508 + USA +
+ 907-786-7000 + ascweb@usgs.gov +
+
+
+
+ + Kingdom + Animalia + + Phylum + Chordata + + Subphylum + Vertebrata + + Superclass + Tetrapoda + + Class + Aves + + Family + Anatidae + + Subfamily + Anatinae + + Genus + Anser + + Species + albifrons + + + + + + + + + +
+ None + If you use these data in a publication, presentation, or other product please use the citation below to credit the authors for their contribution to your work. It is strongly recommended that careful attention be paid to the contents of the metadata file associated with these data to evaluate data set limitations, restrictions or intended use. + + + + U.S. Geological Survey, Alaska Science Center + + + mailing and physical +
4210 University Drive
+ Anchorage + Alaska + 99508 + USA +
+ 907-786-7000 + ascweb@usgs.gov +
+
+ + + Ely, C. R. + Wilson, R.E. + Talbot, S.L. + 20170322 + Genetic structure among greater white-fronted goose populations of the Pacific Flyway + journal article + + Ecology and Evolution + 2017; 00.1-13 + + + Online + John Wiley & Sons, Ltd + + Ely CR, Wilson RE, Talbot SL. Genetic structure among greater white-fronted goose populations of the Pacific Flyway. Ecol Evol. 2017;00:1–13. + https://doi.org/10.1002/ece3.2934 + + +
+ + + To ensure quality of allele scores, For quality control purposes all genotypes were scored releative to M13 DNA sequence ladders and known size standards run on each gel. , Additionally, ten percent of the samples were amplified and genotyped in duplicate for the 8 microsatellite loci to double-check genotype scores. Final genotype scores were reviewed by a second laboratory specialist. + + We calculated allelic richness, the inbreeding coefficient (FIS), observed and expected heterozygosities, Hardy–Weinberg equilibrium (HWE), and linkage disequilibrium (LD) for each microsatellite locus and population. Molecular diversity indices were similar across populations with allelic richness (r) ranging from 4.8 to 5.4. Observed heterozygosity ranged from 58.4% to 61.4% for each population with an overall value of 59.6%. The inbreeding coefficient (FIS) ranged from 0.050 to 0.082 across sampled sites with an overall mean of 0.063; no FIS value differed significantly from zero. All populations were in HWE, and no signature of linkage disequilibrium was detected between any pair of loci. + For the 8 microsatellite loci attributes, the code “np” signifies a sample that did not amplify or show any product. + + + No formal positional accuracy tests were conducted. The coordinates of samples are for general purposes only. The coordinates only designate a general regional location for each population and should not be considered at exact location of each sample. Coordinates were determined in Google Earth by searching general location information. For example, Hook Lagoon, Alaska Peninsula was searched and the coordinates from google earth was assigned to those samples. + + + + + Lab + Genotype numbers were determined by scoring based on allele size relative to an M13 DNA sequence ladder and to samples established as size standards that were run on each gel. The code “np” in a cell of the data set refers to a sample that did not amplify or show any product (“no product”). + + + Sonsthagen, S.A. + Talbot, S.L. + White, C.M. + 2004 + Gene flow and genetic characterization of Northern Goshawks breeding in Utah. + journal article + Sonsthagen et al. (2004; Sonsthagen, S.A., Talbot, S.L., and White, C.M. 2004. Gene flow and genetic characterization of Northern Goshawks breeding in Utah. Condor 106:826–836.). + http://www.jstor.org/stable/3247787?seq=1#page_scan_tab_contents + + + + + No process steps have been described for this data set + Unknown + + + + + Point + + + + + 0.01 + 0.01 + Decimal degrees + + + World Geodetic System of 1984 + World Geodetic System of 1984 + 6378137 + 298.257223563 + + + + + + + Greater White-fronted Goose sample and microsatellite genotype data + Description of sample type, age, sex, collection date, and location and values for eight autosomal loci (Bca6, Bca9, Bca11, CRG, Aaμ1OXY13, TSP 1.20.09, and TSP1.20.46) were used to generate genotype data and describe genetic diversity and structure. + Author defined + + + Id No + Identifying number for the sample. + Author defined + + No domain identified + + + + Id Type + Description of the Id no. field by type. A combination of population code (A: Bristol Bay Lowlands, B: Cook Inlet, H: Yukon–Kuskokwim Delta), species code (GWFG: Greater White-fronted Goose), locality codes, nest number, year, specimen preparator initials, last 2 digits of USGS metal leg band number, or collar number. These codes uniquely identified the sample. + Author defined + + Description of the Id no. field by type. A combination of population code (A: Bristol Bay Lowlands, B: Cook Inlet, H: Yukon–Kuskokwim Delta), species code (GWFG: Greater White-fronted Goose), locality codes, nest number, year, specimen preparator initials, last 2 digits of USGS metal leg band number, or collar number. These codes uniquely identified the sample. + + + + Sample Type + Identification of type of biological sample taken. + Author defined + + + Blood + Taken from the captured or collected bird. + Author defined + + + + + nest feather + Collected from a nest. + Author defined + + + + + Muscle tissue + Collected from a bird carcass. + Author defined + + + + + USGS band number + USGS band number on metal tarsus (leg) band has a unique number on each band assigned by the Bird Banding Lab, Patuxent Wildlife Research Center, Patuxent, Maryland. Each individual has a unique metal leg band that identifies each bird. Each band remains on the bird; bands are only removed if not legible. Bands generally begin with a 3-4 digit prefix followed by a 5 digit suffix, e.g., 1347.59381. + USGS Bird Banding Laboratory, Patuxent Wildlife Research Center + + + 0618-05583 + 5037-01858 + + + + + none + No USGS band was placed on the bird + Author defined + + + + + Location Name + Sampling location of bird for genetic sample + Author defined + + + Alaska: Bristol Bay Lowlands, Nushugak Peninsula + Region and specific collection location by name. + Author defined + + + + + Alaska: Bristol Bay Lowlands, Hook Lagoon + Region and specific collection location by name. + Author defined. + + + + + Alaska: Cook Inlet + Region and specific collection location by name. + Author defined. + + + + + Alaska: Innoko + Region and specific collection location by name. These samples were fitted with transmitter and were assigned to Cook Inlet based on movement data. + Author defined. + + + + + Alaska: Yukon–Kuskokwim Delta + Region and specific collection location by name. + Author defined. + + + + + Latitude + Latitude of bird capture location. These are general region coordinates taken from Google Earth and are not exact location of samples. Coordinates are expressed as North latitude, decimal degrees, WGS84 datum. + Author defined + + + 58.86 + 63.33 + + + + + Longitude + Longitude of bird capture location. These are general region coordinates taken from Google Earth and are not exact location of samples. Coordinates are expressed as East or West longitude, decimal degrees, WGS84 datum. + Author defined + + + -164.6 + -152.47 + + + + + Collection Date + Date the genetic sample was taken in the field. When exact day and month are unknown, only the year is given. + Author defined + + + 1989 + 2006 + + + + + Age + Age (year Class) Codes specified by the USGS, Bird Banding Laboratory, Patuxent Wildlife Research Center. + USGS Bird Banding Laboratory, Patuxent Wildlife Research Center + + + HY + Hatch year: sample collected during the summer or fall in the hatch year of the bird + Author defined + + + + + Adult + Bird is of adult age (>1 year of age) + Author defined + + + + + ASY + After Second Year: A bird known to have hatched earlier than the calendar year preceeding the year of banding; year of hatch otherwise unknown. + USGS Bird Banding Laboratory + + + + + SY + Second Year: A bird known to have hatched in the calendar year preceding the year of banding and in its second calendar year of life. + USGS Bird Banding Laboratory + + + + + AHY + After hatch year: A bird known to have hatched before the calendar year of banding; year of hatch otherwise unknown. + USGS Bird Banding Laboratory + + + + + Sex + Sex of the sampled goose + Author defined + + + Male + Bird is male based on one or two sex verification methods + Author defined + + + + + Female + Bird is female based on one or two sex verification methods + Author defined + + + + + Sex verification method + Sex of the sampled goose was determined in the field based on morphological characteristics of the bird. + Ely, C.R., A.D. Fox, R. T. Alisaukas, A. Andreev A., R. G. Bromley, A. G. Degtyarev, B. Ebbinge, E. N. Gurtovaya, R. Kerbes, A. V. Kondratyev, I. Kostin, A. V. Krechmar, K. Litvin, Y. Miyabayashi, J. H. Mooij, R. M. Oates, D. L. Orthmeyer, Y. Sabano, S. G. Simpson, D. V. Solovieva, M. A. Spindler, Ye .V. Syroechkovsky, J.Y. Takekawa, and A. Walsh. 2005. Circumpolar variation in morphological characteristics of Greater White-fronted Geese (Anser albifrons). Bird Study 52: 104–119. + In addition, some samples were prepared as museum skins (CPD) and the presence of testes or ovaries were used to verify sex. + Author defined and Ely et al. (2005) + + + In Field + Sex was determined in the field using morphological characteristics. + Author defined and Sex of the sampled goose was determined in the field based on morphological characteristics of the bird. + Ely, C.R., A.D. Fox, R. T. Alisaukas, A. Andreev A., R. G. Bromley, A. G. Degtyarev, B. Ebbinge, E. N. Gurtovaya, R. Kerbes, A. V. Kondratyev, I. Kostin, A. V. Krechmar, K. Litvin, Y. Miyabayashi, J. H. Mooij, R. M. Oates, D. L. Orthmeyer, Y. Sabano, S. G. Simpson, D. V. Solovieva, M. A. Spindler, Ye .V. Syroechkovsky, J.Y. Takekawa, and A. Walsh. 2005. Circumpolar variation in morphological characteristics of Greater White-fronted Geese (Anser albifrons). Bird Study 52: 104–119. + + + + + Testes detected + Sex was determined by the presence of testes during preparation of museum round skin + Author defined. + + + + + Ovaries detected + Sex was determined by the presernce of ovaries during preparation of a museum round skin. + Author defined. + + + + + Transmitter + Indicates if goose was fitted with a transmitter. Geese fitted with transmitter in Innoko were tracked to California during winter and Cook Inlet and therefore were assigned to Cook Inlet population. + Author defined + + + Yes + Goose associated with the sample was fitted with a satellite transmitter. + Author defined. + + + + + No + Goose associated with the sample was not fitted with a satellite transmitter. + Author defined. + + + + + BCA6_Allele1 + Microsatellite allele one from the BCA6 locus. + Author defined + + + 140 + 148 + base pairs + + + + + np + No Product: The code “np” in a cell of the data set refers to a sample that did not amplify or show any product. + Author defined + + + + + BCA6_Allele2 + Microsatellite allele two from the BCA6 locus + Author defined. + + + np + No Product: The code “np” in a cell of the data set refers to a sample that did not amplify or show any product. + Author defined + + + + + 140 + 148 + base pairs + + + + + BCA9_Allele1 + Microsatellite allele one from the BCA9 locus. + Author defined. + + + np + No Product: The code “np” in a cell of the data set refers to a sample that did not amplify or show any product. + Author defined + + + + + 101 + 111 + base pairs + + + + + BCA9_Allele2 + Microsatellite allele two from the BCA9 locus + Author defined. + + + np + No Product: The code “np” in a cell of the data set refers to a sample that did not amplify or show any product. + Author defined + + + + + 101 + 111 + base pairs + + + + + Bca11_Allele1 + Microsatellite allele one from the Bca11 locus. + Author defined + + + 137 + 145 + base pairs + + + + + np + No Product: The code “np” in a cell of the data set refers to a sample that did not amplify or show any product. + Author defined + + + + + Bca11_Allele2 + Microsatellite allele two from the Bca11 locus. + Author defined + + + np + No Product: The code “np” in a cell of the data set refers to a sample that did not amplify or show any product. + Author defined + + + + + 137 + 145 + base pairs + + + + + CRG_Allele1 + Microsatellite allele one from the CRG locus. + Author defined + + + np + No Product: The code “np” in a cell of the data set refers to a sample that did not amplify or show any product. + Author defined + + + + + 163 + 167 + base pairs + + + + + CRG_Allele2 + Microsatellite allele two from the CRG locus. + Author defined + + + 163 + 167 + base pairs + + + + + np + No Product: The code “np” in a cell of the data set refers to a sample that did not amplify or show any product. + Author defined + + + + + Aaμ1_Allele1 + Microsatellite allele one from the Aaμ1 locus. + Author defined + + + 79 + 91 + + + + + np + No Product: The code “np” in a cell of the data set refers to a sample that did not amplify or show any product. + Author defined + + + + + Aaμ1_Allele2 + Microsatellite allele two from the Aaμ1 locus. + Author defined + + + 81 + 111 + + + + + np + No Product: The code “np” in a cell of the data set refers to a sample that did not amplify or show any product. + Author defined + + + + + OXY13_Allele1 + Microsatellite allele one from the OXY13 locus. + Author defined + + + 166 + 202 + + + + + np + No Product: The code “np” in a cell of the data set refers to a sample that did not amplify or show any product. + Author defined + + + + + OXY13_Allele2 + Microsatellite allele two from the OXY13 locus + Author defined + + + np + No Product: The code “np” in a cell of the data set refers to a sample that did not amplify or show any product. + Author defined + + + + + 170 + 214 + + + + + TSP1.20.09_Allele1 + Microsatellite allele one from the TSP 1.20.09 locus. + Author defined. + + + 112 + 126 + + + + + TSP1.20.09_Allele2 + Microsatellite allele two from the TSP 1.20.09 locus. + Author defined + + + 114 + 126 + + + + + TSP1.20.46_Allele1 + Microsatellite allele one from the TSP 1.20.46 locus. + Author defined + + + 156 + 172 + + + + + np + No Product: The code “np” in a cell of the data set refers to a sample that did not amplify or show any product. + Author defined + + + + + TSP1.20.46_Allele2 + Microsatellite allele two from the TSP1.20.46 locus. + Author defined + + + 162 + 172 + + + + + np + No Product: The code “np” in a cell of the data set refers to a sample that did not amplify or show any product. + Author defined + + + + + + + + + + U.S. Geological Survey, Alaska Science Center + + + mailing and physical +
4210 University Dr.
+ Anchorage + Alaska + 99508 + USA +
+ 907-786-7000 + ascweb@usgs.gov +
+
+ Authoritative source for access to data. + Unless otherwise stated, all data, metadata and related materials are considered to satisfy the quality standards relative to the purpose for which the data were collected. Although these data and associated metadata have been reviewed for accuracy and completeness and approved for release by the U.S. Geological Survey (USGS), no warranty expressed or implied is made regarding the display or utility of the data on any other system or for general or scientific purposes, nor shall the act of distribution constitute any such warranty + + + + Zip + 19.0 + No compression applied + 0.34 + + + + + + http://dx.doi.org/10.5066/F71G0JGN + + + + + + No fees. + +
+ + 20160908 + + + + U.S. Geological Survey Alaska Science Center + + + mailing +
P.O. Box 1449
+ Anchorage + Alaska + 99510-1449 + USA +
+ 800-222-1212 + webmaster.asc.usgs@usgs.gov +
+
+ FGDC Biological Data Profile of the Content Standard for Digital Geospatial Metadata + FGDC-STD-001.1-1999 + + None + Unclassified + None + +
+
diff --git a/test/fixtures/files/sbJson.json b/test/fixtures/files/sbJson.json new file mode 100644 index 0000000..e3e3ce4 --- /dev/null +++ b/test/fixtures/files/sbJson.json @@ -0,0 +1,643 @@ +{ + "link": { + "rel": "self", + "url": "https://www.sciencebase.gov/catalog/item/57d97341e4b090824ffb0e6f" + }, + "relatedItems": { + "link": { + "url": "https://www.sciencebase.gov/catalog/itemLinks?itemId=57d97341e4b090824ffb0e6f", + "rel": "related" + } + }, + "id": "57d97341e4b090824ffb0e6f", + "title": "Spatial data: A large-scale database of modeled contemporary and future water temperature data for 10,774 Michigan, Minnesota and Wisconsin Lakes", + "summary": "Climate change has been shown to influence lake temperatures globally. To better understand the diversity of lake responses to climate change and give managers tools to manage individual lakes, we modelled daily water temperature profiles for 10,774 lakes in Michigan, Minnesota and Wisconsin for contemporary (1979-2015) and future (2020-2040 and 2080-2100) time periods with climate models based on the Representative Concentration Pathway 8.5, the worst-case emission scenario. From simulated temperatures, we derived commonly used, ecologically relevant annual metrics of thermal conditions for each lake. We included all available supporting metadata including satellite and in-situ observations of water clarity, maximum observed lake [...]", + "body": "Climate change has been shown to influence lake temperatures globally. To better understand the diversity of lake responses to climate change and give managers tools to manage individual lakes, we modelled daily water temperature profiles for 10,774 lakes in Michigan, Minnesota and Wisconsin for contemporary (1979-2015) and future (2020-2040 and 2080-2100) time periods with climate models based on the Representative Concentration Pathway 8.5, the worst-case emission scenario. From simulated temperatures, we derived commonly used, ecologically relevant annual metrics of thermal conditions for each lake. We included all available supporting metadata including satellite and in-situ observations of water clarity, maximum observed lake depth, land-cover based estimates of surrounding canopy height and observed water temperature profiles (used here for validation). This unique dataset offers landscape-level insight into the future impact of climate change on lakes. This data set contains the following parameters: site_id, Prmnn_I, GNIS_ID, GNIS_Nm, ReachCd, FType, FCode, which are defined below.", + "citation": "Winslow, L.A., Hansen, G.J.A., and Read, J.S., 2017, Data release: A large-scale database of modeled contemporary and future water temperature data for 10,774 Michigan, Minnesota and Wisconsin Lakes: U.S. Geological Survey, http://dx.doi.org/10.5066/F7DV1H10.", + "purpose": "Fisheries biology, limnological research, and climate science.", + "provenance": { + "dataSource": "Input directly", + "dateCreated": "2016-09-14T15:56:49Z", + "lastUpdated": "2017-04-06T20:04:58Z" + }, + "maintenanceUpdateFrequency": "none planned", + "hasChildren": false, + "parentId": "57c5c793e4b0f2f0cebdaa4d", + "contacts": [ + { + "name": "Jordan S Read", + "oldPartyId": 60525, + "type": "Point of Contact", + "contactType": "person", + "email": "jread@usgs.gov", + "active": true, + "jobTitle": "Civil Engineer", + "firstName": "Jordan", + "middleName": "S", + "lastName": "Read", + "organization": { + "displayText": "Office of Water Information" + }, + "primaryLocation": { + "name": "Jordan S Read/WRD/USGS/DOI - Primary Location", + "building": "8505 Research Way", + "buildingCode": "ARM", + "officePhone": "6088213922", + "faxPhone": "6088213817", + "streetAddress": { + "line1": "8505 Research Way", + "city": "Middleton", + "state": "WI", + "zip": "53562" + }, + "mailAddress": { + "line1": "8505 Research Way", + "city": "Middleton", + "state": "WI", + "zip": "53562-3581", + "country": "USA" + } + } + }, + { + "name": "Luke A. Winslow", + "type": "Originator", + "contactType": "person", + "organization": {}, + "primaryLocation": { + "streetAddress": {}, + "mailAddress": {} + } + }, + { + "name": "Gretchen J.A. Hansen", + "type": "Originator", + "contactType": "person", + "organization": {}, + "primaryLocation": { + "streetAddress": {}, + "mailAddress": {} + } + }, + { + "name": "Jordan S Read", + "oldPartyId": 60525, + "type": "Originator", + "contactType": "person", + "email": "jread@usgs.gov", + "active": true, + "jobTitle": "Civil Engineer", + "firstName": "Jordan", + "middleName": "S", + "lastName": "Read", + "organization": { + "displayText": "Office of Water Information" + }, + "primaryLocation": { + "name": "Jordan S Read/WRD/USGS/DOI - Primary Location", + "building": "8505 Research Way", + "buildingCode": "ARM", + "officePhone": "6088213922", + "faxPhone": "6088213817", + "streetAddress": { + "line1": "8505 Research Way", + "city": "Middleton", + "state": "WI", + "zip": "53562" + }, + "mailAddress": { + "line1": "8505 Research Way", + "city": "Middleton", + "state": "WI", + "zip": "53562-3581", + "country": "USA" + } + } + }, + { + "name": "Jordan S Read", + "oldPartyId": 60525, + "type": "Metadata Contact", + "contactType": "person", + "email": "jread@usgs.gov", + "active": true, + "jobTitle": "Civil Engineer", + "firstName": "Jordan", + "middleName": "S", + "lastName": "Read", + "organization": { + "displayText": "Office of Water Information" + }, + "primaryLocation": { + "name": "Jordan S Read/WRD/USGS/DOI - Primary Location", + "building": "8505 Research Way", + "buildingCode": "ARM", + "officePhone": "6088213922", + "faxPhone": "6088213817", + "streetAddress": { + "line1": "8505 Research Way", + "city": "Middleton", + "state": "WI", + "zip": "53562" + }, + "mailAddress": { + "line1": "8505 Research Way", + "city": "Middleton", + "state": "WI", + "zip": "53562-3581", + "country": "USA" + } + } + }, + { + "name": "Jordan S Read", + "oldPartyId": 60525, + "type": "Distributor", + "contactType": "person", + "email": "jread@usgs.gov", + "active": true, + "jobTitle": "Civil Engineer", + "firstName": "Jordan", + "middleName": "S", + "lastName": "Read", + "organization": { + "displayText": "Office of Water Information" + }, + "primaryLocation": { + "name": "Jordan S Read/WRD/USGS/DOI - Primary Location", + "building": "8505 Research Way", + "buildingCode": "ARM", + "officePhone": "6088213922", + "faxPhone": "6088213817", + "streetAddress": { + "line1": "8505 Research Way", + "city": "Middleton", + "state": "WI", + "zip": "53562" + }, + "mailAddress": { + "line1": "8505 Research Way", + "city": "Middleton", + "state": "WI", + "zip": "53562-3581", + "country": "USA" + } + } + }, + { + "name": "U.S. Geological Survey - ScienceBase", + "oldPartyId": 70157, + "type": "Distributor", + "contactType": "organization", + "onlineResource": "https://www.sciencebase.gov", + "email": "sciencebase@usgs.gov", + "organization": {}, + "primaryLocation": { + "name": "U.S. Geological Survey - ScienceBase - Location", + "officePhone": "18882758747", + "streetAddress": {}, + "mailAddress": { + "line1": "Denver Federal Center", + "line2": "Building 810", + "mailStopCode": "302", + "city": "Denver", + "state": "CO", + "zip": "80225", + "country": "United States" + } + } + } + ], + "webLinks": [ + { + "type": "webLink", + "typeLabel": "Web Link", + "uri": "http://dx.doi.org/10.5066/F7DV1H10", + "rel": "related", + "hidden": false + } + ], + "browseCategories": [ + "Data" + ], + "browseTypes": [ + "Citation", + "Shapefile", + "Downloadable", + "Map Service", + "OGC WMS Layer", + "OGC WFS Layer" + ], + "systemTypes": [ + "Downloadable", + "Mappable" + ], + "tags": [ + { + "type": "Theme", + "scheme": "none", + "name": "water" + }, + { + "type": "Theme", + "scheme": "none", + "name": "temperate lakes" + }, + { + "type": "Theme", + "scheme": "none", + "name": "reservoirs" + }, + { + "type": "Theme", + "scheme": "none", + "name": "modeling" + }, + { + "type": "Theme", + "scheme": "none", + "name": "climate change" + }, + { + "type": "Theme", + "scheme": "none", + "name": "thermal profiles" + }, + { + "type": "Theme", + "scheme": "ISO 19115 Topic Category", + "name": "environment" + }, + { + "type": "Theme", + "scheme": "ISO 19115 Topic Category", + "name": "inlandWaters" + }, + { + "type": "Theme", + "scheme": "ISO 19115 Topic Category", + "name": "007" + }, + { + "type": "Theme", + "scheme": "ISO 19115 Topic Category", + "name": "012" + }, + { + "type": "Place", + "scheme": "Department of Commerce, 1995, Countries, Dependencies, Areas of Special Sovereignty, and Their Principal Administrative Divisions, Federal Information Processing Standard (FIPS) 10-4, Washington, D.C., National Institute of Standards and Technology", + "name": "United States" + }, + { + "type": "Place", + "scheme": "Department of Commerce, 1995, Countries, Dependencies, Areas of Special Sovereignty, and Their Principal Administrative Divisions, Federal Information Processing Standard (FIPS) 10-4, Washington, D.C., National Institute of Standards and Technology", + "name": "US" + }, + { + "type": "Place", + "scheme": "U.S. Department of Commerce, 1987, Codes for the identification of the States, the District of Columbia and the outlying areas of the United States, and associated areas (Federal Information Processing Standard 5-2): Washington, D. C., NIST", + "name": "Illinois" + }, + { + "type": "Place", + "scheme": "U.S. Department of Commerce, 1987, Codes for the identification of the States, the District of Columbia and the outlying areas of the United States, and associated areas (Federal Information Processing Standard 5-2): Washington, D. C., NIST", + "name": "IL" + }, + { + "type": "Place", + "scheme": "U.S. Department of Commerce, 1987, Codes for the identification of the States, the District of Columbia and the outlying areas of the United States, and associated areas (Federal Information Processing Standard 5-2): Washington, D. C., NIST", + "name": "Indiana" + }, + { + "type": "Place", + "scheme": "U.S. Department of Commerce, 1987, Codes for the identification of the States, the District of Columbia and the outlying areas of the United States, and associated areas (Federal Information Processing Standard 5-2): Washington, D. C., NIST", + "name": "IN" + }, + { + "type": "Place", + "scheme": "U.S. Department of Commerce, 1987, Codes for the identification of the States, the District of Columbia and the outlying areas of the United States, and associated areas (Federal Information Processing Standard 5-2): Washington, D. C., NIST", + "name": "Iowa" + }, + { + "type": "Place", + "scheme": "U.S. Department of Commerce, 1987, Codes for the identification of the States, the District of Columbia and the outlying areas of the United States, and associated areas (Federal Information Processing Standard 5-2): Washington, D. C., NIST", + "name": "IA" + }, + { + "type": "Place", + "scheme": "U.S. Department of Commerce, 1987, Codes for the identification of the States, the District of Columbia and the outlying areas of the United States, and associated areas (Federal Information Processing Standard 5-2): Washington, D. C., NIST", + "name": "Michigan" + }, + { + "type": "Place", + "scheme": "U.S. Department of Commerce, 1987, Codes for the identification of the States, the District of Columbia and the outlying areas of the United States, and associated areas (Federal Information Processing Standard 5-2): Washington, D. C., NIST", + "name": "MI" + }, + { + "type": "Place", + "scheme": "U.S. Department of Commerce, 1987, Codes for the identification of the States, the District of Columbia and the outlying areas of the United States, and associated areas (Federal Information Processing Standard 5-2): Washington, D. C., NIST", + "name": "Minnesota" + }, + { + "type": "Place", + "scheme": "U.S. Department of Commerce, 1987, Codes for the identification of the States, the District of Columbia and the outlying areas of the United States, and associated areas (Federal Information Processing Standard 5-2): Washington, D. C., NIST", + "name": "MN" + }, + { + "type": "Place", + "scheme": "U.S. Department of Commerce, 1987, Codes for the identification of the States, the District of Columbia and the outlying areas of the United States, and associated areas (Federal Information Processing Standard 5-2): Washington, D. C., NIST", + "name": "South Dakota" + }, + { + "type": "Place", + "scheme": "U.S. Department of Commerce, 1987, Codes for the identification of the States, the District of Columbia and the outlying areas of the United States, and associated areas (Federal Information Processing Standard 5-2): Washington, D. C., NIST", + "name": "SD" + }, + { + "type": "Place", + "scheme": "U.S. Department of Commerce, 1987, Codes for the identification of the States, the District of Columbia and the outlying areas of the United States, and associated areas (Federal Information Processing Standard 5-2): Washington, D. C., NIST", + "name": "Wisconsin" + }, + { + "type": "Place", + "scheme": "U.S. Department of Commerce, 1987, Codes for the identification of the States, the District of Columbia and the outlying areas of the United States, and associated areas (Federal Information Processing Standard 5-2): Washington, D. C., NIST", + "name": "WI" + }, + { + "type": "Place", + "scheme": "none", + "name": "Illinois" + }, + { + "type": "Place", + "scheme": "none", + "name": "Indiana" + }, + { + "type": "Place", + "scheme": "none", + "name": "Iowa" + }, + { + "type": "Place", + "scheme": "none", + "name": "Michigan" + }, + { + "type": "Place", + "scheme": "none", + "name": "Minnesota" + }, + { + "type": "Place", + "scheme": "none", + "name": "South Dakota" + }, + { + "type": "Place", + "scheme": "none", + "name": "Wisconsin" + }, + { + "type": "Organization", + "scheme": "https://www.sciencebase.gov/vocab/category/NCCWSC/Project/OrganizationName", + "name": "Northeast CSC" + }, + { + "type": "Water and Ice", + "scheme": "https://www.sciencebase.gov/vocab/category/NCCWSC/WaterandIce", + "name": "Rivers, Streams and Lakes" + }, + { + "type": "Wildlife and Plants", + "scheme": "https://www.sciencebase.gov/vocab/category/NCCWSC/WildlifeandPlants", + "name": "Fish" + }, + { + "type": "Education, Modeling and Tools", + "scheme": "https://www.sciencebase.gov/vocab/category/NCCWSC/EducationModelingandTools", + "name": "Climate and Ecosystem Modeling" + } + ], + "dates": [ + { + "type": "Publication", + "dateString": "2017", + "label": "Publication Date" + } + ], + "extents": [ + 2005798 + ], + "spatial": { + "boundingBox": { + "minX": -96.8589114267623, + "maxX": -83.0573307815185, + "minY": 41.7553570685206, + "maxY": 48.7289513243629 + } + }, + "facets": [ + { + "boundingBox": { + "minY": 41.75535706852064, + "minX": -96.8589114267623, + "maxY": 48.7289513243629, + "maxX": -83.05733078151846 + }, + "name": "model_lakes", + "files": [ + { + "name": "model_lakes.dbf", + "title": "", + "contentType": "text/plain", + "contentEncoding": null, + "pathOnDisk": "__disk__98/59/78/985978b6ad99cf3aa7c64ae8672ef206596c7932", + "processed": false, + "processToken": null, + "imageWidth": null, + "imageHeight": null, + "size": 4514563, + "dateUploaded": "2016-09-21T17:33:14Z", + "originalMetadata": false, + "useForPreview": false, + "s3Object": null, + "checksum": { + "value": "68e69f7acdf8863c24c41e170439c6bd", + "type": "MD5" + }, + "url": "https://www.sciencebase.gov/catalog/file/get/57d97341e4b090824ffb0e6f?f=__disk__98%2F59%2F78%2F985978b6ad99cf3aa7c64ae8672ef206596c7932" + }, + { + "name": "model_lakes.prj", + "title": "", + "contentType": "text/plain", + "contentEncoding": null, + "pathOnDisk": "__disk__1e/b6/60/1eb66069032d913f5cb4e11981df915aaac30ee9", + "processed": false, + "processToken": null, + "imageWidth": null, + "imageHeight": null, + "size": 143, + "dateUploaded": "2016-09-21T17:33:00Z", + "originalMetadata": false, + "useForPreview": false, + "s3Object": null, + "checksum": { + "value": "e729936bf5360b37a15365fc295a1901", + "type": "MD5" + }, + "url": "https://www.sciencebase.gov/catalog/file/get/57d97341e4b090824ffb0e6f?f=__disk__1e%2Fb6%2F60%2F1eb66069032d913f5cb4e11981df915aaac30ee9" + }, + { + "name": "model_lakes.shp", + "title": "", + "contentType": "x-gis/x-shapefile", + "contentEncoding": null, + "pathOnDisk": "__disk__98/b6/d0/98b6d0c9d23acedcff1e100d2c000f0eeb1989da", + "processed": false, + "processToken": null, + "imageWidth": null, + "imageHeight": null, + "size": 14672824, + "dateUploaded": "2016-09-21T17:33:52Z", + "originalMetadata": false, + "useForPreview": false, + "s3Object": null, + "checksum": { + "value": "62e28a413faf5a462e56a00e399e62ce", + "type": "MD5" + }, + "url": "https://www.sciencebase.gov/catalog/file/get/57d97341e4b090824ffb0e6f?f=__disk__98%2Fb6%2Fd0%2F98b6d0c9d23acedcff1e100d2c000f0eeb1989da" + }, + { + "name": "model_lakes.shx", + "title": "", + "contentType": "x-gis/x-shapefile", + "contentEncoding": null, + "pathOnDisk": "__disk__b8/cc/a4/b8cca4e0eb80d7e29c015c4c70f92ee713b4e7f5", + "processed": false, + "processToken": null, + "imageWidth": null, + "imageHeight": null, + "size": 86292, + "dateUploaded": "2016-09-21T17:33:00Z", + "originalMetadata": false, + "useForPreview": false, + "s3Object": null, + "checksum": { + "value": "5fcc0a715c528bc406a5113b2e19f88a", + "type": "MD5" + }, + "url": "https://www.sciencebase.gov/catalog/file/get/57d97341e4b090824ffb0e6f?f=__disk__b8%2Fcc%2Fa4%2Fb8cca4e0eb80d7e29c015c4c70f92ee713b4e7f5" + } + ], + "nativeCrs": "EPSG:4326", + "geometryType": "MultiPolygon", + "className": "gov.sciencebase.catalog.item.facet.ShapefileFacet" + } + ], + "files": [ + { + "name": "lakes.xml", + "title": "", + "contentType": "application/fgdc+xml", + "contentEncoding": null, + "pathOnDisk": "__disk__39/d3/47/39d34798e98207b20ef2048d36045523e31fdde8", + "processed": false, + "processToken": null, + "imageWidth": null, + "imageHeight": null, + "size": 16697, + "dateUploaded": "2017-03-13T16:09:22Z", + "originalMetadata": true, + "useForPreview": false, + "s3Object": null, + "checksum": { + "value": "146dcfb91fdaa9ef0a41099c457119be", + "type": "MD5" + }, + "url": "https://www.sciencebase.gov/catalog/file/get/57d97341e4b090824ffb0e6f?f=__disk__39%2Fd3%2F47%2F39d34798e98207b20ef2048d36045523e31fdde8" + } + ], + "distributionLinks": [ + { + "uri": "https://www.sciencebase.gov/catalogMaps/mapping/ows/57d97341e4b090824ffb0e6f?mode=download&request=kml&service=wms&layers=model_lakes", + "title": "KML Service", + "type": "kml", + "typeLabel": "KML Download", + "rel": "alternate", + "name": "", + "files": "" + }, + { + "uri": "https://www.sciencebase.gov/catalogMaps/mapping/ows/57d97341e4b090824ffb0e6f?service=wms&request=getcapabilities&version=1.3.0", + "title": "ScienceBase WMS Service", + "type": "serviceCapabilitiesUrl", + "typeLabel": "OGC Service Capabilities URL", + "rel": "alternate", + "name": "", + "files": "" + }, + { + "uri": "https://www.sciencebase.gov/catalogMaps/mapping/ows/57d97341e4b090824ffb0e6f?service=wfs&request=getcapabilities&version=1.0.0", + "title": "ScienceBase WFS Service", + "type": "serviceCapabilitiesUrl", + "typeLabel": "OGC Service Capabilities URL", + "rel": "alternate", + "name": "", + "files": "" + }, + { + "uri": "https://www.sciencebase.gov/catalog/file/get/57d97341e4b090824ffb0e6f", + "title": "Download Attached Files", + "type": "downloadLink", + "typeLabel": "Download Link", + "rel": "alternate", + "name": "Spatialdata_Ala.zip", + "files": [ + { + "name": "model_lakes.dbf", + "title": "", + "contentType": "text/plain" + }, + { + "name": "model_lakes.prj", + "title": "", + "contentType": "text/plain" + }, + { + "name": "model_lakes.shp", + "title": "", + "contentType": "x-gis/x-shapefile" + }, + { + "name": "model_lakes.shx", + "title": "", + "contentType": "x-gis/x-shapefile" + }, + { + "name": "lakes.xml", + "title": "", + "contentType": "application/fgdc+xml" + } + ] + } + ], + "previewImage": { + "from": "mapPreview", + "original": { + "uri": "https://www.sciencebase.gov/catalog/file/get/57d97341e4b090824ffb0e6f?f=__disk__34%2F43%2Fb4%2F3443b407c0be70132992bdebda1903c0a2dd10c6", + "viewUri": "https://www.sciencebase.gov/catalog/file/get/57d97341e4b090824ffb0e6f?f=__disk__34%2F43%2Fb4%2F3443b407c0be70132992bdebda1903c0a2dd10c6&width=360&height=240", + "viewUrl": "https://www.sciencebase.gov/catalog/file/get/57d97341e4b090824ffb0e6f?f=__disk__34%2F43%2Fb4%2F3443b407c0be70132992bdebda1903c0a2dd10c6&width=360&height=240", + "width": 360, + "height": 240, + "size": 175608 + }, + "thumbnail": { + "uri": "https://www.sciencebase.gov/catalog/file/get/57d97341e4b090824ffb0e6f?f=__disk__34%2F43%2Fb4%2F3443b407c0be70132992bdebda1903c0a2dd10c6&width=150&height=100", + "width": 150, + "height": 100 + } + } +} \ No newline at end of file diff --git a/test/fixtures/translates.yml b/test/fixtures/translates.yml index 6233a2b..45a39c7 100644 --- a/test/fixtures/translates.yml +++ b/test/fixtures/translates.yml @@ -4,3 +4,8 @@ fgdc_to_iso: file: files/USGSHydroCached.xml reader: fgdc writer: iso19115_3 + +sbjson_to_mdjson: + file: files/sbJson.json + reader: sbJson + writer: mdJson