├── .github └── workflows │ ├── create-release.yml │ └── test.yml ├── .gitignore ├── .gitmodules ├── .jsbeautifyrc ├── .travis.yml ├── CHANGELOG.md ├── DCAT-US.md ├── Gemfile ├── Gemfile.lock ├── LICENSE.txt ├── README.md ├── Rakefile ├── adiwg-mdtranslator.gemspec ├── bin └── mdtranslator ├── lib ├── adiwg-mdtranslator.rb └── adiwg │ ├── mdtranslator.rb │ ├── mdtranslator │ ├── internal │ │ ├── acquisition.json │ │ ├── internal_metadata_obj.rb │ │ ├── module_codelistFun.rb │ │ ├── module_coordinates.rb │ │ ├── module_dateTimeFun.rb │ │ └── qualityReport.json │ ├── readers │ │ ├── fgdc │ │ │ ├── fgdc_reader.rb │ │ │ ├── modules │ │ │ │ ├── gridSystems │ │ │ │ │ ├── grid_equalArcSecond.rb │ │ │ │ │ ├── grid_other.rb │ │ │ │ │ ├── grid_statePlane.rb │ │ │ │ │ ├── grid_ups.rb │ │ │ │ │ └── grid_utm.rb │ │ │ │ ├── mapProjections │ │ │ │ │ ├── projection_albers.rb │ │ │ │ │ ├── projection_azimuthEquidistant.rb │ │ │ │ │ ├── projection_common.rb │ │ │ │ │ ├── projection_equidistantConic.rb │ │ │ │ │ ├── projection_equirectangular.rb │ │ │ │ │ ├── projection_generalVertical.rb │ │ │ │ │ ├── projection_gnomonic.rb │ │ │ │ │ ├── projection_lambertConic.rb │ │ │ │ │ ├── projection_lambertEqualArea.rb │ │ │ │ │ ├── projection_mercator.rb │ │ │ │ │ ├── projection_millerCylinder.rb │ │ │ │ │ ├── projection_modifiedAlaska.rb │ │ │ │ │ ├── projection_obliqueMercator.rb │ │ │ │ │ ├── projection_orthographic.rb │ │ │ │ │ ├── projection_parameters.rb │ │ │ │ │ ├── projection_polarStereo.rb │ │ │ │ │ ├── projection_polyconic.rb │ │ │ │ │ ├── projection_robinson.rb │ │ │ │ │ ├── projection_sinusoidal.rb │ │ │ │ │ ├── projection_spaceOblique.rb │ │ │ │ │ ├── projection_stereographic.rb │ │ │ │ │ ├── projection_transverseMercator.rb │ │ │ │ │ └── projection_vanDerGrinten.rb │ │ │ │ ├── module_attribute.rb │ │ │ │ ├── module_citation.rb │ │ │ │ ├── module_codeSet.rb │ │ │ │ ├── module_contact.rb │ │ │ │ ├── module_dataQuality.rb │ │ │ │ ├── module_date.rb │ │ │ │ ├── module_dateTime.rb │ │ │ │ ├── module_digitalForm.rb │ │ │ │ ├── module_distribution.rb │ │ │ │ ├── module_entity.rb │ │ │ │ ├── module_entityAttribute.rb │ │ │ │ ├── module_entityOverview.rb │ │ │ │ ├── module_enumerated.rb │ │ │ │ ├── module_fgdc.rb │ │ │ │ ├── module_geodeticReference.rb │ │ │ │ ├── module_geographicResolution.rb │ │ │ │ ├── module_geologicAge.rb │ │ │ │ ├── module_horizontalPlanar.rb │ │ │ │ ├── module_horizontalReference.rb │ │ │ │ ├── module_identification.rb │ │ │ │ ├── module_keyword.rb │ │ │ │ ├── module_lineage.rb │ │ │ │ ├── module_localPlanar.rb │ │ │ │ ├── module_localSystem.rb │ │ │ │ ├── module_mapGridSystem.rb │ │ │ │ ├── module_mapProjection.rb │ │ │ │ ├── module_metadataInfo.rb │ │ │ │ ├── module_methodology.rb │ │ │ │ ├── module_offlineOption.rb │ │ │ │ ├── module_onlineOption.rb │ │ │ │ ├── module_onlineResource.rb │ │ │ │ ├── module_orderProcess.rb │ │ │ │ ├── module_planarCoordinateInfo.rb │ │ │ │ ├── module_pointVector.rb │ │ │ │ ├── module_process.rb │ │ │ │ ├── module_publication.rb │ │ │ │ ├── module_range.rb │ │ │ │ ├── module_raster.rb │ │ │ │ ├── module_responsibility.rb │ │ │ │ ├── module_security.rb │ │ │ │ ├── module_series.rb │ │ │ │ ├── module_source.rb │ │ │ │ ├── module_spatialDomain.rb │ │ │ │ ├── module_spatialOrganization.rb │ │ │ │ ├── module_spatialReference.rb │ │ │ │ ├── module_taxonClass.rb │ │ │ │ ├── module_taxonSystem.rb │ │ │ │ ├── module_taxonomy.rb │ │ │ │ ├── module_timeInstant.rb │ │ │ │ ├── module_timePeriod.rb │ │ │ │ ├── module_transferInfo.rb │ │ │ │ ├── module_verticalAltitude.rb │ │ │ │ ├── module_verticalDatum.rb │ │ │ │ └── module_verticalDepth.rb │ │ │ ├── readme.md │ │ │ └── version.rb │ │ ├── mdJson │ │ │ ├── mdJson_reader.rb │ │ │ ├── mdJson_reader_messages_eng.yml │ │ │ ├── mdJson_validator.rb │ │ │ ├── modules │ │ │ │ ├── module_acquisition.rb │ │ │ │ ├── module_additionalDocumentation.rb │ │ │ │ ├── module_address.rb │ │ │ │ ├── module_algorithm.rb │ │ │ │ ├── module_allocation.rb │ │ │ │ ├── module_associatedResource.rb │ │ │ │ ├── module_attribute.rb │ │ │ │ ├── module_attributeGroup.rb │ │ │ │ ├── module_bearingDistanceResolution.rb │ │ │ │ ├── module_boundingBox.rb │ │ │ │ ├── module_citation.rb │ │ │ │ ├── module_conformanceResult.rb │ │ │ │ ├── module_constraint.rb │ │ │ │ ├── module_contact.rb │ │ │ │ ├── module_contactPostprocess.rb │ │ │ │ ├── module_coordinateResolution.rb │ │ │ │ ├── module_coverageDescription.rb │ │ │ │ ├── module_coverageResult.rb │ │ │ │ ├── module_dataDictionary.rb │ │ │ │ ├── module_dataQuality.rb │ │ │ │ ├── module_dataQualityReport.rb │ │ │ │ ├── module_date.rb │ │ │ │ ├── module_dateTime.rb │ │ │ │ ├── module_descriptiveResult.rb │ │ │ │ ├── module_dimension.rb │ │ │ │ ├── module_distribution.rb │ │ │ │ ├── module_distributor.rb │ │ │ │ ├── module_domain.rb │ │ │ │ ├── module_domainItem.rb │ │ │ │ ├── module_duration.rb │ │ │ │ ├── module_entity.rb │ │ │ │ ├── module_entityAttribute.rb │ │ │ │ ├── module_entityForeignKey.rb │ │ │ │ ├── module_entityIndex.rb │ │ │ │ ├── module_environment.rb │ │ │ │ ├── module_evaluationMethod.rb │ │ │ │ ├── module_event.rb │ │ │ │ ├── module_extent.rb │ │ │ │ ├── module_featureCollection.rb │ │ │ │ ├── module_format.rb │ │ │ │ ├── module_funding.rb │ │ │ │ ├── module_geoJson.rb │ │ │ │ ├── module_geodetic.rb │ │ │ │ ├── module_geographicExtent.rb │ │ │ │ ├── module_geographicResolution.rb │ │ │ │ ├── module_geologicAge.rb │ │ │ │ ├── module_geometryCollection.rb │ │ │ │ ├── module_geometryFeature.rb │ │ │ │ ├── module_geometryObject.rb │ │ │ │ ├── module_geometryProperties.rb │ │ │ │ ├── module_georectifiedRepresentation.rb │ │ │ │ ├── module_georeferenceableRepresentation.rb │ │ │ │ ├── module_graphic.rb │ │ │ │ ├── module_gridRepresentation.rb │ │ │ │ ├── module_identifier.rb │ │ │ │ ├── module_imageDescription.rb │ │ │ │ ├── module_instrument.rb │ │ │ │ ├── module_instrumentationEvent.rb │ │ │ │ ├── module_instrumentationEventList.rb │ │ │ │ ├── module_keyword.rb │ │ │ │ ├── module_keywordObject.rb │ │ │ │ ├── module_legalConstraint.rb │ │ │ │ ├── module_lineage.rb │ │ │ │ ├── module_localProjection.rb │ │ │ │ ├── module_locale.rb │ │ │ │ ├── module_maintenance.rb │ │ │ │ ├── module_mdJson.rb │ │ │ │ ├── module_measure.rb │ │ │ │ ├── module_medium.rb │ │ │ │ ├── module_metadata.rb │ │ │ │ ├── module_metadataInfo.rb │ │ │ │ ├── module_metadataRepository.rb │ │ │ │ ├── module_nominalResolution.rb │ │ │ │ ├── module_objective.rb │ │ │ │ ├── module_obliqueLinePoint.rb │ │ │ │ ├── module_onlineResource.rb │ │ │ │ ├── module_operation.rb │ │ │ │ ├── module_orderProcess.rb │ │ │ │ ├── module_party.rb │ │ │ │ ├── module_pass.rb │ │ │ │ ├── module_phone.rb │ │ │ │ ├── module_plan.rb │ │ │ │ ├── module_platform.rb │ │ │ │ ├── module_processReport.rb │ │ │ │ ├── module_processStep.rb │ │ │ │ ├── module_processing.rb │ │ │ │ ├── module_projectionParameters.rb │ │ │ │ ├── module_qualityMeasure.rb │ │ │ │ ├── module_qualityResultFile.rb │ │ │ │ ├── module_quantitativeResult.rb │ │ │ │ ├── module_rangeElementDescription.rb │ │ │ │ ├── module_referenceSystemParameters.rb │ │ │ │ ├── module_releasability.rb │ │ │ │ ├── module_requestedDate.rb │ │ │ │ ├── module_requirement.rb │ │ │ │ ├── module_resourceInfo.rb │ │ │ │ ├── module_resourceType.rb │ │ │ │ ├── module_resourceUsage.rb │ │ │ │ ├── module_responsibleParty.rb │ │ │ │ ├── module_revision.rb │ │ │ │ ├── module_schema.rb │ │ │ │ ├── module_scope.rb │ │ │ │ ├── module_scopeDescription.rb │ │ │ │ ├── module_securityConstraint.rb │ │ │ │ ├── module_series.rb │ │ │ │ ├── module_source.rb │ │ │ │ ├── module_spatialReference.rb │ │ │ │ ├── module_spatialRepresentation.rb │ │ │ │ ├── module_spatialResolution.rb │ │ │ │ ├── module_taxonomicClassification.rb │ │ │ │ ├── module_taxonomicSystem.rb │ │ │ │ ├── module_taxonomy.rb │ │ │ │ ├── module_temporalExtent.rb │ │ │ │ ├── module_timeInstant.rb │ │ │ │ ├── module_timeInterval.rb │ │ │ │ ├── module_timePeriod.rb │ │ │ │ ├── module_transferOption.rb │ │ │ │ ├── module_valueRange.rb │ │ │ │ ├── module_vectorObject.rb │ │ │ │ ├── module_vectorRepresentation.rb │ │ │ │ ├── module_verticalDatum.rb │ │ │ │ ├── module_verticalExtent.rb │ │ │ │ └── module_voucher.rb │ │ │ └── readme.md │ │ ├── mdReaders.rb │ │ └── sbJson │ │ │ ├── modules │ │ │ ├── module_body.rb │ │ │ ├── module_browseCategory.rb │ │ │ ├── module_budget.rb │ │ │ ├── module_citation.rb │ │ │ ├── module_codelists.rb │ │ │ ├── module_contact.rb │ │ │ ├── module_date.rb │ │ │ ├── module_extent.rb │ │ │ ├── module_id.rb │ │ │ ├── module_identifier.rb │ │ │ ├── module_materialRequest.rb │ │ │ ├── module_parentId.rb │ │ │ ├── module_project.rb │ │ │ ├── module_provenance.rb │ │ │ ├── module_publication.rb │ │ │ ├── module_purpose.rb │ │ │ ├── module_relatedItem.rb │ │ │ ├── module_rights.rb │ │ │ ├── module_sbJson.rb │ │ │ ├── module_spatial.rb │ │ │ ├── module_tag.rb │ │ │ ├── module_titles.rb │ │ │ ├── module_webLinkDocument.rb │ │ │ └── module_webLinkGraphic.rb │ │ │ ├── readme.md │ │ │ ├── sbJson_reader.rb │ │ │ └── version.rb │ ├── version.rb │ └── writers │ │ ├── dcat_us │ │ ├── dcat_us_writer.rb │ │ ├── readme.md │ │ ├── sections │ │ │ ├── dcat_us_access_level.rb │ │ │ ├── dcat_us_access_url.rb │ │ │ ├── dcat_us_accrualPeriodicity.rb │ │ │ ├── dcat_us_bureau_code.rb │ │ │ ├── dcat_us_contact_point.rb │ │ │ ├── dcat_us_dcat_us.rb │ │ │ ├── dcat_us_described_by.rb │ │ │ ├── dcat_us_described_by_type.rb │ │ │ ├── dcat_us_description.rb │ │ │ ├── dcat_us_distribution.rb │ │ │ ├── dcat_us_download_url.rb │ │ │ ├── dcat_us_identifier.rb │ │ │ ├── dcat_us_is_part_of.rb │ │ │ ├── dcat_us_issued.rb │ │ │ ├── dcat_us_keyword.rb │ │ │ ├── dcat_us_landing_page.rb │ │ │ ├── dcat_us_language.rb │ │ │ ├── dcat_us_license.rb │ │ │ ├── dcat_us_media_type.rb │ │ │ ├── dcat_us_modified.rb │ │ │ ├── dcat_us_primaryITInvestmentUII.rb │ │ │ ├── dcat_us_program_code.rb │ │ │ ├── dcat_us_publisher.rb │ │ │ ├── dcat_us_references.rb │ │ │ ├── dcat_us_rights.rb │ │ │ ├── dcat_us_spatial.rb │ │ │ ├── dcat_us_system_of_records.rb │ │ │ ├── dcat_us_temporal.rb │ │ │ └── dcat_us_theme.rb │ │ └── version.rb │ │ ├── fgdc │ │ ├── classes │ │ │ ├── class_address.rb │ │ │ ├── class_attribute.rb │ │ │ ├── class_browse.rb │ │ │ ├── class_citation.rb │ │ │ ├── class_constraint.rb │ │ │ ├── class_contact.rb │ │ │ ├── class_dataDomain.rb │ │ │ ├── class_dataQuality.rb │ │ │ ├── class_dateRange.rb │ │ │ ├── class_dateSingle.rb │ │ │ ├── class_description.rb │ │ │ ├── class_dictionary.rb │ │ │ ├── class_digitalForm.rb │ │ │ ├── class_distribution.rb │ │ │ ├── class_entityDetail.rb │ │ │ ├── class_entityOverview.rb │ │ │ ├── class_fgdc.rb │ │ │ ├── class_geodeticReference.rb │ │ │ ├── class_geographicResolution.rb │ │ │ ├── class_geologicAge.rb │ │ │ ├── class_geologicRange.rb │ │ │ ├── class_identification.rb │ │ │ ├── class_keyword.rb │ │ │ ├── class_lineage.rb │ │ │ ├── class_localPlanar.rb │ │ │ ├── class_localSystem.rb │ │ │ ├── class_mapProjectionTags.rb │ │ │ ├── class_metadataInfo.rb │ │ │ ├── class_method.rb │ │ │ ├── class_methodKeywords.rb │ │ │ ├── class_offlineOption.rb │ │ │ ├── class_onlineOption.rb │ │ │ ├── class_orderProcess.rb │ │ │ ├── class_phone.rb │ │ │ ├── class_planarGrid.rb │ │ │ ├── class_planarInfo.rb │ │ │ ├── class_planarMap.rb │ │ │ ├── class_planarReference.rb │ │ │ ├── class_process.rb │ │ │ ├── class_publisher.rb │ │ │ ├── class_security.rb │ │ │ ├── class_series.rb │ │ │ ├── class_source.rb │ │ │ ├── class_spatialDomain.rb │ │ │ ├── class_spatialOrganization.rb │ │ │ ├── class_spatialReference.rb │ │ │ ├── class_status.rb │ │ │ ├── class_taxonomy.rb │ │ │ ├── class_taxonomyClassification.rb │ │ │ ├── class_taxonomyKeywords.rb │ │ │ ├── class_taxonomySystem.rb │ │ │ ├── class_timePeriod.rb │ │ │ ├── class_transferInfo.rb │ │ │ └── class_verticalDatum.rb │ │ ├── fgdc_writer.rb │ │ ├── fgdc_writer_messages_eng.yml │ │ ├── readme.md │ │ └── version.rb │ │ ├── html │ │ ├── html_writer.rb │ │ ├── readme.md │ │ ├── sections │ │ │ ├── html_acquisition.rb │ │ │ ├── html_additionalDocumentation.rb │ │ │ ├── html_algorithm.rb │ │ │ ├── html_allocation.rb │ │ │ ├── html_associatedResource.rb │ │ │ ├── html_attribute.rb │ │ │ ├── html_attributeGroup.rb │ │ │ ├── html_bearingDistanceResolution.rb │ │ │ ├── html_body.rb │ │ │ ├── html_bodyScript.js │ │ │ ├── html_boundingBox.rb │ │ │ ├── html_citation.rb │ │ │ ├── html_classedData.rb │ │ │ ├── html_classedDataItem.rb │ │ │ ├── html_constraint.rb │ │ │ ├── html_contact.rb │ │ │ ├── html_coordinateResolution.rb │ │ │ ├── html_coverageInfo.rb │ │ │ ├── html_dataDictionary.rb │ │ │ ├── html_dataQuality.rb │ │ │ ├── html_dataQualityReport.rb │ │ │ ├── html_date.rb │ │ │ ├── html_datetime.rb │ │ │ ├── html_dimension.rb │ │ │ ├── html_distribution.rb │ │ │ ├── html_distributor.rb │ │ │ ├── html_document.rb │ │ │ ├── html_domain.rb │ │ │ ├── html_domainItem.rb │ │ │ ├── html_duration.rb │ │ │ ├── html_entity.rb │ │ │ ├── html_entityAttribute.rb │ │ │ ├── html_entityForeignKey.rb │ │ │ ├── html_entityIndex.rb │ │ │ ├── html_environment.rb │ │ │ ├── html_event.rb │ │ │ ├── html_extent.rb │ │ │ ├── html_feature.rb │ │ │ ├── html_featureCollection.rb │ │ │ ├── html_featureProperties.rb │ │ │ ├── html_format.rb │ │ │ ├── html_funding.rb │ │ │ ├── html_geodeticParameters.rb │ │ │ ├── html_geographicElement.rb │ │ │ ├── html_geographicExtent.rb │ │ │ ├── html_geographicResolution.rb │ │ │ ├── html_geologicAge.rb │ │ │ ├── html_geometryCollection.rb │ │ │ ├── html_geometryObject.rb │ │ │ ├── html_georectifiedRepresentation.rb │ │ │ ├── html_georeferenceableRepresentation.rb │ │ │ ├── html_graphic.rb │ │ │ ├── html_gridRepresentation.rb │ │ │ ├── html_head.rb │ │ │ ├── html_identifier.rb │ │ │ ├── html_imageInfo.rb │ │ │ ├── html_inlineCss.css │ │ │ ├── html_instrument.rb │ │ │ ├── html_instrumentationEvent.rb │ │ │ ├── html_instrumentationEventList.rb │ │ │ ├── html_keyword.rb │ │ │ ├── html_legalConstraint.rb │ │ │ ├── html_lineage.rb │ │ │ ├── html_locale.rb │ │ │ ├── html_maintenance.rb │ │ │ ├── html_measure.rb │ │ │ ├── html_medium.rb │ │ │ ├── html_metadataInfo.rb │ │ │ ├── html_metadataRepository.rb │ │ │ ├── html_nominalResolution.rb │ │ │ ├── html_objective.rb │ │ │ ├── html_obliqueLinePoint.rb │ │ │ ├── html_onlineResource.rb │ │ │ ├── html_operation.rb │ │ │ ├── html_orderProcess.rb │ │ │ ├── html_pass.rb │ │ │ ├── html_plan.rb │ │ │ ├── html_platform.rb │ │ │ ├── html_processReport.rb │ │ │ ├── html_processStep.rb │ │ │ ├── html_processing.rb │ │ │ ├── html_projectionParameters.rb │ │ │ ├── html_rangeElementDescription.rb │ │ │ ├── html_referenceSystemParameters.rb │ │ │ ├── html_releasability.rb │ │ │ ├── html_requestedDate.rb │ │ │ ├── html_requirement.rb │ │ │ ├── html_resourceFormat.rb │ │ │ ├── html_resourceInfo.rb │ │ │ ├── html_resourceType.rb │ │ │ ├── html_responsibility.rb │ │ │ ├── html_resultFile.rb │ │ │ ├── html_revision.rb │ │ │ ├── html_scope.rb │ │ │ ├── html_scopeDescription.rb │ │ │ ├── html_securityConstraint.rb │ │ │ ├── html_source.rb │ │ │ ├── html_spatialReference.rb │ │ │ ├── html_spatialRepresentation.rb │ │ │ ├── html_spatialResolution.rb │ │ │ ├── html_taxonomy.rb │ │ │ ├── html_taxonomyClass.rb │ │ │ ├── html_temporalExtent.rb │ │ │ ├── html_timeInstant.rb │ │ │ ├── html_timeInterval.rb │ │ │ ├── html_timePeriod.rb │ │ │ ├── html_transferOption.rb │ │ │ ├── html_usage.rb │ │ │ ├── html_vectorObject.rb │ │ │ ├── html_vectorRepresentation.rb │ │ │ ├── html_verticalDatumParameters.rb │ │ │ └── html_verticalExtent.rb │ │ └── version.rb │ │ ├── iso19110 │ │ ├── classes │ │ │ ├── class_address.rb │ │ │ ├── class_baseUnit.rb │ │ │ ├── class_citation.rb │ │ │ ├── class_codelist.rb │ │ │ ├── class_contact.rb │ │ │ ├── class_conventionalUnit.rb │ │ │ ├── class_date.rb │ │ │ ├── class_definitionReference.rb │ │ │ ├── class_definitionUnit.rb │ │ │ ├── class_derivedUnit.rb │ │ │ ├── class_domain.rb │ │ │ ├── class_fcFeatureCatalogue.rb │ │ │ ├── class_featureAttribute.rb │ │ │ ├── class_featureConstraint.rb │ │ │ ├── class_featureType.rb │ │ │ ├── class_gcoDateTime.rb │ │ │ ├── class_listedValue.rb │ │ │ ├── class_locale.rb │ │ │ ├── class_mdIdentifier.rb │ │ │ ├── class_multiplicity.rb │ │ │ ├── class_onlineResource.rb │ │ │ ├── class_phone.rb │ │ │ ├── class_responsibleParty.rb │ │ │ ├── class_series.rb │ │ │ └── class_unitsOfMeasure.rb │ │ ├── iso19110_writer.rb │ │ ├── iso19110_writer_messages_eng.yml │ │ ├── readme.md │ │ └── version.rb │ │ ├── iso19115_2 │ │ ├── classes │ │ │ ├── class_address.rb │ │ │ ├── class_aggregateInformation.rb │ │ │ ├── class_algorithm.rb │ │ │ ├── class_attribute.rb │ │ │ ├── class_baseUnit.rb │ │ │ ├── class_boundingBox.rb │ │ │ ├── class_browseGraphic.rb │ │ │ ├── class_citation.rb │ │ │ ├── class_codelist.rb │ │ │ ├── class_contact.rb │ │ │ ├── class_conventionalUnit.rb │ │ │ ├── class_coverageDescription.rb │ │ │ ├── class_crs.rb │ │ │ ├── class_dataIdentification.rb │ │ │ ├── class_dataQuality.rb │ │ │ ├── class_dataQualityReport.rb │ │ │ ├── class_date.rb │ │ │ ├── class_definitionUnit.rb │ │ │ ├── class_derivedUnit.rb │ │ │ ├── class_dimension.rb │ │ │ ├── class_distribution.rb │ │ │ ├── class_distributor.rb │ │ │ ├── class_ellipsoidParameters.rb │ │ │ ├── class_enumerationList.rb │ │ │ ├── class_extension.rb │ │ │ ├── class_extent.rb │ │ │ ├── class_feature.rb │ │ │ ├── class_featureCollection.rb │ │ │ ├── class_featureProperties.rb │ │ │ ├── class_format.rb │ │ │ ├── class_fraction.rb │ │ │ ├── class_gcoDateTime.rb │ │ │ ├── class_geographicElement.rb │ │ │ ├── class_geographicExtent.rb │ │ │ ├── class_geometricObjects.rb │ │ │ ├── class_geometryCollection.rb │ │ │ ├── class_georectified.rb │ │ │ ├── class_georeferenceable.rb │ │ │ ├── class_gmlIdentifier.rb │ │ │ ├── class_grid.rb │ │ │ ├── class_gridRepresentation.rb │ │ │ ├── class_hierarchy.rb │ │ │ ├── class_image.rb │ │ │ ├── class_keyword.rb │ │ │ ├── class_leProcessStep.rb │ │ │ ├── class_leSource.rb │ │ │ ├── class_legalConstraints.rb │ │ │ ├── class_liProcessStep.rb │ │ │ ├── class_liSource.rb │ │ │ ├── class_lineString.rb │ │ │ ├── class_lineage.rb │ │ │ ├── class_locale.rb │ │ │ ├── class_maintenance.rb │ │ │ ├── class_mdBand.rb │ │ │ ├── class_mdIdentifier.rb │ │ │ ├── class_measure.rb │ │ │ ├── class_medium.rb │ │ │ ├── class_miBand.rb │ │ │ ├── class_miMetadata.rb │ │ │ ├── class_multiLine.rb │ │ │ ├── class_multiPoint.rb │ │ │ ├── class_multiPolygon.rb │ │ │ ├── class_nominalResolution.rb │ │ │ ├── class_obliqueLinePoint.rb │ │ │ ├── class_onlineResource.rb │ │ │ ├── class_orderProcess.rb │ │ │ ├── class_phone.rb │ │ │ ├── class_point.rb │ │ │ ├── class_polygon.rb │ │ │ ├── class_processReport.rb │ │ │ ├── class_processStep.rb │ │ │ ├── class_processing.rb │ │ │ ├── class_projectionParameters.rb │ │ │ ├── class_rangeDimension.rb │ │ │ ├── class_referenceSystem.rb │ │ │ ├── class_resolution.rb │ │ │ ├── class_responsibleParty.rb │ │ │ ├── class_rsIdentifier.rb │ │ │ ├── class_scope.rb │ │ │ ├── class_scopeDescription.rb │ │ │ ├── class_securityConstraints.rb │ │ │ ├── class_series.rb │ │ │ ├── class_source.rb │ │ │ ├── class_spatialRepresentation.rb │ │ │ ├── class_taxonomicClassification.rb │ │ │ ├── class_taxonomicSystem.rb │ │ │ ├── class_taxonomy.rb │ │ │ ├── class_temporalExtent.rb │ │ │ ├── class_timeInstant.rb │ │ │ ├── class_timePeriod.rb │ │ │ ├── class_transferOptions.rb │ │ │ ├── class_unitsOfMeasure.rb │ │ │ ├── class_usage.rb │ │ │ ├── class_useConstraints.rb │ │ │ ├── class_vectorRepresentation.rb │ │ │ ├── class_verticalExtent.rb │ │ │ └── class_vouchers.rb │ │ ├── iso19115_2_writer.rb │ │ ├── iso19115_2_writer_messages_eng.yml │ │ ├── readme.md │ │ └── version.rb │ │ ├── iso19115_3 │ │ ├── classes │ │ │ ├── class_acquisition.rb │ │ │ ├── class_additionalDocument.rb │ │ │ ├── class_address.rb │ │ │ ├── class_algorithm.rb │ │ │ ├── class_associatedResource.rb │ │ │ ├── class_attribute.rb │ │ │ ├── class_attributeGroup.rb │ │ │ ├── class_baseUnit.rb │ │ │ ├── class_boundingBox.rb │ │ │ ├── class_browseGraphic.rb │ │ │ ├── class_citation.rb │ │ │ ├── class_codelist.rb │ │ │ ├── class_constraint.rb │ │ │ ├── class_constraintCommon.rb │ │ │ ├── class_contact.rb │ │ │ ├── class_conventionalUnit.rb │ │ │ ├── class_coverageDescription.rb │ │ │ ├── class_dataIdentification.rb │ │ │ ├── class_dataQuality.rb │ │ │ ├── class_dataQualityReport.rb │ │ │ ├── class_date.rb │ │ │ ├── class_definitionUnit.rb │ │ │ ├── class_derivedUnit.rb │ │ │ ├── class_dimension.rb │ │ │ ├── class_distribution.rb │ │ │ ├── class_distributor.rb │ │ │ ├── class_email.rb │ │ │ ├── class_enumerationList.rb │ │ │ ├── class_environment.rb │ │ │ ├── class_event.rb │ │ │ ├── class_extension.rb │ │ │ ├── class_extent.rb │ │ │ ├── class_feature.rb │ │ │ ├── class_featureCatalog.rb │ │ │ ├── class_featureCollection.rb │ │ │ ├── class_featureProperties.rb │ │ │ ├── class_format.rb │ │ │ ├── class_fraction.rb │ │ │ ├── class_gcoDateTime.rb │ │ │ ├── class_geographicElement.rb │ │ │ ├── class_geographicExtent.rb │ │ │ ├── class_geometricObjects.rb │ │ │ ├── class_geometryCollection.rb │ │ │ ├── class_georectified.rb │ │ │ ├── class_georeferenceable.rb │ │ │ ├── class_gmlIdentifier.rb │ │ │ ├── class_grid.rb │ │ │ ├── class_gridRepresentation.rb │ │ │ ├── class_identifier.rb │ │ │ ├── class_imageDescription.rb │ │ │ ├── class_individual.rb │ │ │ ├── class_instrument.rb │ │ │ ├── class_instrumentationEvent.rb │ │ │ ├── class_instrumentationEventList.rb │ │ │ ├── class_keyword.rb │ │ │ ├── class_leProcessStep.rb │ │ │ ├── class_leSource.rb │ │ │ ├── class_legalConstraints.rb │ │ │ ├── class_liProcessStep.rb │ │ │ ├── class_liSource.rb │ │ │ ├── class_lineString.rb │ │ │ ├── class_lineage.rb │ │ │ ├── class_locale.rb │ │ │ ├── class_maintenance.rb │ │ │ ├── class_mdBand.rb │ │ │ ├── class_mdMetadata.rb │ │ │ ├── class_measure.rb │ │ │ ├── class_medium.rb │ │ │ ├── class_miBand.rb │ │ │ ├── class_multiLine.rb │ │ │ ├── class_multiPoint.rb │ │ │ ├── class_multiPolygon.rb │ │ │ ├── class_nominalResolution.rb │ │ │ ├── class_objective.rb │ │ │ ├── class_onlineResource.rb │ │ │ ├── class_operation.rb │ │ │ ├── class_orderProcess.rb │ │ │ ├── class_organization.rb │ │ │ ├── class_partyIdentifier.rb │ │ │ ├── class_pass.rb │ │ │ ├── class_phone.rb │ │ │ ├── class_plan.rb │ │ │ ├── class_platform.rb │ │ │ ├── class_point.rb │ │ │ ├── class_polygon.rb │ │ │ ├── class_processReport.rb │ │ │ ├── class_processStep.rb │ │ │ ├── class_processing.rb │ │ │ ├── class_qualityResultFile.rb │ │ │ ├── class_rangeDimension.rb │ │ │ ├── class_rangeElementDescription.rb │ │ │ ├── class_referenceSystem.rb │ │ │ ├── class_releasability.rb │ │ │ ├── class_requestedDate.rb │ │ │ ├── class_requirement.rb │ │ │ ├── class_resolution.rb │ │ │ ├── class_responsibility.rb │ │ │ ├── class_revision.rb │ │ │ ├── class_sampleDimension.rb │ │ │ ├── class_scope.rb │ │ │ ├── class_scopeDescription.rb │ │ │ ├── class_securityConstraints.rb │ │ │ ├── class_series.rb │ │ │ ├── class_source.rb │ │ │ ├── class_spatialRepresentation.rb │ │ │ ├── class_temporalExtent.rb │ │ │ ├── class_timeInstant.rb │ │ │ ├── class_timePeriod.rb │ │ │ ├── class_transferOptions.rb │ │ │ ├── class_unitsOfMeasure.rb │ │ │ ├── class_usage.rb │ │ │ ├── class_useConstraints.rb │ │ │ ├── class_vectorRepresentation.rb │ │ │ └── class_verticalExtent.rb │ │ ├── iso19115_3_writer.rb │ │ ├── iso19115_3_writer_messages_eng.yml │ │ ├── readme.md │ │ └── version.rb │ │ ├── mdJson │ │ ├── mdJson_writer.rb │ │ ├── readme.md │ │ ├── sections │ │ │ ├── mdJson_acquisition.rb │ │ │ ├── mdJson_additionalDocumentation.rb │ │ │ ├── mdJson_address.rb │ │ │ ├── mdJson_algorithm.rb │ │ │ ├── mdJson_allocation.rb │ │ │ ├── mdJson_associatedResource.rb │ │ │ ├── mdJson_attribute.rb │ │ │ ├── mdJson_attributeGroup.rb │ │ │ ├── mdJson_bearingDistanceResolution.rb │ │ │ ├── mdJson_boundingBox.rb │ │ │ ├── mdJson_citation.rb │ │ │ ├── mdJson_conformanceResult.rb │ │ │ ├── mdJson_constraint.rb │ │ │ ├── mdJson_contact.rb │ │ │ ├── mdJson_coordinateResolution.rb │ │ │ ├── mdJson_coverageDescription.rb │ │ │ ├── mdJson_coverageInfo.rb │ │ │ ├── mdJson_coverageItem.rb │ │ │ ├── mdJson_coverageResult.rb │ │ │ ├── mdJson_dataQuality.rb │ │ │ ├── mdJson_dataQualityReport.rb │ │ │ ├── mdJson_date.rb │ │ │ ├── mdJson_dateTime.rb │ │ │ ├── mdJson_descriptiveResult.rb │ │ │ ├── mdJson_dictionary.rb │ │ │ ├── mdJson_dimension.rb │ │ │ ├── mdJson_distribution.rb │ │ │ ├── mdJson_distributor.rb │ │ │ ├── mdJson_domain.rb │ │ │ ├── mdJson_domainItem.rb │ │ │ ├── mdJson_duration.rb │ │ │ ├── mdJson_entity.rb │ │ │ ├── mdJson_entityAttribute.rb │ │ │ ├── mdJson_entityForeignKey.rb │ │ │ ├── mdJson_entityIndex.rb │ │ │ ├── mdJson_environment.rb │ │ │ ├── mdJson_evaluationMethod.rb │ │ │ ├── mdJson_event.rb │ │ │ ├── mdJson_extent.rb │ │ │ ├── mdJson_format.rb │ │ │ ├── mdJson_funding.rb │ │ │ ├── mdJson_geodeticParameters.rb │ │ │ ├── mdJson_geographicExtent.rb │ │ │ ├── mdJson_geographicResolution.rb │ │ │ ├── mdJson_geologicAge.rb │ │ │ ├── mdJson_georectifiedRepresentation.rb │ │ │ ├── mdJson_georeferenceableRepresentation.rb │ │ │ ├── mdJson_graphicOverview.rb │ │ │ ├── mdJson_gridRepresentation.rb │ │ │ ├── mdJson_identifier.rb │ │ │ ├── mdJson_imageDescription.rb │ │ │ ├── mdJson_imageInfo.rb │ │ │ ├── mdJson_instrument.rb │ │ │ ├── mdJson_instrumentationEvent.rb │ │ │ ├── mdJson_instrumentationEventList.rb │ │ │ ├── mdJson_keyword.rb │ │ │ ├── mdJson_keywordObject.rb │ │ │ ├── mdJson_legalConstraint.rb │ │ │ ├── mdJson_lineageInfo.rb │ │ │ ├── mdJson_localProjection.rb │ │ │ ├── mdJson_locale.rb │ │ │ ├── mdJson_maintenance.rb │ │ │ ├── mdJson_mdJson.rb │ │ │ ├── mdJson_measure.rb │ │ │ ├── mdJson_medium.rb │ │ │ ├── mdJson_metadata.rb │ │ │ ├── mdJson_metadataInfo.rb │ │ │ ├── mdJson_nominalResolution.rb │ │ │ ├── mdJson_objective.rb │ │ │ ├── mdJson_obliqueLinePoint.rb │ │ │ ├── mdJson_onlineResource.rb │ │ │ ├── mdJson_operation.rb │ │ │ ├── mdJson_orderProcess.rb │ │ │ ├── mdJson_party.rb │ │ │ ├── mdJson_pass.rb │ │ │ ├── mdJson_phone.rb │ │ │ ├── mdJson_plan.rb │ │ │ ├── mdJson_platform.rb │ │ │ ├── mdJson_processReport.rb │ │ │ ├── mdJson_processStep.rb │ │ │ ├── mdJson_processing.rb │ │ │ ├── mdJson_projectionParameters.rb │ │ │ ├── mdJson_qualityMeasure.rb │ │ │ ├── mdJson_qualityResultFile.rb │ │ │ ├── mdJson_quantitativeResult.rb │ │ │ ├── mdJson_releasability.rb │ │ │ ├── mdJson_repository.rb │ │ │ ├── mdJson_requestedDate.rb │ │ │ ├── mdJson_requirement.rb │ │ │ ├── mdJson_resourceInfo.rb │ │ │ ├── mdJson_resourceType.rb │ │ │ ├── mdJson_responsibleParty.rb │ │ │ ├── mdJson_revision.rb │ │ │ ├── mdJson_scope.rb │ │ │ ├── mdJson_scopeDescription.rb │ │ │ ├── mdJson_securityConstraint.rb │ │ │ ├── mdJson_series.rb │ │ │ ├── mdJson_source.rb │ │ │ ├── mdJson_spatialReference.rb │ │ │ ├── mdJson_spatialReferenceParameters.rb │ │ │ ├── mdJson_spatialRepresentation.rb │ │ │ ├── mdJson_spatialResolution.rb │ │ │ ├── mdJson_standaloneQualityReport.rb │ │ │ ├── mdJson_taxonomicClassification.rb │ │ │ ├── mdJson_taxonomicSystem.rb │ │ │ ├── mdJson_taxonomy.rb │ │ │ ├── mdJson_temporalExtent.rb │ │ │ ├── mdJson_timeInstant.rb │ │ │ ├── mdJson_timeInterval.rb │ │ │ ├── mdJson_timePeriod.rb │ │ │ ├── mdJson_transferOption.rb │ │ │ ├── mdJson_usage.rb │ │ │ ├── mdJson_valueRange.rb │ │ │ ├── mdJson_vectorObject.rb │ │ │ ├── mdJson_vectorRepresentation.rb │ │ │ ├── mdJson_verticalDatumParameters.rb │ │ │ ├── mdJson_verticalExtent.rb │ │ │ └── mdJson_voucher.rb │ │ └── version.rb │ │ ├── mdWriters.rb │ │ ├── sbJson │ │ ├── readme.md │ │ ├── sbJson_writer.rb │ │ ├── sections │ │ │ ├── sbJson_abstract.rb │ │ │ ├── sbJson_browseCategory.rb │ │ │ ├── sbJson_budget.rb │ │ │ ├── sbJson_citation.rb │ │ │ ├── sbJson_codelists.rb │ │ │ ├── sbJson_contact.rb │ │ │ ├── sbJson_date.rb │ │ │ ├── sbJson_facet.rb │ │ │ ├── sbJson_geographicExtent.rb │ │ │ ├── sbJson_hours.rb │ │ │ ├── sbJson_id.rb │ │ │ ├── sbJson_identifier.rb │ │ │ ├── sbJson_materialRequest.rb │ │ │ ├── sbJson_parentId.rb │ │ │ ├── sbJson_project.rb │ │ │ ├── sbJson_provenance.rb │ │ │ ├── sbJson_publication.rb │ │ │ ├── sbJson_rights.rb │ │ │ ├── sbJson_sbJson.rb │ │ │ ├── sbJson_spatial.rb │ │ │ ├── sbJson_tag.rb │ │ │ └── sbJson_webLink.rb │ │ └── version.rb │ │ └── simple_html │ │ ├── readme.md │ │ ├── sections │ │ ├── html_acquisition.rb │ │ ├── html_additionalDocumentation.rb │ │ ├── html_algorithm.rb │ │ ├── html_allocation.rb │ │ ├── html_associatedResource.rb │ │ ├── html_attribute.rb │ │ ├── html_attributeGroup.rb │ │ ├── html_bearingDistanceResolution.rb │ │ ├── html_body.rb │ │ ├── html_boundingBox.rb │ │ ├── html_citation.rb │ │ ├── html_classedData.rb │ │ ├── html_classedDataItem.rb │ │ ├── html_constraint.rb │ │ ├── html_contact.rb │ │ ├── html_coordinateResolution.rb │ │ ├── html_coverageInfo.rb │ │ ├── html_dataDictionary.rb │ │ ├── html_dataQuality.rb │ │ ├── html_dataQualityReport.rb │ │ ├── html_date.rb │ │ ├── html_datetime.rb │ │ ├── html_dimension.rb │ │ ├── html_distribution.rb │ │ ├── html_distributor.rb │ │ ├── html_document.rb │ │ ├── html_domain.rb │ │ ├── html_domainItem.rb │ │ ├── html_duration.rb │ │ ├── html_entity.rb │ │ ├── html_entityAttribute.rb │ │ ├── html_entityForeignKey.rb │ │ ├── html_entityIndex.rb │ │ ├── html_environment.rb │ │ ├── html_event.rb │ │ ├── html_extent.rb │ │ ├── html_feature.rb │ │ ├── html_featureCollection.rb │ │ ├── html_featureProperties.rb │ │ ├── html_format.rb │ │ ├── html_funding.rb │ │ ├── html_geodeticParameters.rb │ │ ├── html_geographicElement.rb │ │ ├── html_geographicExtent.rb │ │ ├── html_geographicResolution.rb │ │ ├── html_geologicAge.rb │ │ ├── html_geometryCollection.rb │ │ ├── html_geometryObject.rb │ │ ├── html_georectifiedRepresentation.rb │ │ ├── html_georeferenceableRepresentation.rb │ │ ├── html_graphic.rb │ │ ├── html_gridRepresentation.rb │ │ ├── html_head.rb │ │ ├── html_identifier.rb │ │ ├── html_imageInfo.rb │ │ ├── html_inlineCss.css │ │ ├── html_instrument.rb │ │ ├── html_instrumentationEvent.rb │ │ ├── html_instrumentationEventList.rb │ │ ├── html_keyword.rb │ │ ├── html_legalConstraint.rb │ │ ├── html_lineage.rb │ │ ├── html_locale.rb │ │ ├── html_maintenance.rb │ │ ├── html_measure.rb │ │ ├── html_medium.rb │ │ ├── html_metadataInfo.rb │ │ ├── html_metadataRepository.rb │ │ ├── html_nominalResolution.rb │ │ ├── html_objective.rb │ │ ├── html_obliqueLinePoint.rb │ │ ├── html_onlineResource.rb │ │ ├── html_operation.rb │ │ ├── html_orderProcess.rb │ │ ├── html_pass.rb │ │ ├── html_plan.rb │ │ ├── html_platform.rb │ │ ├── html_processReport.rb │ │ ├── html_processStep.rb │ │ ├── html_processing.rb │ │ ├── html_projectionParameters.rb │ │ ├── html_rangeElementDescription.rb │ │ ├── html_referenceSystemParameters.rb │ │ ├── html_releasability.rb │ │ ├── html_requestedDate.rb │ │ ├── html_requirement.rb │ │ ├── html_resourceFormat.rb │ │ ├── html_resourceInfo.rb │ │ ├── html_resourceType.rb │ │ ├── html_responsibility.rb │ │ ├── html_resultFile.rb │ │ ├── html_revision.rb │ │ ├── html_scope.rb │ │ ├── html_scopeDescription.rb │ │ ├── html_securityConstraint.rb │ │ ├── html_source.rb │ │ ├── html_spatialReference.rb │ │ ├── html_spatialRepresentation.rb │ │ ├── html_spatialResolution.rb │ │ ├── html_taxonomy.rb │ │ ├── html_taxonomyClass.rb │ │ ├── html_temporalExtent.rb │ │ ├── html_timeInstant.rb │ │ ├── html_timeInterval.rb │ │ ├── html_timePeriod.rb │ │ ├── html_transferOption.rb │ │ ├── html_usage.rb │ │ ├── html_vectorObject.rb │ │ ├── html_vectorRepresentation.rb │ │ ├── html_verticalDatumParameters.rb │ │ └── html_verticalExtent.rb │ │ ├── simple_html_writer.rb │ │ └── version.rb │ └── mdtranslator_cli.rb ├── scripts ├── build-gem.sh └── publish-gem.sh ├── test ├── debug │ ├── debug_test_parent.rb │ ├── test_19115-1_writer.rb │ ├── test_19115-2_writer.rb │ ├── test_fgdc_reader.rb │ ├── test_fgdc_writer.rb │ └── userFiles │ │ ├── gulkanaGlacierGPR.xml │ │ └── schemaExample.json ├── helpers │ ├── mdJson_hash_functions.rb │ └── mdJson_hash_objects.rb ├── readers │ ├── fgdc │ │ ├── fgdc_test_parent.rb │ │ ├── tc_fgdc_attribute.rb │ │ ├── tc_fgdc_citation.rb │ │ ├── tc_fgdc_contact.rb │ │ ├── tc_fgdc_date.rb │ │ ├── tc_fgdc_distribution.rb │ │ ├── tc_fgdc_domain.rb │ │ ├── tc_fgdc_entity.rb │ │ ├── tc_fgdc_entityAttribute.rb │ │ ├── tc_fgdc_enumerated.rb │ │ ├── tc_fgdc_fgdc.rb │ │ ├── tc_fgdc_geodeticReference.rb │ │ ├── tc_fgdc_geographicResolution.rb │ │ ├── tc_fgdc_identification.rb │ │ ├── tc_fgdc_keyword.rb │ │ ├── tc_fgdc_lineage.rb │ │ ├── tc_fgdc_mapAlbers.rb │ │ ├── tc_fgdc_mapArcSec.rb │ │ ├── tc_fgdc_mapAzimuthEquidistant.rb │ │ ├── tc_fgdc_mapEquidistantConic.rb │ │ ├── tc_fgdc_mapEquirectangular.rb │ │ ├── tc_fgdc_mapGeneralVertical.rb │ │ ├── tc_fgdc_mapGnomonic.rb │ │ ├── tc_fgdc_mapLambertConic.rb │ │ ├── tc_fgdc_mapLambertEqualArea.rb │ │ ├── tc_fgdc_mapLocalPlanar.rb │ │ ├── tc_fgdc_mapLocalSystem.rb │ │ ├── tc_fgdc_mapMercator.rb │ │ ├── tc_fgdc_mapMiller.rb │ │ ├── tc_fgdc_mapModifiedAlaska.rb │ │ ├── tc_fgdc_mapObliqueMercator.rb │ │ ├── tc_fgdc_mapOrthographic.rb │ │ ├── tc_fgdc_mapOtherGrid.rb │ │ ├── tc_fgdc_mapOtherProjection.rb │ │ ├── tc_fgdc_mapParameters.rb │ │ ├── tc_fgdc_mapPolarStereo.rb │ │ ├── tc_fgdc_mapPolyconic.rb │ │ ├── tc_fgdc_mapRobinson.rb │ │ ├── tc_fgdc_mapSinusoidal.rb │ │ ├── tc_fgdc_mapSpaceOblique.rb │ │ ├── tc_fgdc_mapStatePlane.rb │ │ ├── tc_fgdc_mapStereographic.rb │ │ ├── tc_fgdc_mapTransverseMercator.rb │ │ ├── tc_fgdc_mapUPS.rb │ │ ├── tc_fgdc_mapUTM.rb │ │ ├── tc_fgdc_mapVanDerGrinten.rb │ │ ├── tc_fgdc_metadataInfo.rb │ │ ├── tc_fgdc_offlineOption.rb │ │ ├── tc_fgdc_onlineOption.rb │ │ ├── tc_fgdc_onlineResource.rb │ │ ├── tc_fgdc_orderProcess.rb │ │ ├── tc_fgdc_planarCoordinateInfo.rb │ │ ├── tc_fgdc_pointVector.rb │ │ ├── tc_fgdc_process.rb │ │ ├── tc_fgdc_publication.rb │ │ ├── tc_fgdc_quality.rb │ │ ├── tc_fgdc_raster.rb │ │ ├── tc_fgdc_responsibility.rb │ │ ├── tc_fgdc_security.rb │ │ ├── tc_fgdc_series.rb │ │ ├── tc_fgdc_source.rb │ │ ├── tc_fgdc_spatialDomain.rb │ │ ├── tc_fgdc_taxonClass.rb │ │ ├── tc_fgdc_taxonomy.rb │ │ ├── tc_fgdc_temporalExtent.rb │ │ ├── tc_fgdc_timeInstant.rb │ │ ├── tc_fgdc_timePeriod.rb │ │ ├── tc_fgdc_transferInfo.rb │ │ ├── tc_fgdc_verticalSystem.rb │ │ └── testData │ │ │ ├── citation.xml │ │ │ ├── contact_organization.xml │ │ │ ├── contact_person.xml │ │ │ ├── dataQuality.xml │ │ │ ├── date_local.xml │ │ │ ├── date_utc.xml │ │ │ ├── distribution.xml │ │ │ ├── entityAttribute.xml │ │ │ ├── fgdc_fullRecord.xml │ │ │ ├── identification.xml │ │ │ ├── keyword.xml │ │ │ ├── lineage.xml │ │ │ ├── metadataInfo.xml │ │ │ ├── pointVector.xml │ │ │ ├── publication.xml │ │ │ ├── raster.xml │ │ │ ├── security.xml │ │ │ ├── series.xml │ │ │ ├── spatialDomain.xml │ │ │ ├── spatialReferenceGeodetic.xml │ │ │ ├── spatialReferenceLocal.xml │ │ │ ├── spatialReferencePlanar.xml │ │ │ ├── spatialResolutionGeographic.xml │ │ │ ├── spatialResolutionPlanar.xml │ │ │ ├── taxonomy.xml │ │ │ ├── temporalExtent.xml │ │ │ ├── timeInstant.xml │ │ │ ├── timePeriod_multi.xml │ │ │ ├── timePeriod_range.xml │ │ │ ├── timePeriod_single.xml │ │ │ ├── verticalSystem.xml │ │ │ ├── x_blackBrant.xml │ │ │ ├── x_denaliFault.xml │ │ │ └── x_whiteFrontedGoose.xml │ ├── mdJson │ │ ├── mdjson_test_parent.rb │ │ ├── tc_mdjson_additionalDocumentation.rb │ │ ├── tc_mdjson_address.rb │ │ ├── tc_mdjson_algorithm.rb │ │ ├── tc_mdjson_allocation.rb │ │ ├── tc_mdjson_associatedResource.rb │ │ ├── tc_mdjson_attribute.rb │ │ ├── tc_mdjson_attributeGroup.rb │ │ ├── tc_mdjson_bearingDistanceResolution.rb │ │ ├── tc_mdjson_boundingBox.rb │ │ ├── tc_mdjson_citation.rb │ │ ├── tc_mdjson_computedBbox.rb │ │ ├── tc_mdjson_constraint.rb │ │ ├── tc_mdjson_contact.rb │ │ ├── tc_mdjson_coordinateResolution.rb │ │ ├── tc_mdjson_coverageDescription.rb │ │ ├── tc_mdjson_dataDictionary.rb │ │ ├── tc_mdjson_date.rb │ │ ├── tc_mdjson_dateTime.rb │ │ ├── tc_mdjson_dimension.rb │ │ ├── tc_mdjson_distribution.rb │ │ ├── tc_mdjson_distributor.rb │ │ ├── tc_mdjson_domain.rb │ │ ├── tc_mdjson_domainItem.rb │ │ ├── tc_mdjson_duration.rb │ │ ├── tc_mdjson_entity.rb │ │ ├── tc_mdjson_entityAttribute.rb │ │ ├── tc_mdjson_entityForeignKey.rb │ │ ├── tc_mdjson_entityIndex.rb │ │ ├── tc_mdjson_extent.rb │ │ ├── tc_mdjson_featureCollection.rb │ │ ├── tc_mdjson_format.rb │ │ ├── tc_mdjson_funding.rb │ │ ├── tc_mdjson_geoJson.rb │ │ ├── tc_mdjson_geodeticReference.rb │ │ ├── tc_mdjson_geographicExtent.rb │ │ ├── tc_mdjson_geographicResolution.rb │ │ ├── tc_mdjson_geologicAge.rb │ │ ├── tc_mdjson_geometryCollection.rb │ │ ├── tc_mdjson_geometryFeature.rb │ │ ├── tc_mdjson_geometryObject.rb │ │ ├── tc_mdjson_geometryProperties.rb │ │ ├── tc_mdjson_georectifiedRepresentation.rb │ │ ├── tc_mdjson_georeferenceableRepresentation.rb │ │ ├── tc_mdjson_graphic.rb │ │ ├── tc_mdjson_gridRepresentation.rb │ │ ├── tc_mdjson_identifier.rb │ │ ├── tc_mdjson_imageDescription.rb │ │ ├── tc_mdjson_keyword.rb │ │ ├── tc_mdjson_keywordObject.rb │ │ ├── tc_mdjson_legalConstraint.rb │ │ ├── tc_mdjson_lineage.rb │ │ ├── tc_mdjson_local.rb │ │ ├── tc_mdjson_locale.rb │ │ ├── tc_mdjson_maintenance.rb │ │ ├── tc_mdjson_mdJson.rb │ │ ├── tc_mdjson_measure.rb │ │ ├── tc_mdjson_medium.rb │ │ ├── tc_mdjson_metadata.rb │ │ ├── tc_mdjson_metadataInfo.rb │ │ ├── tc_mdjson_metadataRepository.rb │ │ ├── tc_mdjson_nominalResolution.rb │ │ ├── tc_mdjson_obliqueLinePoint.rb │ │ ├── tc_mdjson_onlineResource.rb │ │ ├── tc_mdjson_orderProcess.rb │ │ ├── tc_mdjson_party.rb │ │ ├── tc_mdjson_phone.rb │ │ ├── tc_mdjson_processReport.rb │ │ ├── tc_mdjson_processStep.rb │ │ ├── tc_mdjson_processing.rb │ │ ├── tc_mdjson_projectionParameters.rb │ │ ├── tc_mdjson_referenceSystemParameters.rb │ │ ├── tc_mdjson_releasability.rb │ │ ├── tc_mdjson_resourceInfo.rb │ │ ├── tc_mdjson_resourceType.rb │ │ ├── tc_mdjson_resourceUsage.rb │ │ ├── tc_mdjson_responsibleParty.rb │ │ ├── tc_mdjson_schema.rb │ │ ├── tc_mdjson_scope.rb │ │ ├── tc_mdjson_scopeDescription.rb │ │ ├── tc_mdjson_securityConstraint.rb │ │ ├── tc_mdjson_series.rb │ │ ├── tc_mdjson_source.rb │ │ ├── tc_mdjson_spatialReference.rb │ │ ├── tc_mdjson_spatialRepresentation.rb │ │ ├── tc_mdjson_spatialResolution.rb │ │ ├── tc_mdjson_taxonomicClassification.rb │ │ ├── tc_mdjson_taxonomicSystem.rb │ │ ├── tc_mdjson_taxonomy.rb │ │ ├── tc_mdjson_temporalExtent.rb │ │ ├── tc_mdjson_timeInstant.rb │ │ ├── tc_mdjson_timeInterval.rb │ │ ├── tc_mdjson_timePeriod.rb │ │ ├── tc_mdjson_transferOption.rb │ │ ├── tc_mdjson_valueRange.rb │ │ ├── tc_mdjson_vectorObject.rb │ │ ├── tc_mdjson_vectorRepresentation.rb │ │ ├── tc_mdjson_verticalDatum.rb │ │ ├── tc_mdjson_verticalExtent.rb │ │ ├── tc_mdjson_voucher.rb │ │ └── testData │ │ │ └── computedBbox.json │ └── sbJson │ │ ├── sbjson_test_parent.rb │ │ ├── tc_sbjson_body.rb │ │ ├── tc_sbjson_browseCategory.rb │ │ ├── tc_sbjson_budget.rb │ │ ├── tc_sbjson_citation.rb │ │ ├── tc_sbjson_contact.rb │ │ ├── tc_sbjson_date.rb │ │ ├── tc_sbjson_id.rb │ │ ├── tc_sbjson_identifier.rb │ │ ├── tc_sbjson_materialRequest.rb │ │ ├── tc_sbjson_parentId.rb │ │ ├── tc_sbjson_project.rb │ │ ├── tc_sbjson_provenance.rb │ │ ├── tc_sbjson_publication.rb │ │ ├── tc_sbjson_purpose.rb │ │ ├── tc_sbjson_rights.rb │ │ ├── tc_sbjson_spatial.rb │ │ ├── tc_sbjson_tag.rb │ │ ├── tc_sbjson_titles.rb │ │ ├── tc_sbjson_webLinkDoc.rb │ │ ├── tc_sbjson_webLinkGraphic.rb │ │ ├── testData │ │ ├── body.json │ │ ├── browseCategory.json │ │ ├── budget.json │ │ ├── citation.json │ │ ├── clean.json │ │ ├── contact.json │ │ ├── date.json │ │ ├── extent.json │ │ ├── id.json │ │ ├── identifier.json │ │ ├── lcc1.json │ │ ├── lcc2.json │ │ ├── materialRequest.json │ │ ├── parentId.json │ │ ├── project.json │ │ ├── provenance.json │ │ ├── publication.json │ │ ├── purpose.json │ │ ├── relatedItem.json │ │ ├── rights.json │ │ ├── sbGeospatial.json │ │ ├── sbTabular.json │ │ ├── spatial.json │ │ ├── tag.json │ │ ├── titles.json │ │ └── webLink.json │ │ ├── xc_sbjson_clean.rb │ │ ├── xc_sbjson_extent.rb │ │ ├── xc_sbjson_relatedItem.rb │ │ └── xc_sbjson_sbSbJson.rb ├── translator │ ├── tc_fgdc_reader.rb │ ├── tc_mdJson_reader.rb │ ├── tc_mdJson_schemaExample.rb │ ├── tc_mdReaders.rb │ ├── tc_mdWriters.rb │ ├── tc_mdtranslator.rb │ ├── tc_mdtranslator_CLI.rb │ ├── tc_sbJson_reader.rb │ ├── tc_translator_roundTrip.rb │ └── testData │ │ ├── fgdc_badForm.xml │ │ ├── fgdc_demo.xml │ │ ├── fgdc_invalid.xml │ │ ├── fgdc_minimal.xml │ │ ├── mdJson_invalid.json │ │ ├── mdJson_minimal.json │ │ └── sbJson_invalid.json └── writers │ ├── dcat_us │ ├── dcat_us_test_parent.rb │ ├── tc_dcat_us_access_level.rb │ ├── tc_dcat_us_contact_point.rb │ ├── tc_dcat_us_described_by.rb │ ├── tc_dcat_us_description.rb │ ├── tc_dcat_us_distribution.rb │ ├── tc_dcat_us_identifier.rb │ ├── tc_dcat_us_is_part_of.rb │ ├── tc_dcat_us_issued.rb │ ├── tc_dcat_us_keyword.rb │ ├── tc_dcat_us_landing_page.rb │ ├── tc_dcat_us_license.rb │ ├── tc_dcat_us_modified.rb │ ├── tc_dcat_us_publisher.rb │ ├── tc_dcat_us_references.rb │ ├── tc_dcat_us_rights.rb │ ├── tc_dcat_us_spatial.rb │ ├── tc_dcat_us_system_of_records.rb │ ├── tc_dcat_us_temporal.rb │ ├── tc_dcat_us_theme.rb │ ├── tc_dcat_us_title.rb │ └── testData │ │ ├── accessLevel_nonPub.json │ │ ├── accessLevel_nonPub_legal.json │ │ ├── accessLevel_nonPub_security.json │ │ ├── accessLevel_pub.json │ │ ├── accessLevel_resPub.json │ │ ├── accessLevel_resPub_legal.json │ │ ├── accessLevel_resPub_security.json │ │ ├── contactPoint.json │ │ ├── describedBy.json │ │ ├── description.json │ │ ├── distribution.json │ │ ├── identifier.json │ │ ├── identifier2.json │ │ ├── isPartOf.json │ │ ├── issued.json │ │ ├── keyword.json │ │ ├── landingPage.json │ │ ├── license.json │ │ ├── modified.json │ │ ├── modified2.json │ │ ├── publisher.json │ │ ├── publisher2.json │ │ ├── references.json │ │ ├── rights.json │ │ ├── spatial.json │ │ ├── systemOfRecords.json │ │ ├── temporal.json │ │ ├── theme.json │ │ └── title.json │ ├── fgdc │ ├── fgdc_test_parent.rb │ ├── tc_browse.rb │ ├── tc_citation.rb │ ├── tc_constraint.rb │ ├── tc_contact.rb │ ├── tc_description.rb │ ├── tc_dictionary.rb │ ├── tc_distribution.rb │ ├── tc_fgdc.rb │ ├── tc_forceValid.rb │ ├── tc_geodeticReference.rb │ ├── tc_geographicResolution.rb │ ├── tc_geologicAge.rb │ ├── tc_identification.rb │ ├── tc_keyword.rb │ ├── tc_lineage.rb │ ├── tc_localPlanar.rb │ ├── tc_localSystem.rb │ ├── tc_metadataInfo.rb │ ├── tc_method.rb │ ├── tc_planarGrid.rb │ ├── tc_planarInfo.rb │ ├── tc_planarMap.rb │ ├── tc_process.rb │ ├── tc_publisher.rb │ ├── tc_quality.rb │ ├── tc_security.rb │ ├── tc_series.rb │ ├── tc_source.rb │ ├── tc_spatialDomain.rb │ ├── tc_spatialOrganization.rb │ ├── tc_status.rb │ ├── tc_taxonomy.rb │ ├── tc_timePeriod.rb │ ├── tc_verticalDatum.rb │ └── testData │ │ ├── browse.xml │ │ ├── citation.xml │ │ ├── constraint.xml │ │ ├── contact_organization.xml │ │ ├── contact_person.xml │ │ ├── description.xml │ │ ├── dictionary.xml │ │ ├── distribution.xml │ │ ├── fgdc.xml │ │ ├── geodeticReference.xml │ │ ├── geographicResolution.xml │ │ ├── geologicAge.xml │ │ ├── geologicAgeResults.xml │ │ ├── identification.xml │ │ ├── keyword.xml │ │ ├── lineage.xml │ │ ├── localSystem.xml │ │ ├── mapGridSystem.xml │ │ ├── mapLocal.xml │ │ ├── mapPlanarInfo.xml │ │ ├── mapProjection.xml │ │ ├── metadataInfo.xml │ │ ├── publisher.xml │ │ ├── quality.xml │ │ ├── security.xml │ │ ├── series.xml │ │ ├── spatialDomain.xml │ │ ├── spatialOrganization.xml │ │ ├── status.xml │ │ ├── taxonomy.xml │ │ ├── timePeriod.xml │ │ ├── timePeriodResults.xml │ │ └── verticalDatum.xml │ ├── html │ ├── tc_html_document.rb │ └── testData │ │ ├── metadataGeo.json │ │ └── metadataLargeGeo.json │ ├── iso19110 │ ├── iso19110_test_parent.rb │ ├── tc_19110_address.rb │ ├── tc_19110_contact.rb │ ├── tc_19110_fcFeatureCatalogue.rb │ ├── tc_19110_featureAttribute.rb │ ├── tc_19110_featureConstraint.rb │ ├── tc_19110_featureType.rb │ ├── tc_19110_listedValue.rb │ ├── tc_19110_locale.rb │ ├── tc_19110_onlineResource.rb │ ├── tc_19110_phone.rb │ ├── tc_19110_responsibleParty.rb │ └── testData │ │ ├── 19110_address.xml │ │ ├── 19110_contact.xml │ │ ├── 19110_fcFeatureCatalogue0.xml │ │ ├── 19110_fcFeatureCatalogue1.xml │ │ ├── 19110_featureAttribute.xml │ │ ├── 19110_featureConstraint.xml │ │ ├── 19110_featureType.xml │ │ ├── 19110_listedValue.xml │ │ ├── 19110_locale.xml │ │ ├── 19110_onlineResource.xml │ │ ├── 19110_phone.xml │ │ └── 19110_responsibleParty.xml │ ├── iso19115-2 │ ├── iso19115_2_test_parent.rb │ ├── tc_19115_2_address.rb │ ├── tc_19115_2_aggregateInfo.rb │ ├── tc_19115_2_algorithm.rb │ ├── tc_19115_2_attributeGroup.rb │ ├── tc_19115_2_boundingBox.rb │ ├── tc_19115_2_browseGraphic.rb.rb │ ├── tc_19115_2_citation.rb │ ├── tc_19115_2_contact.rb │ ├── tc_19115_2_coverageDescription.rb │ ├── tc_19115_2_dataIdentification.rb │ ├── tc_19115_2_dataQuality.rb │ ├── tc_19115_2_date.rb │ ├── tc_19115_2_dimension.rb │ ├── tc_19115_2_distribution.rb │ ├── tc_19115_2_distributor.rb │ ├── tc_19115_2_duration.rb │ ├── tc_19115_2_extent.rb │ ├── tc_19115_2_feature.rb │ ├── tc_19115_2_featureProperties.rb │ ├── tc_19115_2_format.rb │ ├── tc_19115_2_fraction.rb │ ├── tc_19115_2_geographicElement.rb │ ├── tc_19115_2_geographicExtent.rb │ ├── tc_19115_2_geometricObject.rb │ ├── tc_19115_2_georectified.rb │ ├── tc_19115_2_georeferenceable.rb │ ├── tc_19115_2_gmlIdentifier.rb │ ├── tc_19115_2_grid.rb │ ├── tc_19115_2_gridRepresentation.rb │ ├── tc_19115_2_hierarchy.rb │ ├── tc_19115_2_image.rb │ ├── tc_19115_2_keyword.rb │ ├── tc_19115_2_leProcessStep.rb │ ├── tc_19115_2_leSource.rb │ ├── tc_19115_2_legalConstraint.rb │ ├── tc_19115_2_liProcessStep.rb │ ├── tc_19115_2_liSource.rb │ ├── tc_19115_2_lineage.rb │ ├── tc_19115_2_locale.rb │ ├── tc_19115_2_maintenance.rb │ ├── tc_19115_2_mdBand.rb │ ├── tc_19115_2_mdIdentifier.rb │ ├── tc_19115_2_measure.rb │ ├── tc_19115_2_medium.rb │ ├── tc_19115_2_metadataDate.rb │ ├── tc_19115_2_miBand.rb │ ├── tc_19115_2_miMetadata.rb │ ├── tc_19115_2_nominalResolution.rb │ ├── tc_19115_2_onlineResource.rb │ ├── tc_19115_2_orderProcess.rb │ ├── tc_19115_2_phone.rb │ ├── tc_19115_2_processReport.rb │ ├── tc_19115_2_processing.rb │ ├── tc_19115_2_rangeDimension.rb │ ├── tc_19115_2_referenceSystem.rb │ ├── tc_19115_2_resolution.rb │ ├── tc_19115_2_responsibleParty.rb │ ├── tc_19115_2_rsIdentifier.rb │ ├── tc_19115_2_scope.rb │ ├── tc_19115_2_scopeDescription.rb │ ├── tc_19115_2_securityConstraint.rb │ ├── tc_19115_2_series.rb │ ├── tc_19115_2_taxonomicClassification.rb │ ├── tc_19115_2_taxonomicSystem.rb │ ├── tc_19115_2_taxonomy.rb │ ├── tc_19115_2_temporalExtent.rb │ ├── tc_19115_2_timeInstant.rb │ ├── tc_19115_2_timeInterval.rb │ ├── tc_19115_2_timePeriod.rb │ ├── tc_19115_2_transferOptions.rb │ ├── tc_19115_2_usage.rb │ ├── tc_19115_2_useConstraint.rb │ ├── tc_19115_2_vectorRepresentation.rb │ ├── tc_19115_2_verticalExtent.rb │ ├── tc_19115_2_voucher.rb │ └── testData │ │ ├── 19115_2_address.xml │ │ ├── 19115_2_aggregateInfo.xml │ │ ├── 19115_2_algorithm.xml │ │ ├── 19115_2_attributeGroup.xml │ │ ├── 19115_2_boundingBox.xml │ │ ├── 19115_2_browseGraphic.xml │ │ ├── 19115_2_citation.xml │ │ ├── 19115_2_contact.xml │ │ ├── 19115_2_coverageDescription.xml │ │ ├── 19115_2_dataIdentification.xml │ │ ├── 19115_2_dataQuality.xml │ │ ├── 19115_2_date.xml │ │ ├── 19115_2_dimension.xml │ │ ├── 19115_2_distribution.xml │ │ ├── 19115_2_distributor.xml │ │ ├── 19115_2_duration.xml │ │ ├── 19115_2_extent.xml │ │ ├── 19115_2_feature.xml │ │ ├── 19115_2_featureProperties.xml │ │ ├── 19115_2_format.xml │ │ ├── 19115_2_fraction.xml │ │ ├── 19115_2_geographicElement.xml │ │ ├── 19115_2_geographicExtent.xml │ │ ├── 19115_2_geometricObject.xml │ │ ├── 19115_2_georectified.xml │ │ ├── 19115_2_georeferenceable.xml │ │ ├── 19115_2_gmlIdentifier.xml │ │ ├── 19115_2_grid.xml │ │ ├── 19115_2_gridRepresentation.xml │ │ ├── 19115_2_hierarchy.xml │ │ ├── 19115_2_image.xml │ │ ├── 19115_2_keyword.xml │ │ ├── 19115_2_leProcessStep.xml │ │ ├── 19115_2_leSource.xml │ │ ├── 19115_2_legalConstraint.xml │ │ ├── 19115_2_liProcessStep.xml │ │ ├── 19115_2_liSource.xml │ │ ├── 19115_2_lineage.xml │ │ ├── 19115_2_locale.xml │ │ ├── 19115_2_maintenance.xml │ │ ├── 19115_2_mdBand.xml │ │ ├── 19115_2_mdIdentifier.xml │ │ ├── 19115_2_measure.xml │ │ ├── 19115_2_medium.xml │ │ ├── 19115_2_metadataDate.xml │ │ ├── 19115_2_miBand.xml │ │ ├── 19115_2_miMetadata.xml │ │ ├── 19115_2_nominalResolution.xml │ │ ├── 19115_2_onlineResource.xml │ │ ├── 19115_2_orderProcess.xml │ │ ├── 19115_2_phone.xml │ │ ├── 19115_2_processReport.xml │ │ ├── 19115_2_processing.xml │ │ ├── 19115_2_rangeDimension.xml │ │ ├── 19115_2_referenceSystem.xml │ │ ├── 19115_2_resolution.xml │ │ ├── 19115_2_responsibleParty.xml │ │ ├── 19115_2_rsIdentifier.xml │ │ ├── 19115_2_scope.xml │ │ ├── 19115_2_scopeDescription.xml │ │ ├── 19115_2_securityConstraint.xml │ │ ├── 19115_2_series.xml │ │ ├── 19115_2_taxonomicClassification.xml │ │ ├── 19115_2_taxonomicSystem.xml │ │ ├── 19115_2_taxonomy.xml │ │ ├── 19115_2_temporalExtent.xml │ │ ├── 19115_2_timeInstant.xml │ │ ├── 19115_2_timeInterval.xml │ │ ├── 19115_2_timePeriod.xml │ │ ├── 19115_2_transferOptions.xml │ │ ├── 19115_2_usage.xml │ │ ├── 19115_2_useConstraint.xml │ │ ├── 19115_2_vectorRepresentation.xml │ │ ├── 19115_2_verticalExtent.xml │ │ └── 19115_2_voucher.xml │ ├── iso19115-3 │ ├── iso19115_3_test_parent.rb │ ├── tc_19115_3_additionalDocument.rb │ ├── tc_19115_3_address.rb │ ├── tc_19115_3_algorithm.rb │ ├── tc_19115_3_associatedResource.rb │ ├── tc_19115_3_attribute.rb │ ├── tc_19115_3_attributeGroup.rb │ ├── tc_19115_3_boundingBox.rb │ ├── tc_19115_3_browseGraphic.rb │ ├── tc_19115_3_citation.rb │ ├── tc_19115_3_constraint.rb │ ├── tc_19115_3_constraintCommon.rb │ ├── tc_19115_3_contact.rb │ ├── tc_19115_3_coverageDescription.rb │ ├── tc_19115_3_dataIdentification.rb │ ├── tc_19115_3_date.rb │ ├── tc_19115_3_dimension.rb │ ├── tc_19115_3_distribution.rb │ ├── tc_19115_3_distributor.rb │ ├── tc_19115_3_extent.rb │ ├── tc_19115_3_feature.rb │ ├── tc_19115_3_featureCatalogue.rb │ ├── tc_19115_3_featureProperties.rb │ ├── tc_19115_3_format.rb │ ├── tc_19115_3_fraction.rb │ ├── tc_19115_3_geographicElement.rb │ ├── tc_19115_3_geographicExtent.rb │ ├── tc_19115_3_geometricObject.rb │ ├── tc_19115_3_geometryCollection.rb │ ├── tc_19115_3_georectified.rb │ ├── tc_19115_3_georeferenceable.rb │ ├── tc_19115_3_gmlIdentifier.rb │ ├── tc_19115_3_grid.rb │ ├── tc_19115_3_gridRepresentation.rb │ ├── tc_19115_3_identifier.rb │ ├── tc_19115_3_image.rb │ ├── tc_19115_3_individual.rb │ ├── tc_19115_3_keyword.rb │ ├── tc_19115_3_leProcessStep.rb │ ├── tc_19115_3_leSource.rb │ ├── tc_19115_3_legalConstraint.rb │ ├── tc_19115_3_liProcessStep.rb │ ├── tc_19115_3_liSource.rb │ ├── tc_19115_3_lineage.rb │ ├── tc_19115_3_locale.rb │ ├── tc_19115_3_maintenance.rb │ ├── tc_19115_3_mdBand.rb │ ├── tc_19115_3_mdMetadata.rb │ ├── tc_19115_3_measure.rb │ ├── tc_19115_3_medium.rb │ ├── tc_19115_3_miBand.rb │ ├── tc_19115_3_nominalResolution.rb │ ├── tc_19115_3_onlineResource.rb │ ├── tc_19115_3_orderProcess.rb │ ├── tc_19115_3_organization.rb │ ├── tc_19115_3_partyIdentifier.rb │ ├── tc_19115_3_phone.rb │ ├── tc_19115_3_processReport.rb │ ├── tc_19115_3_processing.rb │ ├── tc_19115_3_rangeDimension.rb │ ├── tc_19115_3_referenceSystem.rb │ ├── tc_19115_3_releasability.rb │ ├── tc_19115_3_resolution.rb │ ├── tc_19115_3_responsibility.rb │ ├── tc_19115_3_sampleDimension.rb │ ├── tc_19115_3_scope.rb │ ├── tc_19115_3_scopeDescription.rb │ ├── tc_19115_3_securityConstraint.rb │ ├── tc_19115_3_series.rb │ ├── tc_19115_3_spatialRepresentation.rb │ ├── tc_19115_3_spatialRepresentation_scope.rb │ ├── tc_19115_3_temporalExtent.rb │ ├── tc_19115_3_timeInstant.rb │ ├── tc_19115_3_timePeriod.rb │ ├── tc_19115_3_transferOptions.rb │ ├── tc_19115_3_usage.rb │ ├── tc_19115_3_useConstraint.rb │ ├── tc_19115_3_vectorRepresentation.rb │ ├── tc_19115_3_verticalExtent.rb │ └── testData │ │ ├── 19115_3_additionalDocument.xml │ │ ├── 19115_3_address.xml │ │ ├── 19115_3_algorithm.xml │ │ ├── 19115_3_associatedResource.xml │ │ ├── 19115_3_attribute.xml │ │ ├── 19115_3_attributeGroup.xml │ │ ├── 19115_3_boundingBox.xml │ │ ├── 19115_3_browseGraphic.xml │ │ ├── 19115_3_citation.xml │ │ ├── 19115_3_constraint.xml │ │ ├── 19115_3_constraintCommon.xml │ │ ├── 19115_3_contact.xml │ │ ├── 19115_3_coverageDescription.xml │ │ ├── 19115_3_dataIdentification.xml │ │ ├── 19115_3_date.xml │ │ ├── 19115_3_dimension.xml │ │ ├── 19115_3_distribution.xml │ │ ├── 19115_3_distributor.xml │ │ ├── 19115_3_extent.xml │ │ ├── 19115_3_feature.xml │ │ ├── 19115_3_featureCatalogue.xml │ │ ├── 19115_3_featureProperties.xml │ │ ├── 19115_3_format.xml │ │ ├── 19115_3_fraction.xml │ │ ├── 19115_3_geographicElement.xml │ │ ├── 19115_3_geographicExtent.xml │ │ ├── 19115_3_geometricObject.xml │ │ ├── 19115_3_geometryCollection.xml │ │ ├── 19115_3_georectified.xml │ │ ├── 19115_3_georeferenceable.xml │ │ ├── 19115_3_gmlIdentifier.xml │ │ ├── 19115_3_grid.xml │ │ ├── 19115_3_gridRepresentation.xml │ │ ├── 19115_3_identifier.xml │ │ ├── 19115_3_image.xml │ │ ├── 19115_3_individual.xml │ │ ├── 19115_3_keyword.xml │ │ ├── 19115_3_leProcessStep.xml │ │ ├── 19115_3_leSource.xml │ │ ├── 19115_3_legalConstraint.xml │ │ ├── 19115_3_liProcessStep.xml │ │ ├── 19115_3_liSource.xml │ │ ├── 19115_3_lineage.xml │ │ ├── 19115_3_locale.xml │ │ ├── 19115_3_maintenance.xml │ │ ├── 19115_3_mdBand.xml │ │ ├── 19115_3_mdMetadata.xml │ │ ├── 19115_3_measure.xml │ │ ├── 19115_3_medium.xml │ │ ├── 19115_3_miBand.xml │ │ ├── 19115_3_nominalResolution.xml │ │ ├── 19115_3_onlineResource.xml │ │ ├── 19115_3_orderProcess.xml │ │ ├── 19115_3_organization.xml │ │ ├── 19115_3_partyIdentifier.xml │ │ ├── 19115_3_phone.xml │ │ ├── 19115_3_processReport.xml │ │ ├── 19115_3_processing.xml │ │ ├── 19115_3_rangeDimension.xml │ │ ├── 19115_3_referenceSystem.xml │ │ ├── 19115_3_releasability.xml │ │ ├── 19115_3_resolution.xml │ │ ├── 19115_3_responsibility.xml │ │ ├── 19115_3_sampleDimension.xml │ │ ├── 19115_3_scope.xml │ │ ├── 19115_3_scopeDescription.xml │ │ ├── 19115_3_securityConstraint.xml │ │ ├── 19115_3_series.xml │ │ ├── 19115_3_spatialRepresentation.xml │ │ ├── 19115_3_spatialRepresentation_scope.xml │ │ ├── 19115_3_temporalExtent.xml │ │ ├── 19115_3_timeInstant.xml │ │ ├── 19115_3_timePeriod.xml │ │ ├── 19115_3_transferOptions.xml │ │ ├── 19115_3_usage.xml │ │ ├── 19115_3_useConstraint.xml │ │ ├── 19115_3_vectorRepresentation.xml │ │ └── 19115_3_verticalExtent.xml │ ├── mdJson │ ├── mdjson_test_parent.rb │ ├── tc_mdjson_additionalDocumentation.rb │ ├── tc_mdjson_address.rb │ ├── tc_mdjson_algorithm.rb │ ├── tc_mdjson_allocation.rb │ ├── tc_mdjson_associatedResource.rb │ ├── tc_mdjson_attribute.rb │ ├── tc_mdjson_attributeGroup.rb │ ├── tc_mdjson_boundingBox.rb │ ├── tc_mdjson_citation.rb │ ├── tc_mdjson_constraint.rb │ ├── tc_mdjson_contact.rb │ ├── tc_mdjson_coverage.rb │ ├── tc_mdjson_dataQuality.rb │ ├── tc_mdjson_date.rb │ ├── tc_mdjson_dictionary.rb │ ├── tc_mdjson_dimension.rb │ ├── tc_mdjson_distributionInfo.rb │ ├── tc_mdjson_distributor.rb │ ├── tc_mdjson_domain.rb │ ├── tc_mdjson_duration.rb │ ├── tc_mdjson_entity.rb │ ├── tc_mdjson_entityAttribute.rb │ ├── tc_mdjson_entityForeignKey.rb │ ├── tc_mdjson_entityIndex.rb │ ├── tc_mdjson_extent.rb │ ├── tc_mdjson_format.rb │ ├── tc_mdjson_funding.rb │ ├── tc_mdjson_geodeticParameters.rb │ ├── tc_mdjson_geographicExtent.rb │ ├── tc_mdjson_geologicAge.rb │ ├── tc_mdjson_georectified.rb │ ├── tc_mdjson_georeferenceable.rb │ ├── tc_mdjson_graphic.rb │ ├── tc_mdjson_grid.rb │ ├── tc_mdjson_identifier.rb │ ├── tc_mdjson_image.rb │ ├── tc_mdjson_keyword.rb │ ├── tc_mdjson_keywordObject.rb │ ├── tc_mdjson_lineageInfo.rb │ ├── tc_mdjson_localProjection.rb │ ├── tc_mdjson_locale.rb │ ├── tc_mdjson_maintenance.rb │ ├── tc_mdjson_mdJson.rb │ ├── tc_mdjson_measure.rb │ ├── tc_mdjson_medium.rb │ ├── tc_mdjson_metadata.rb │ ├── tc_mdjson_metadataInfo.rb │ ├── tc_mdjson_nominalResolution.rb │ ├── tc_mdjson_obliqueLinePoint.rb │ ├── tc_mdjson_onlineResource.rb │ ├── tc_mdjson_orderProcess.rb │ ├── tc_mdjson_phone.rb │ ├── tc_mdjson_processReport.rb │ ├── tc_mdjson_processStep.rb │ ├── tc_mdjson_processing.rb │ ├── tc_mdjson_projectionParameters.rb │ ├── tc_mdjson_releasability.rb │ ├── tc_mdjson_resourceInfo.rb │ ├── tc_mdjson_responsibleParty.rb │ ├── tc_mdjson_scope.rb │ ├── tc_mdjson_series.rb │ ├── tc_mdjson_source.rb │ ├── tc_mdjson_spatialReference.rb │ ├── tc_mdjson_spatialReferenceParameters.rb │ ├── tc_mdjson_spatialRepresentation.rb │ ├── tc_mdjson_spatialResolution.rb │ ├── tc_mdjson_taxonomicClassification.rb │ ├── tc_mdjson_taxonomicSystem.rb │ ├── tc_mdjson_taxonomy.rb │ ├── tc_mdjson_temporalExtent.rb │ ├── tc_mdjson_timeInstant.rb │ ├── tc_mdjson_timePeriod.rb │ ├── tc_mdjson_transferOption.rb │ ├── tc_mdjson_usage.rb │ ├── tc_mdjson_valueRange.rb │ ├── tc_mdjson_vector.rb │ ├── tc_mdjson_vectorObject.rb │ ├── tc_mdjson_verticalDatum.rb │ ├── tc_mdjson_verticalExtent.rb │ └── tc_mdjson_voucher.rb │ ├── sbJson │ ├── sbjson_test_parent.rb │ ├── tc_sbjson_browseCategory.rb │ ├── tc_sbjson_budget.rb │ ├── tc_sbjson_citation.rb │ ├── tc_sbjson_contact.rb │ ├── tc_sbjson_date.rb │ ├── tc_sbjson_geographicExtent.rb │ ├── tc_sbjson_id.rb │ ├── tc_sbjson_identifier.rb │ ├── tc_sbjson_materialRequest.rb │ ├── tc_sbjson_parentId.rb │ ├── tc_sbjson_project.rb │ ├── tc_sbjson_provenance.rb │ ├── tc_sbjson_publication.rb │ ├── tc_sbjson_resourceInfo.rb │ ├── tc_sbjson_rights.rb │ ├── tc_sbjson_spatial.rb │ ├── tc_sbjson_tag.rb │ ├── tc_sbjson_title.rb │ ├── tc_sbjson_webLink.rb │ └── testData │ │ ├── browseCategory.json │ │ ├── budget.json │ │ ├── citation.json │ │ ├── contact.json │ │ ├── date.json │ │ ├── geographicExtent.json │ │ ├── id.json │ │ ├── identifier.json │ │ ├── materialRequest.json │ │ ├── metadataRepository.json │ │ ├── parentId.json │ │ ├── project.json │ │ ├── provenance.json │ │ ├── publication.json │ │ ├── resourceInfo.json │ │ ├── rights.json │ │ ├── spatial.json │ │ ├── tag.json │ │ ├── title.json │ │ └── webLink.json │ └── simple_html │ ├── tc_simple_html_document.rb │ └── testData │ ├── metadataGeo.json │ └── metadataLargeGeo.json └── version.json /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: Tests 2 | 3 | on: [push] 4 | 5 | jobs: 6 | test: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@v4 10 | - uses: ruby/setup-ruby@v1 11 | with: 12 | ruby-version: "3.1" # Not needed with a .ruby-version file 13 | - run: bundle install 14 | - run: bundle exec rake 15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.project 2 | *.gem 3 | *.rbc 4 | .bundle 5 | .config 6 | .yardoc 7 | InstalledFiles 8 | _yardoc 9 | coverage 10 | doc/ 11 | lib/bundler/man 12 | pkg 13 | rdoc 14 | spec/reports 15 | dev 16 | tmp 17 | *.bundle 18 | *.so 19 | *.o 20 | *.a 21 | mkmf.log 22 | /.idea 23 | /.rake_tasks~ 24 | vendor/ 25 | *.DS_Store -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /.jsbeautifyrc: -------------------------------------------------------------------------------- 1 | { 2 | "ruby": { 3 | "indent_size": 2, 4 | "indent_char": " ", 5 | "indent_level": 0, 6 | "indent_with_tabs": false 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | 2 | sudo: false 3 | language: ruby 4 | before_install: 'gem install bundler' 5 | rvm: 6 | - "2.4" 7 | - "2.5" 8 | - "2.6" 9 | - jruby-head 10 | - ruby-head 11 | matrix: 12 | allow_failures: 13 | - rvm: jruby-head 14 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | # Specify your gem's dependencies in adiwg-mdtranslator.gemspec 4 | gemspec 5 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | 2 | require 'bundler/gem_tasks' 3 | require 'rake/testtask' 4 | 5 | # Rake::TestTask.new do |t| 6 | # t.libs << 'test' 7 | # t.test_files = FileList[ 8 | # 'test/writers/iso19115-2/tc*.rb' 9 | # ] 10 | # t.verbose = true 11 | # end 12 | 13 | Rake::TestTask.new do |t| 14 | t.libs << 'test' 15 | t.test_files = FileList[ 16 | 'test/readers/fgdc/tc*.rb', 17 | 'test/readers/mdJson/tc*.rb', 18 | 'test/readers/sbJson/tc*.rb', 19 | 'test/writers/fgdc/tc*.rb', 20 | 'test/writers/html/tc*.rb', 21 | 'test/writers/iso19110/tc*.rb', 22 | 'test/writers/iso19115-2/tc*.rb', 23 | 'test/writers/iso19115-3/tc*.rb', 24 | 'test/writers/mdJson/tc*.rb', 25 | 'test/writers/sbJson/tc*.rb', 26 | 'test/writers/dcat_us/tc*.rb', 27 | 'test/translator/tc*.rb' 28 | ] 29 | t.verbose = true 30 | t.warning = false 31 | end 32 | 33 | desc 'Run tests' 34 | task :default => :test 35 | -------------------------------------------------------------------------------- /bin/mdtranslator: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # ADIwg mdTranslator - Thor CLI for mdtranslator 3 | 4 | # History: 5 | # Stan Smith 2017-04-22 original script 6 | require 'adiwg-mdtranslator' 7 | require_relative '../lib/adiwg/mdtranslator_cli' 8 | 9 | MdtranslatorCLI.start(ARGV) 10 | -------------------------------------------------------------------------------- /lib/adiwg-mdtranslator.rb: -------------------------------------------------------------------------------- 1 | require 'adiwg/mdtranslator' 2 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/internal/module_codelistFun.rb: -------------------------------------------------------------------------------- 1 | # codelist methods 2 | # for ADIwg readers and writers 3 | 4 | # History: 5 | # Stan Smith 2019-03-22 original script 6 | 7 | require 'adiwg-mdcodes' 8 | 9 | module CodelistFun 10 | 11 | def self.validateItem(codeList, codeName) 12 | 13 | # get requested codelist from the adiwg-mdcodes gem 14 | mdCodelist = ADIWG::Mdcodes.getCodelistDetail(codeList) 15 | 16 | aCodes = mdCodelist['codelist'] 17 | 18 | # search the codelist for a matching codeName 19 | aCodes.each do |hCode| 20 | return true if hCode['codeName'] == codeName 21 | end 22 | return false 23 | 24 | end 25 | 26 | end 27 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/readers/fgdc/modules/module_onlineResource.rb: -------------------------------------------------------------------------------- 1 | # Reader - fgdc to internal data structure 2 | # unpack fgdc online resource 3 | 4 | # History: 5 | # Stan Smith 2017-08-17 original script 6 | 7 | require 'nokogiri' 8 | require 'adiwg/mdtranslator/internal/internal_metadata_obj' 9 | 10 | module ADIWG 11 | module Mdtranslator 12 | module Readers 13 | module Fgdc 14 | 15 | module OnlineResource 16 | 17 | def self.unpack(onLink, description, hResponseObj) 18 | 19 | # instance classes needed in script 20 | intMetadataClass = InternalMetadata.new 21 | hURI = intMetadataClass.newOnlineResource 22 | 23 | hURI[:olResURI] = onLink 24 | hURI[:olResDesc] = description 25 | 26 | return hURI 27 | 28 | end 29 | 30 | end 31 | 32 | end 33 | end 34 | end 35 | end 36 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/readers/fgdc/readme.md: -------------------------------------------------------------------------------- 1 | 2 | ## sbJson 3 | 4 | ### Supported versions 5 | 6 | > 1.x (FGDC-STD-001-1998) 7 | 8 | ### Reader for Federal Geographic Data Committee's Content Standard for Digital Geospatial Metadata (fgdc) 9 | 10 | Content Standard for Digital Geospatial Metadata (CSDGM), Vers. 2 11 | (FGDC-STD-001-1998) is the current version of this FGDC authored and 12 | endorsed standard. Executive Order 12906, directed that Federal agencies 13 | document geospatial resources using this standard. Since the publication 14 | of EO 12906, the FGDC has endorsed several ISO Geospatial Metadata 15 | Standards that are now encouraged for use. 16 | 17 | The FGDC CSDGM format standard is fully documented on the 18 | [Content Standard for Digital Geospatial Metadata page](https://www.fgdc.gov/metadata/csdgm-standard). 19 | 20 | This FGDC reader extends the FGDC standard by added the Biological Data Profile 21 | FGDC-STD-001.1-1999 as defined by the U.S. Geological Survey National Biological 22 | Information Infrastructure (NBII). -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/readers/fgdc/version.rb: -------------------------------------------------------------------------------- 1 | # adiwg mdTranslator / readers / fgdc 2 | 3 | # version 1 history 4 | # 1.0.2 2018-06-12 change default time stamps from 'local' to UTC 5 | # 1.0.2 2018-06-11 fix bug #179 remove 0 time value from date string when time not present 6 | # 1.0.1 2018-02-15 add messaging 7 | # 1.0.0 2017-07-11 version 1 FGDC CSDGM 8 | 9 | module ADIWG 10 | module Mdtranslator 11 | module Readers 12 | module Fgdc 13 | VERSION = "1.0.2" 14 | end 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/readers/mdJson/readme.md: -------------------------------------------------------------------------------- 1 | 2 | ## mdJson 3 | 4 | ### Supported versions 5 | 6 | > 2.x 7 | 8 | ### Reader for ADIwg JSON metadata format (mdJson) 9 | 10 | The mdJson format is a simple JSON format for documenting and 11 | exchanging information about scientific projects and data. 12 | The Alaska Data Integration working group (ADIwg) wrote the standard 13 | to support translation to complex standards such as the ISO 19115-2 14 | Geographic Metadata standard and FGDC's Content Standard for Digital 15 | Geospatial Metadata. The mdJson standard remains independent of any 16 | published standards while comprehensive enough to support translation 17 | to established standards. The mdJson record is also a convenient format 18 | to exchange directly with other organizations as the JSON structure 19 | is easily created and ingest by programming languages. 20 | 21 | The mdJson format is fully documented on the interactive 22 | [mdTools](http://mdTools.adiwg.org) website. 23 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/readers/sbJson/modules/module_body.rb: -------------------------------------------------------------------------------- 1 | # unpack body / summary 2 | # Reader - ScienceBase JSON to internal data structure 3 | 4 | # History: 5 | # Stan Smith 2017-11-29 do not import short abstract 6 | # Stan Smith 2016-06-19 original script 7 | 8 | module ADIWG 9 | module Mdtranslator 10 | module Readers 11 | module SbJson 12 | 13 | module Body 14 | 15 | def self.unpack(hSbJson, hResourceInfo, hResponseObj) 16 | 17 | # body 18 | if hSbJson.has_key?('body') 19 | sbAbstract = hSbJson['body'] 20 | unless sbAbstract.nil? || sbAbstract == '' 21 | hResourceInfo[:abstract] = sbAbstract 22 | end 23 | end 24 | 25 | # summary 26 | # do not import short abstract 27 | # sbJson forces summary to first 300 characters of abstract 28 | 29 | return hResourceInfo 30 | 31 | end 32 | 33 | end 34 | 35 | end 36 | end 37 | end 38 | end 39 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/readers/sbJson/modules/module_citation.rb: -------------------------------------------------------------------------------- 1 | # unpack citation 2 | # Reader - ScienceBase JSON to internal data structure 3 | 4 | # History: 5 | # Stan Smith 2016-06-19 original script 6 | 7 | module ADIWG 8 | module Mdtranslator 9 | module Readers 10 | module SbJson 11 | 12 | module Citation 13 | 14 | def self.unpack(hSbJson, hCitation, hResponseObj) 15 | 16 | if hSbJson.has_key?('citation') 17 | sbCitation = hSbJson['citation'] 18 | unless sbCitation.nil? || sbCitation == '' 19 | hCitation[:otherDetails][0] = sbCitation 20 | end 21 | end 22 | 23 | return hCitation 24 | 25 | end 26 | 27 | end 28 | 29 | end 30 | end 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/readers/sbJson/modules/module_purpose.rb: -------------------------------------------------------------------------------- 1 | # unpack purpose 2 | # Reader - ScienceBase JSON to internal data structure 3 | 4 | # History: 5 | # Stan Smith 2016-06-19 original script 6 | 7 | module ADIWG 8 | module Mdtranslator 9 | module Readers 10 | module SbJson 11 | 12 | module Purpose 13 | 14 | def self.unpack(hSbJson, hResourceInfo, hResponseObj) 15 | 16 | if hSbJson.has_key?('purpose') 17 | sbPurpose = hSbJson['purpose'] 18 | unless sbPurpose.nil? || sbPurpose == '' 19 | hResourceInfo[:purpose] = sbPurpose 20 | end 21 | end 22 | 23 | return hResourceInfo 24 | 25 | end 26 | 27 | end 28 | 29 | end 30 | end 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/readers/sbJson/readme.md: -------------------------------------------------------------------------------- 1 | 2 | ## sbJson 3 | 4 | ### Supported versions 5 | 6 | > 0.0.x 7 | 8 | ### Reader for ScienceBase JSON metadata format (sbJSON) 9 | 10 | The ScienceBase Item core is based on the Dublin Core Metadata 11 | Element Set but also includes other elements that may or may not 12 | be associated with other metadata standards that are useful for the 13 | core attribution of ScienceBase items. It is used as a means to 14 | integrate across multiple metadata standards, conventions, and 15 | practices in describing a wide array of scientific data and 16 | information assets important to science teams using ScienceBase. 17 | 18 | The sbJSON format is partially documented on the [ScienceBase Confluence page](https://my.usgs.gov/confluence/display/sciencebase/ScienceBase+Information+Model). 19 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/readers/sbJson/version.rb: -------------------------------------------------------------------------------- 1 | # adiwg mdTranslator / readers / sbJson 2 | 3 | # version 0 history 4 | # 0.0.0 2016-10-01 start of version 0 5 | 6 | module ADIWG 7 | module Mdtranslator 8 | module Readers 9 | module SbJson 10 | VERSION = '0.1.0' 11 | end 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/dcat_us/readme.md: -------------------------------------------------------------------------------- 1 | 2 | ## dcat_us 3 | 4 | ### Supported versions 5 | 6 | > 0.0.x (dcat_us is not currently versioned) 7 | 8 | ### Writer for Data Catalog Vocabulary (DCAT) v1.1 9 | 10 | 11 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_access_url.rb: -------------------------------------------------------------------------------- 1 | require 'jbuilder' 2 | 3 | module ADIWG 4 | module Mdtranslator 5 | module Writers 6 | module Dcat_us 7 | module AccessURL 8 | 9 | def self.build(option) 10 | option[:olResURI] if option[:olResURI].end_with?('.html') 11 | end 12 | 13 | end 14 | end 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_contact_point.rb: -------------------------------------------------------------------------------- 1 | require 'jbuilder' 2 | 3 | module ADIWG 4 | module Mdtranslator 5 | module Writers 6 | module Dcat_us 7 | module ContactPoint 8 | 9 | def self.build(intObj) 10 | resourceInfo = intObj[:metadata][:resourceInfo] 11 | pointOfContact = resourceInfo[:pointOfContacts][0] 12 | contactId = pointOfContact[:parties][0][:contactId] 13 | 14 | contact = Dcat_us.get_contact_by_id(contactId) 15 | fn = contact[:name] 16 | hasEmail = contact[:eMailList][0] 17 | 18 | Jbuilder.new do |json| 19 | json.set!('@type', 'vcard:Contact') 20 | json.set!('fn', fn) 21 | json.set!('hasEmail', hasEmail) 22 | end 23 | 24 | end 25 | end 26 | end 27 | end 28 | end 29 | end 30 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_described_by.rb: -------------------------------------------------------------------------------- 1 | require 'jbuilder' 2 | 3 | module ADIWG 4 | module Mdtranslator 5 | module Writers 6 | module Dcat_us 7 | module DescribedBy 8 | 9 | def self.build(intObj) 10 | dataDictionaries = intObj[:dataDictionaries] 11 | dataDictionaries.each do |dataDictionary| 12 | unless dataDictionary[:includedWithDataset] 13 | onlineResources = dataDictionary[:citation][:onlineResources] 14 | onlineResources.each do |resource| 15 | if resource[:olResURI] 16 | return resource[:olResURI] 17 | end 18 | end 19 | end 20 | end 21 | 22 | nil 23 | end 24 | 25 | end 26 | end 27 | end 28 | end 29 | end 30 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_description.rb: -------------------------------------------------------------------------------- 1 | module ADIWG 2 | module Mdtranslator 3 | module Writers 4 | module Dcat_us 5 | module Description 6 | 7 | def self.build(intObj) 8 | resourceInfo = intObj.dig(:metadata, :resourceInfo) 9 | description = resourceInfo&.dig(:abstract) 10 | 11 | return nil unless description 12 | end 13 | 14 | 15 | end 16 | end 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_download_url.rb: -------------------------------------------------------------------------------- 1 | require 'jbuilder' 2 | 3 | module ADIWG 4 | module Mdtranslator 5 | module Writers 6 | module Dcat_us 7 | module DownloadURL 8 | 9 | def self.build(option) 10 | option[:olResURI] unless option[:olResURI].end_with?('.html') 11 | end 12 | 13 | end 14 | end 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_identifier.rb: -------------------------------------------------------------------------------- 1 | module ADIWG 2 | module Mdtranslator 3 | module Writers 4 | module Dcat_us 5 | module Identifier 6 | 7 | def self.build(intObj) 8 | citation = intObj.dig(:metadata, :resourceInfo, :citation) 9 | identifiers = citation&.dig(:identifiers) 10 | onlineResources = citation&.dig(:onlineResources) 11 | uri = onlineResources.dig(0, :olResURI) 12 | 13 | namespace_is_doi = identifiers&.any? { |identifier| identifier[:namespace]&.casecmp?("DOI") } 14 | 15 | if namespace_is_doi 16 | return uri 17 | elsif uri && uri.downcase.include?("doi") 18 | return uri 19 | end 20 | 21 | nil 22 | end 23 | 24 | 25 | end 26 | end 27 | end 28 | end 29 | end 30 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_is_part_of.rb: -------------------------------------------------------------------------------- 1 | require 'jbuilder' 2 | 3 | module ADIWG 4 | module Mdtranslator 5 | module Writers 6 | module Dcat_us 7 | module IsPartOf 8 | 9 | def self.build(intObj) 10 | associatedResources = intObj.dig(:metadata, :associatedResources) 11 | 12 | associatedResources.each do |resource| 13 | next unless resource[:initiativeType] == "collection" && resource[:associationType] == "collectiveTitle" 14 | 15 | onlineResources = resource.dig(:resourceCitation, :onlineResources) || [] 16 | uri = onlineResources.find { |onlineResource| onlineResource[:olResURI] }&.dig(:olResURI) 17 | return uri if uri 18 | end 19 | 20 | nil 21 | end 22 | 23 | end 24 | end 25 | end 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_issued.rb: -------------------------------------------------------------------------------- 1 | require 'jbuilder' 2 | 3 | module ADIWG 4 | module Mdtranslator 5 | module Writers 6 | module Dcat_us 7 | module Issued 8 | 9 | def self.build(intObj) 10 | dates = intObj[:metadata][:resourceInfo][:citation][:dates].map { |obj| obj[:date] } 11 | earliest_date = dates.min 12 | return earliest_date 13 | end 14 | 15 | end 16 | end 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_keyword.rb: -------------------------------------------------------------------------------- 1 | module ADIWG 2 | module Mdtranslator 3 | module Writers 4 | module Dcat_us 5 | module Keyword 6 | 7 | def self.build(intObj) 8 | resourceInfo = intObj.dig(:metadata, :resourceInfo) 9 | keywords = resourceInfo&.dig(:keywords) 10 | 11 | return keywords&.flat_map { |keyword| keyword[:keywords]&.map { |kw| kw[:keyword] } } || [] 12 | end 13 | 14 | end 15 | end 16 | end 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_landing_page.rb: -------------------------------------------------------------------------------- 1 | require 'jbuilder' 2 | 3 | module ADIWG 4 | module Mdtranslator 5 | module Writers 6 | module Dcat_us 7 | module LandingPage 8 | 9 | def self.build(intObj) 10 | onlineResources = intObj.dig(:metadata, :resourceInfo, :citation, :onlineResources) 11 | 12 | if onlineResources 13 | onlineResources.each do |resource| 14 | if resource.dig(:olResFunction) == 'landingPage' 15 | return resource.dig(:olResURI) 16 | end 17 | end 18 | end 19 | 20 | return nil 21 | end 22 | 23 | end 24 | end 25 | end 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_language.rb: -------------------------------------------------------------------------------- 1 | module ADIWG 2 | module Mdtranslator 3 | module Writers 4 | module Dcat_us 5 | module Language 6 | 7 | def self.build(intObj) 8 | metadataInfo = intObj.dig(:metadata, :metadataInfo) 9 | defaultLanguage = metadataInfo&.dig(:defaultMetadataLocale, :languageCode) 10 | additionalLanguage = metadataInfo&.dig(:otherMetadataLocales) 11 | languages = [] 12 | languages << defaultLanguage if defaultLanguage 13 | additionalLanguage.each { |lang| languages << lang[:languageCode] } if additionalLanguage 14 | 15 | return languages 16 | end 17 | 18 | end 19 | end 20 | end 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_license.rb: -------------------------------------------------------------------------------- 1 | module ADIWG 2 | module Mdtranslator 3 | module Writers 4 | module Dcat_us 5 | module License 6 | 7 | def self.build(intObj) 8 | resourceInfo = intObj.dig(:metadata, :resourceInfo) 9 | title = resourceInfo.dig(:constraints, 0, :reference, 0, :title) 10 | license = title || 'https://creativecommons.org/publicdomain/zero/1.0/' 11 | license 12 | end 13 | 14 | end 15 | end 16 | end 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_media_type.rb: -------------------------------------------------------------------------------- 1 | require 'jbuilder' 2 | 3 | module ADIWG 4 | module Mdtranslator 5 | module Writers 6 | module Dcat_us 7 | module MediaType 8 | 9 | def self.build(transfer) 10 | transfer.dig(:distributionFormats)&.find { |format| format.dig(:formatSpecification, :title) }&.dig(:formatSpecification, :title) || '' 11 | end 12 | 13 | end 14 | end 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_modified.rb: -------------------------------------------------------------------------------- 1 | module ADIWG 2 | module Mdtranslator 3 | module Writers 4 | module Dcat_us 5 | module Modified 6 | 7 | def self.build(intObj) 8 | resourceInfo = intObj[:metadata][:resourceInfo] 9 | citation = resourceInfo[:citation] 10 | dates = citation[:dates] 11 | 12 | mostRecentDate = nil 13 | 14 | dates.each do |date| 15 | if date[:dateType] == "lastUpdated" || date[:dateType] == "lastRevised" || date[:dateType] == "revision" 16 | if mostRecentDate.nil? || date[:date] > mostRecentDate 17 | mostRecentDate = date[:date] 18 | end 19 | end 20 | end 21 | 22 | return mostRecentDate 23 | end 24 | 25 | end 26 | end 27 | end 28 | end 29 | end 30 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_primaryITInvestmentUII.rb: -------------------------------------------------------------------------------- 1 | require 'jbuilder' 2 | 3 | module ADIWG 4 | module Mdtranslator 5 | module Writers 6 | module Dcat_us 7 | module PrimaryITInvestmentUII 8 | 9 | def self.build(intObj) 10 | primaryITInvestmentUII = intObj[:metadata][:metadataInfo][:metadataIdentifier][:identifier] 11 | 12 | primaryITInvestmentUII ? primaryITInvestmentUII : nil 13 | end 14 | 15 | end 16 | end 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_system_of_records.rb: -------------------------------------------------------------------------------- 1 | require 'jbuilder' 2 | 3 | module ADIWG 4 | module Mdtranslator 5 | module Writers 6 | module Dcat_us 7 | module SystemOfRecords 8 | 9 | def self.build(intObj) 10 | associatedResources = intObj.dig(:metadata, :associatedResources) 11 | 12 | return nil if associatedResources.nil? 13 | 14 | associatedResources.each do |resource| 15 | if resource[:initiativeType] == 'sorn' 16 | onlineResources = resource.dig(:resourceCitation, :onlineResources) 17 | return onlineResources.first[:olResURI] if onlineResources&.first&.has_key?(:olResURI) 18 | end 19 | end 20 | 21 | return nil 22 | end 23 | 24 | end 25 | end 26 | end 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_theme.rb: -------------------------------------------------------------------------------- 1 | require 'jbuilder' 2 | 3 | module ADIWG 4 | module Mdtranslator 5 | module Writers 6 | module Dcat_us 7 | module Theme 8 | 9 | def self.build(intObj) 10 | resourceInfo = intObj[:metadata][:resourceInfo] 11 | keywords_str = [] 12 | 13 | resourceInfo[:keywords].each do |keyword_group| 14 | if keyword_group[:thesaurus][:title] == "ISO Topic Categories" 15 | keyword_group[:keywords].each do |keyword_obj| 16 | keywords_str << keyword_obj[:keyword] 17 | end 18 | end 19 | end 20 | 21 | return keywords_str.join(" ") 22 | end 23 | 24 | end 25 | end 26 | end 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/dcat_us/version.rb: -------------------------------------------------------------------------------- 1 | # dcat_us version history 2 | # Johnathan Aspinwall 2023-06-22 created for mdJson/mdTranslator 2.0 3 | 4 | module ADIWG 5 | module Mdtranslator 6 | module Writers 7 | module Dcat_us 8 | 9 | VERSION = '1.0.0' 10 | 11 | end 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/fgdc/readme.md: -------------------------------------------------------------------------------- 1 | 2 | ## fgdc 3 | 4 | ### Supported versions 5 | 6 | > 1.x (FGDC-STD-001-1998) with Biological Data Profile 7 | 8 | ### Writer for Federal Geographic Data Committee's Content Standard for Digital Geospatial Metadata (fgdc) 9 | 10 | Content Standard for Digital Geospatial Metadata (CSDGM), Vers. 2 11 | (FGDC-STD-001-1998) is the current version of this FGDC authored and 12 | endorsed standard. Executive Order 12906, directed that Federal agencies 13 | document geospatial resources using this standard. Since the publication 14 | of EO 12906, the FGDC has endorsed several ISO Geospatial Metadata 15 | Standards that are now encouraged for use. 16 | 17 | The FGDC CSDGM format standard is fully documented on the 18 | [Content Standard for Digital Geospatial Metadata page](https://www.fgdc.gov/metadata/csdgm-standard). 19 | 20 | This FGDC writer extends the FGDC standard by added the Biological Data Profile 21 | FGDC-STD-001.1-1999 as defined by the U.S. Geological Survey National Biological 22 | Information Infrastructure (NBII). -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/fgdc/version.rb: -------------------------------------------------------------------------------- 1 | # fgdc version history 2 | # Stan Smith 1.1.0 2018-03-22 refactored message system and minor bug fixes 3 | # Stan Smith 1.0.0 2017-11-16 original script 4 | 5 | module ADIWG 6 | module Mdtranslator 7 | module Writers 8 | module Fgdc 9 | 10 | # current version of fgdc writer 11 | VERSION = '1.1.0' 12 | 13 | end 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/html/readme.md: -------------------------------------------------------------------------------- 1 | 2 | ## html 3 | 4 | ### Supported versions 5 | 6 | > Supports mdTranslator version 2.x 7 | 8 | ### Writer for HTML 'human-readable' output of metadata 9 | 10 | The HTML Metadata Record output from the mdTranslator is intended to 11 | be a human readable version of the metadata content read in by the 12 | translator. The HTML output does not attempt mimic any established 13 | metadata standard but remains agnostic in its presentation. 14 | The HTML metadata output will display the full content of the 15 | metadata record ingested by the mdTranslator while translation to 16 | established standards may not support all fields. 17 | 18 | The HTML output can be conveniently embedded in a users web page to 19 | present metadata content to visitors. 20 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/html/sections/html_date.rb: -------------------------------------------------------------------------------- 1 | # HTML writer 2 | # date 3 | 4 | # History: 5 | # Stan Smith 2015-03-23 original script 6 | 7 | module ADIWG 8 | module Mdtranslator 9 | module Writers 10 | module Html 11 | 12 | class Html_Date 13 | 14 | def initialize(html) 15 | @html = html 16 | end 17 | 18 | def writeHtml(hDate) 19 | 20 | date = hDate[:date] 21 | dateRes = hDate[:dateResolution] 22 | dateStr = '' 23 | 24 | unless date.nil? 25 | case dateRes 26 | when 'Y', 'YM', 'YMD' 27 | dateStr = AdiwgDateTimeFun.stringDateFromDateTime(date, dateRes) 28 | else 29 | dateStr = AdiwgDateTimeFun.stringDateTimeFromDateTime(date, dateRes) 30 | end 31 | end 32 | 33 | # datetime - required 34 | @html.text!(hDate[:dateType] + ': ' + dateStr) 35 | 36 | end # writeHtml 37 | end # Html_Date 38 | 39 | end 40 | end 41 | end 42 | end 43 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/html/sections/html_obliqueLinePoint.rb: -------------------------------------------------------------------------------- 1 | # HTML writer 2 | # spatial reference system oblique line point 3 | 4 | # History: 5 | # Stan Smith 2017-10-24 original script 6 | 7 | module ADIWG 8 | module Mdtranslator 9 | module Writers 10 | module Html 11 | 12 | class Html_ObliqueLinePoint 13 | 14 | def writeHtml(hLinePoint) 15 | 16 | long = 'missing' 17 | lat = 'missing' 18 | 19 | # oblique line point - point latitude 20 | unless hLinePoint[:obliqueLineLatitude].nil? 21 | long = hLinePoint[:obliqueLineLatitude].to_s 22 | end 23 | 24 | # oblique line point - point longitude 25 | unless hLinePoint[:obliqueLineLongitude].nil? 26 | lat = hLinePoint[:obliqueLineLongitude].to_s 27 | end 28 | 29 | return '( Longitude: ' + long + ', Latitude: ' + lat + ' )' 30 | 31 | end # writeHtml 32 | end # Html_ObliqueLinePoint 33 | 34 | end 35 | end 36 | end 37 | end 38 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/html/sections/html_rangeElementDescription.rb: -------------------------------------------------------------------------------- 1 | # HTML writer 2 | # range element description 3 | 4 | module ADIWG 5 | module Mdtranslator 6 | module Writers 7 | module Html 8 | 9 | class Html_RangeElementDescription 10 | 11 | def initialize(html) 12 | @html = html 13 | end 14 | 15 | def writeHtml(red) 16 | unless red[:name].nil? 17 | @html.em('Name:') 18 | @html.text!(red[:name]) 19 | @html.br 20 | end 21 | 22 | unless red[:definition].nil? 23 | @html.em('Definition:') 24 | @html.text!(red[:definition]) 25 | @html.br 26 | end 27 | 28 | red[:rangeElement].each do |hRangeElement| 29 | @html.em('Range Element:') 30 | @html.text!(hRangeElement) 31 | @html.br 32 | end 33 | 34 | end # writeHtml 35 | end # Html_RangeElementDescription 36 | 37 | end 38 | end 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/html/sections/html_resourceFormat.rb: -------------------------------------------------------------------------------- 1 | # HTML writer 2 | # resource format 3 | 4 | # History: 5 | # Stan Smith 2015-03-24 original script 6 | 7 | module ADIWG 8 | module Mdtranslator 9 | module Writers 10 | module Html 11 | 12 | class MdHtmlResourceFormat 13 | def initialize(html) 14 | @html = html 15 | end 16 | 17 | def writeHtml(hResFormat) 18 | 19 | # resource format - name - required 20 | unless hResFormat[:formatName].nil? 21 | @html.em('Resource Format: ') 22 | @html.text!(hResFormat[:formatName]) 23 | end 24 | 25 | # resource format - version 26 | unless !hResFormat[:formatVersion].nil? 27 | @html.em(' Version: ') 28 | @html.text!(hResFormat[:formatVersion]) 29 | end 30 | 31 | @html.br 32 | 33 | end # writeHtml 34 | 35 | end # class 36 | 37 | end 38 | end 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/html/sections/html_resourceType.rb: -------------------------------------------------------------------------------- 1 | # HTML writer 2 | # resource type 3 | 4 | # History: 5 | # Stan Smith 2017-05-24 Fixed problem with nil name 6 | # Stan Smith 2015-03-25 original script 7 | 8 | module ADIWG 9 | module Mdtranslator 10 | module Writers 11 | module Html 12 | 13 | class Html_ResourceType 14 | 15 | def initialize(html) 16 | @html = html 17 | end 18 | 19 | def writeHtml(hType) 20 | 21 | # resource type - (required) 22 | unless hType[:type].nil? 23 | @html.em('Resource Type: ') 24 | @html.text!(hType[:type]) 25 | unless hType[:name].nil? 26 | @html.em(' Name: ') 27 | @html.text!(hType[:name]) 28 | end 29 | @html.br 30 | end 31 | 32 | end # writeHtml 33 | end # Html_ResourceType 34 | 35 | end 36 | end 37 | end 38 | end 39 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/html/sections/html_timeInterval.rb: -------------------------------------------------------------------------------- 1 | # HTML writer 2 | # time interval 3 | 4 | # History: 5 | # Stan Smith 2017-03-27 original script 6 | 7 | module ADIWG 8 | module Mdtranslator 9 | module Writers 10 | module Html 11 | 12 | class Html_TimeInterval 13 | 14 | def initialize(html) 15 | @html = html 16 | end 17 | 18 | def writeHtml(hInterval) 19 | 20 | # time interval - interval 21 | unless hInterval[:interval].nil? 22 | @html.em('Interval: ') 23 | @html.text!(hInterval[:interval].to_s) 24 | @html.br 25 | end 26 | 27 | # time interval - units 28 | unless hInterval[:units].nil? 29 | @html.em('Units: ') 30 | @html.text!(hInterval[:units]) 31 | @html.br 32 | end 33 | 34 | end # writeHtml 35 | end # Html_TimeInterval 36 | 37 | end 38 | end 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/html/sections/html_vectorObject.rb: -------------------------------------------------------------------------------- 1 | # HTML writer 2 | # vector object 3 | 4 | # History: 5 | # Stan Smith 2017-03-28 original script 6 | 7 | module ADIWG 8 | module Mdtranslator 9 | module Writers 10 | module Html 11 | 12 | class Html_VectorObject 13 | 14 | def initialize(html) 15 | @html = html 16 | end 17 | 18 | def writeHtml(hObject) 19 | 20 | # vector object - type 21 | unless hObject[:objectType].nil? 22 | @html.em('Object Type: ') 23 | @html.text!(hObject[:objectType]) 24 | @html.br 25 | end 26 | 27 | # vector object - count 28 | unless hObject[:objectCount].nil? 29 | @html.em('Object Count: ') 30 | @html.text!(hObject[:objectCount].to_s) 31 | @html.br 32 | end 33 | 34 | end # writeHtml 35 | end # Html_VectorObject 36 | 37 | end 38 | end 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/html/version.rb: -------------------------------------------------------------------------------- 1 | # html version history 2 | # Stan Smith 2.1.0 2017-11-13 added support for spatial reference, geologic time, others 3 | # Stan Smith 2.0.0 2017-03-21 refactored for mdTranslator 2.0 4 | # Stan Smith 1.1.0 2015-08-28 added support for content coverage information 5 | # Stan Smith 1.1.0 2015-07-31 added support for grid information 6 | # Stan Smith 1.1.0 2015-07-30 added support for locale in metadata record information 7 | 8 | module ADIWG 9 | module Mdtranslator 10 | module Writers 11 | module Html 12 | 13 | # current version of html writer 14 | VERSION = '2.1.0' 15 | 16 | end 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/iso19110/readme.md: -------------------------------------------------------------------------------- 1 | 2 | ## iso19110 3 | 4 | ### Writer for ISO 19110 Feature Catalogue 5 | 6 | The mdTranslator 'iso19110' writer implements about 70% of the for 7 | ISO 19110 standard. Efforts were made to include all elements of the 8 | ISO standard that describe entity-attribute descriptions for tabular 9 | data, spreadsheets, and relational databases. 10 | 11 | The ISO 19110 record can be used to provide data dictionary 12 | information for ISO 19115-2 metadata (circa 2003) and is delivered 13 | as a separate file from the ISO 19115-2 resource metadata. This 14 | inconvenient implementation was improved in the 2014 revision I 15 | SO 19115-1 schema. mdTranslator will provide support for ISO 16 | 19115-1 sometime in 2017. 17 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/iso19110/version.rb: -------------------------------------------------------------------------------- 1 | # History 2 | # 1.2.0 Stan Smith 2018-04-05 refactored messaging system 3 | # 1.1.1 Stan Smith 2018-02-14 refactored cardinality 4 | # 1.1.0 Stan Smith 2018-02-14 refactored constraints 5 | # 1.0.0 Stan Smith 2017-03-10 refactored for mdJson/mdTranslator 2.0 6 | # 0.1.0 Josh Bradley 7 | 8 | module ADIWG 9 | module Mdtranslator 10 | module Writers 11 | module Iso19110 12 | 13 | VERSION = '1.2.0' 14 | 15 | end 16 | end 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_definitionUnit.rb: -------------------------------------------------------------------------------- 1 | # ISO <> UnitDefinition 2 | # 19115-2 writer output in XML 3 | 4 | # History: 5 | # Stan Smith 2015-08-27 copied from 19110 writer 6 | 7 | module ADIWG 8 | module Mdtranslator 9 | module Writers 10 | module Iso19115_2 11 | 12 | class UnitDefinition 13 | 14 | def initialize(xml, hResponseObj) 15 | @xml = xml 16 | @hResponseObj = hResponseObj 17 | end 18 | 19 | def writeXML(unit) 20 | 21 | # create an identity for the unit 22 | @hResponseObj[:writerMissingIdCount] = @hResponseObj[:writerMissingIdCount].succ 23 | unitID = 'unit' + @hResponseObj[:writerMissingIdCount] 24 | @xml.tag!('gml:UnitDefinition', {'gml:id' => unitID}) do 25 | @xml.tag!('gml:identifier', {'codeSpace' => ''}, unit) 26 | end 27 | 28 | end 29 | 30 | end 31 | 32 | end 33 | end 34 | end 35 | end 36 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_gmlIdentifier.rb: -------------------------------------------------------------------------------- 1 | # GML Identifier 2 | # 19115-2 writer output in XML 3 | 4 | # History: 5 | # Stan Smith 2016-12-01 original script. 6 | 7 | module ADIWG 8 | module Mdtranslator 9 | module Writers 10 | module Iso19115_2 11 | 12 | class GMLIdentifier 13 | 14 | def initialize(xml, hResponseObj) 15 | @xml = xml 16 | @hResponseObj = hResponseObj 17 | end 18 | 19 | def writeXML(hGMLid) 20 | 21 | namespace = hGMLid[:namespace] 22 | identifier = hGMLid[:identifier] 23 | 24 | @xml.tag!('gml:identifier', {'codeSpace' => namespace}, identifier) 25 | 26 | end # writeXML 27 | end # GMLIdentifier class 28 | 29 | end 30 | end 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_gridRepresentation.rb: -------------------------------------------------------------------------------- 1 | # ISO <> MD_GridSpatialRepresentation 2 | # writer output in XML 3 | 4 | # History: 5 | # Stan Smith 2015-07-30 original script. 6 | 7 | require_relative 'class_grid' 8 | 9 | module ADIWG 10 | module Mdtranslator 11 | module Writers 12 | module Iso19115_2 13 | 14 | class MD_GridSpatialRepresentation 15 | 16 | def initialize(xml, hResponseObj) 17 | @xml = xml 18 | @hResponseObj = hResponseObj 19 | end 20 | 21 | def writeXML(hGrid) 22 | 23 | # classes used 24 | gridClass = Grid.new(@xml, @hResponseObj) 25 | 26 | @xml.tag!('gmd:MD_GridSpatialRepresentation') do 27 | gridClass.writeXML(hGrid, 'grid representation') 28 | end 29 | 30 | end # writeXML 31 | end # MD_GridRepresentation class 32 | 33 | end 34 | end 35 | end 36 | end 37 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/iso19115_2/readme.md: -------------------------------------------------------------------------------- 1 | 2 | ## iso19115_2 3 | 4 | ### Writer for ISO 19115-2:2009 Geographic Metadata 5 | 6 | The mdTranslator iso19115_2 writer implements approximately 95% of 7 | the for ISO 19139:2007 and 19115-2:2009 standards. Efforts were made to include all 8 | elements of the ISO standard that support general data descriptions 9 | to ensure generation of health and robust project and data metadata 10 | records. The sections of 19115-2 not supported by the mdTranslator 11 | writer are the 'quantitative' section for data quality, portrayal 12 | catalog reference, acquisition, and application schema information. 13 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/iso19115_2/version.rb: -------------------------------------------------------------------------------- 1 | # iso19115-2 version history 2 | # 2.2.0 2018-04-09 add error and warning messaging 3 | # 2.1.0 2017-11-13 added support for spatial reference, geologic time, others 4 | 5 | module ADIWG 6 | module Mdtranslator 7 | module Writers 8 | module Iso19115_2 9 | 10 | # current version of ISO 19115-2 writer 11 | VERSION = '2.2.0' 12 | 13 | end 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_definitionUnit.rb: -------------------------------------------------------------------------------- 1 | # ISO <> UnitDefinition 2 | # 19115-3 writer output in XML 3 | 4 | # History: 5 | # Stan Smith 2019-04-08 copied from 19115_2 writer 6 | 7 | module ADIWG 8 | module Mdtranslator 9 | module Writers 10 | module Iso19115_3 11 | 12 | class UnitDefinition 13 | 14 | def initialize(xml, hResponseObj) 15 | @xml = xml 16 | @hResponseObj = hResponseObj 17 | end 18 | 19 | def writeXML(unit) 20 | 21 | # create an identity for the unit 22 | @hResponseObj[:writerMissingIdCount] = @hResponseObj[:writerMissingIdCount].succ 23 | unitID = 'unit' + @hResponseObj[:writerMissingIdCount] 24 | @xml.tag!('gml:UnitDefinition', {'gml:id' => unitID}) do 25 | @xml.tag!('gml:identifier', {'codeSpace' => ''}, unit) 26 | end 27 | 28 | end 29 | 30 | end 31 | 32 | end 33 | end 34 | end 35 | end 36 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_gmlIdentifier.rb: -------------------------------------------------------------------------------- 1 | # GML Identifier 2 | # 19115-3 writer output in XML 3 | 4 | # History: 5 | # Stan Smith 2019-03-19 original script. 6 | 7 | module ADIWG 8 | module Mdtranslator 9 | module Writers 10 | module Iso19115_3 11 | 12 | class GMLIdentifier 13 | 14 | def initialize(xml, hResponseObj) 15 | @xml = xml 16 | @hResponseObj = hResponseObj 17 | end 18 | 19 | def writeXML(hGMLid) 20 | 21 | namespace = hGMLid[:namespace] 22 | identifier = hGMLid[:identifier] 23 | 24 | @xml.tag!('gml:identifier', {'codeSpace' => namespace}, identifier) 25 | 26 | end # writeXML 27 | end # GMLIdentifier class 28 | 29 | end 30 | end 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_gridRepresentation.rb: -------------------------------------------------------------------------------- 1 | # ISO <> MD_GridSpatialRepresentation 2 | # writer output in XML 3 | 4 | # History: 5 | # Stan Smith 2019-04-16 original script. 6 | 7 | require_relative 'class_grid' 8 | 9 | module ADIWG 10 | module Mdtranslator 11 | module Writers 12 | module Iso19115_3 13 | 14 | class MD_GridSpatialRepresentation 15 | 16 | def initialize(xml, hResponseObj) 17 | @xml = xml 18 | @hResponseObj = hResponseObj 19 | end 20 | 21 | def writeXML(hGrid, inContext = nil) 22 | 23 | # classes used 24 | gridClass = Grid.new(@xml, @hResponseObj) 25 | 26 | @xml.tag!('msr:MD_GridSpatialRepresentation') do 27 | gridClass.writeXML(hGrid, 'grid representation') 28 | end 29 | 30 | end # writeXML 31 | end # MD_GridRepresentation class 32 | 33 | end 34 | end 35 | end 36 | end 37 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/iso19115_3/readme.md: -------------------------------------------------------------------------------- 1 | 2 | ## iso19115_3 3 | 4 | ### Writer for ISO 19115-3:2014 Geographic Metadata 5 | 6 | The mdTranslator iso19115_3 writer implements approximately 95% of 7 | the for ISO 19115-3:2014 standard. Efforts were made to include all 8 | elements of the ISO standard that support general data descriptions 9 | to ensure generation of health and robust project and data metadata 10 | records. The sections of 19115-3 not supported by the mdTranslator 11 | writer are the 'quantitative' section for data quality, portrayal 12 | catalog reference, acquisition, and application schema information. 13 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/iso19115_3/version.rb: -------------------------------------------------------------------------------- 1 | module ADIWG 2 | module Mdtranslator 3 | module Writers 4 | module Iso19115_3 5 | 6 | # current version of ISO 19115-3 writer 7 | VERSION = '3.0.0' 8 | 9 | end 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/readme.md: -------------------------------------------------------------------------------- 1 | 2 | ## mdJson 3 | 4 | ### Supported versions 5 | 6 | > 2.0.x 7 | 8 | ### Writer for ADIwg JSON metadata format (mdJson) 9 | 10 | The mdJson format is a simple JSON format for documenting and 11 | exchanging information about scientific projects and data. 12 | The Alaska Data Integration working group (ADIwg) wrote the 13 | standard to support translation to complex standards such as 14 | the ISO 19115-2 Geographic Metadata standard and FGDC's Content 15 | Standard for Digital Geospatial Metadata. The mdJson standard 16 | remains independent of any published standards while comprehensive 17 | enough to support translation to many established standards. 18 | The mdJson record is also a convenient format to exchange directly 19 | with other organizations as the JSON structure is easily created 20 | and ingest by modern programming languages. 21 | 22 | The mdJson format is fully documented on the interactive 23 | [mdTools](http://mdTools.adiwg.org) website. 24 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_additionalDocumentation.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer - additional documentation 2 | 3 | # History: 4 | # Stan Smith 2017-03-11 refactored for mdJson/mdTranslator 2.0 5 | # Josh Bradley original script 6 | 7 | require 'jbuilder' 8 | require_relative 'mdJson_resourceType' 9 | require_relative 'mdJson_citation' 10 | 11 | module ADIWG 12 | module Mdtranslator 13 | module Writers 14 | module MdJson 15 | 16 | module AdditionalDocument 17 | 18 | @Namespace = ADIWG::Mdtranslator::Writers::MdJson 19 | 20 | def self.build(hDocument) 21 | 22 | Jbuilder.new do |json| 23 | json.resourceType @Namespace.json_map(hDocument[:resourceTypes], ResourceType) 24 | json.citation @Namespace.json_map(hDocument[:citation], Citation) 25 | end 26 | 27 | end # build 28 | end # AdditionalDocument 29 | 30 | end 31 | end 32 | end 33 | end 34 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_address.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer - address 2 | 3 | # History: 4 | # Stan Smith 2017-03-12 refactored for mdJson/mdTranslator 2.0 5 | # Josh Bradley original script 6 | 7 | require 'jbuilder' 8 | 9 | module ADIWG 10 | module Mdtranslator 11 | module Writers 12 | module MdJson 13 | 14 | module Address 15 | 16 | def self.build(hAddress) 17 | 18 | Jbuilder.new do |json| 19 | json.addressType hAddress[:addressTypes] 20 | json.description hAddress[:description] 21 | json.deliveryPoint hAddress[:deliveryPoints] unless hAddress[:deliveryPoints].empty? 22 | json.city hAddress[:city] 23 | json.administrativeArea hAddress[:adminArea] 24 | json.postalCode hAddress[:postalCode] 25 | json.country hAddress[:country] 26 | end 27 | 28 | end # build 29 | end # Address 30 | 31 | end 32 | end 33 | end 34 | end 35 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_algorithm.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer - algorithm 2 | 3 | # History: 4 | # Stan Smith 2019-09-24 original script 5 | 6 | require 'jbuilder' 7 | require_relative 'mdJson_citation' 8 | 9 | module ADIWG 10 | module Mdtranslator 11 | module Writers 12 | module MdJson 13 | 14 | module Algorithm 15 | 16 | @Namespace = ADIWG::Mdtranslator::Writers::MdJson 17 | 18 | def self.build(hAlgorithm) 19 | 20 | Jbuilder.new do |json| 21 | json.citation Citation.build(hAlgorithm[:citation]) unless hAlgorithm[:citation].empty? 22 | json.description hAlgorithm[:description] 23 | end 24 | 25 | end # build 26 | end # Algorithm 27 | 28 | end 29 | end 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_attributeGroup.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer - attribute group 2 | 3 | # History: 4 | # Stan Smith 2017-03-16 refactored for mdJson/mdTranslator 2.0 5 | # Josh Bradley original script 6 | 7 | require 'jbuilder' 8 | require_relative 'mdJson_attribute' 9 | 10 | module ADIWG 11 | module Mdtranslator 12 | module Writers 13 | module MdJson 14 | 15 | module AttributeGroup 16 | 17 | def self.build(hGroup) 18 | 19 | @Namespace = ADIWG::Mdtranslator::Writers::MdJson 20 | 21 | Jbuilder.new do |json| 22 | json.attributeContentType hGroup[:attributeContentTypes] unless hGroup[:attributeContentTypes].empty? 23 | json.attribute @Namespace.json_map(hGroup[:attributes], Attribute) 24 | end 25 | 26 | end # build 27 | end # AttributeGroup 28 | 29 | end 30 | end 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_bearingDistanceResolution.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer - bearing distance resolution 2 | 3 | # History: 4 | # Stan Smith 2017-10-20 original script 5 | 6 | require 'jbuilder' 7 | 8 | module ADIWG 9 | module Mdtranslator 10 | module Writers 11 | module MdJson 12 | 13 | module BearingDistanceResolution 14 | 15 | def self.build(hBearRes) 16 | 17 | Jbuilder.new do |json| 18 | json.distanceResolution hBearRes[:distanceResolution] 19 | json.distanceUnitOfMeasure hBearRes[:distanceUnitOfMeasure] 20 | json.bearingResolution hBearRes[:bearingResolution] 21 | json.bearingUnitOfMeasure hBearRes[:bearingUnitOfMeasure] 22 | json.bearingReferenceDirection hBearRes[:bearingReferenceDirection] 23 | json.bearingReferenceMeridian hBearRes[:bearingReferenceMeridian] 24 | end 25 | 26 | end # build 27 | end # BearingDistanceResolution 28 | 29 | end 30 | end 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_boundingBox.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer - bounding box 2 | 3 | # History: 4 | # Stan Smith 2017-09-08 add altitude to support fgdc 5 | # Stan Smith 2017-03-15 original script 6 | 7 | require 'jbuilder' 8 | 9 | module ADIWG 10 | module Mdtranslator 11 | module Writers 12 | module MdJson 13 | 14 | module BoundingBox 15 | 16 | def self.build(hBbox) 17 | 18 | Jbuilder.new do |json| 19 | json.westLongitude hBbox[:westLongitude] 20 | json.eastLongitude hBbox[:eastLongitude] 21 | json.southLatitude hBbox[:southLatitude] 22 | json.northLatitude hBbox[:northLatitude] 23 | json.minimumAltitude hBbox[:minimumAltitude] 24 | json.maximumAltitude hBbox[:maximumAltitude] 25 | json.unitsOfAltitude hBbox[:unitsOfAltitude] 26 | end 27 | 28 | end # build 29 | end # BoundingBox 30 | 31 | end 32 | end 33 | end 34 | end 35 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_conformanceResult.rb: -------------------------------------------------------------------------------- 1 | require 'jbuilder' 2 | require_relative 'mdJson_scope' 3 | require_relative 'mdJson_citation' 4 | 5 | module ADIWG 6 | module Mdtranslator 7 | module Writers 8 | module MdJson 9 | 10 | module ConformanceResult 11 | def self.build(hConformanceResult) 12 | Jbuilder.new do |json| 13 | json.dateTime hConformanceResult[:dateTime] unless hConformanceResult[:dateTime].nil? 14 | json.scope Scope.build(hConformanceResult[:scope]) unless hConformanceResult[:scope].empty? 15 | json.name hConformanceResult[:name] unless hConformanceResult[:name].nil? 16 | json.specification Citation.build(hConformanceResult[:specification]) unless hConformanceResult[:specification].empty? 17 | json.explanation hConformanceResult[:explanation] unless hConformanceResult[:explanation].nil? 18 | json.pass hConformanceResult[:pass] unless hConformanceResult[:pass].nil? 19 | end 20 | end 21 | end 22 | 23 | end 24 | end 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_coordinateResolution.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer - coordinate resolution 2 | 3 | # History: 4 | # Stan Smith 2017-10-20 original script 5 | 6 | require 'jbuilder' 7 | 8 | module ADIWG 9 | module Mdtranslator 10 | module Writers 11 | module MdJson 12 | 13 | module CoordinateResolution 14 | 15 | def self.build(hCoordRes) 16 | 17 | Jbuilder.new do |json| 18 | json.abscissaResolutionX hCoordRes[:abscissaResolutionX] 19 | json.ordinateResolutionY hCoordRes[:ordinateResolutionY] 20 | json.unitOfMeasure hCoordRes[:unitOfMeasure] 21 | end 22 | 23 | end # build 24 | end # CoordinateResolution 25 | 26 | end 27 | end 28 | end 29 | end 30 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_coverageInfo.rb: -------------------------------------------------------------------------------- 1 | require 'jbuilder' 2 | require_relative 'mdJson_base' 3 | require_relative 'mdJson_resourceIdentifier' 4 | require_relative 'mdJson_coverageItem' 5 | require_relative 'mdJson_imageInfo' 6 | 7 | module ADIWG 8 | module Mdtranslator 9 | module Writers 10 | module MdJson 11 | module CoverageInfo 12 | extend MdJson::Base 13 | 14 | def self.build(intObj) 15 | unless intObj.empty? 16 | Jbuilder.new do |json| 17 | json.coverageType intObj[:coverageType] 18 | json.coverageName intObj[:coverageName] 19 | json.coverageDescription intObj[:coverageDescription] 20 | json.processingLevel ResourceIdentifier.build(intObj[:processingLevel]) unless intObj[:processingLevel].empty? 21 | json.coverageItem json_map(intObj[:coverageItems], CoverageItem) 22 | json.imageInfo ImageInfo.build(intObj[:imageInfo]) unless intObj[:imageInfo].empty? 23 | end 24 | end 25 | end 26 | end 27 | end 28 | end 29 | end 30 | end 31 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dataQuality.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer - dataQuality 2 | 3 | require 'jbuilder' 4 | require_relative 'mdJson_scope' 5 | require_relative 'mdJson_dataQualityReport' 6 | require_relative 'mdJson_citation' 7 | require_relative 'mdJson_standaloneQualityReport' 8 | 9 | module ADIWG 10 | module Mdtranslator 11 | module Writers 12 | module MdJson 13 | 14 | module DataQuality 15 | 16 | @Namespace = ADIWG::Mdtranslator::Writers::MdJson 17 | 18 | def self.build(hDataQuality) 19 | Jbuilder.new do |json| 20 | json.scope Scope.build(hDataQuality[:scope]) 21 | json.systemIdentifier hDataQuality[:systemIdentifier] 22 | json.standaloneQualityReport StandaloneQualityReport.build(hDataQuality[:standaloneReport]) unless hDataQuality[:standaloneReport].nil? 23 | json.report @Namespace.json_map(hDataQuality[:report], DataQualityReport) 24 | end 25 | 26 | end 27 | 28 | end 29 | 30 | end 31 | end 32 | end 33 | end 34 | 35 | 36 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_date.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer - citation 2 | 3 | # History: 4 | # Stan Smith 2017-03-11 refactored for mdJson/mdTranslator 2.0 5 | # Josh Bradley original script 6 | 7 | require 'jbuilder' 8 | 9 | module ADIWG 10 | module Mdtranslator 11 | module Writers 12 | module MdJson 13 | 14 | module Date 15 | 16 | def self.build(hDate) 17 | 18 | Jbuilder.new do |json| 19 | json.date(AdiwgDateTimeFun.stringDateTimeFromDateObject(hDate)) 20 | json.dateType hDate[:dateType] 21 | json.description hDate[:description] 22 | end 23 | 24 | end # build 25 | end # Date 26 | 27 | end 28 | end 29 | end 30 | end 31 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dateTime.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer - citation 2 | 3 | # History: 4 | # Stan Smith 2017-03-20 original script 5 | 6 | require 'jbuilder' 7 | 8 | module ADIWG 9 | module Mdtranslator 10 | module Writers 11 | module MdJson 12 | 13 | module DateTime 14 | 15 | def self.build(hDateTime) 16 | 17 | return AdiwgDateTimeFun.stringDateTimeFromDateObject(hDateTime) 18 | 19 | end # build 20 | end # DateTime 21 | 22 | end 23 | end 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_descriptiveResult.rb: -------------------------------------------------------------------------------- 1 | require 'jbuilder' 2 | require_relative 'mdJson_scope' 3 | 4 | module ADIWG 5 | module Mdtranslator 6 | module Writers 7 | module MdJson 8 | 9 | module DescriptiveResult 10 | def self.build(hResult) 11 | Jbuilder.new do |json| 12 | json.dateTime hResult[:dateTime] unless hResult[:dateTime].nil? 13 | json.scope Scope.build(hResult[:scope]) unless hResult[:scope].empty? 14 | json.name hResult[:name] unless hResult[:name].nil? 15 | json.statement hResult[:statement] unless hResult[:statement].nil? 16 | end 17 | end 18 | 19 | end 20 | 21 | end 22 | end 23 | end 24 | end 25 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dimension.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer - dimension 2 | 3 | # History: 4 | # Stan Smith 2017-03-14 original script 5 | 6 | require 'jbuilder' 7 | require_relative 'mdJson_measure' 8 | 9 | module ADIWG 10 | module Mdtranslator 11 | module Writers 12 | module MdJson 13 | 14 | module Dimension 15 | 16 | def self.build(hDimension) 17 | 18 | Jbuilder.new do |json| 19 | json.dimensionType hDimension[:dimensionType] 20 | json.dimensionSize hDimension[:dimensionSize] 21 | json.resolution Measure.build(hDimension[:resolution]) unless hDimension[:resolution].empty? 22 | json.dimensionTitle hDimension[:dimensionTitle] 23 | json.dimensionDescription hDimension[:dimensionDescription] 24 | end 25 | 26 | end # build 27 | end # Dimension 28 | 29 | end 30 | end 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_distribution.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer - distribution 2 | 3 | # History: 4 | # Stan Smith 2017-03-20 refactored for mdJson/mdTranslator 2.0 5 | # Josh Bradley original script 6 | 7 | require 'jbuilder' 8 | require_relative 'mdJson_distributor' 9 | 10 | module ADIWG 11 | module Mdtranslator 12 | module Writers 13 | module MdJson 14 | 15 | module Distribution 16 | 17 | @Namespace = ADIWG::Mdtranslator::Writers::MdJson 18 | 19 | def self.build(hDistribution) 20 | 21 | Jbuilder.new do |json| 22 | json.description hDistribution[:description] 23 | json.liabilityStatement hDistribution[:liabilityStatement] 24 | json.distributor @Namespace.json_map(hDistribution[:distributor], Distributor) 25 | end 26 | 27 | end # build 28 | end # Distribution 29 | 30 | end 31 | end 32 | end 33 | end 34 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_distributor.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer - distributor 2 | 3 | # History: 4 | # Stan Smith 2017-03-20 original script 5 | 6 | require 'jbuilder' 7 | require_relative 'mdJson_responsibleParty' 8 | require_relative 'mdJson_orderProcess' 9 | require_relative 'mdJson_transferOption' 10 | 11 | module ADIWG 12 | module Mdtranslator 13 | module Writers 14 | module MdJson 15 | 16 | module Distributor 17 | 18 | @Namespace = ADIWG::Mdtranslator::Writers::MdJson 19 | 20 | def self.build(hDistributor) 21 | 22 | Jbuilder.new do |json| 23 | json.contact ResponsibleParty.build(hDistributor[:contact]) unless hDistributor[:contact].empty? 24 | json.orderProcess @Namespace.json_map(hDistributor[:orderProcess], OrderProcess) 25 | json.transferOption @Namespace.json_map(hDistributor[:transferOptions], TransferOption) 26 | end 27 | 28 | end # build 29 | end # Distributor 30 | 31 | end 32 | end 33 | end 34 | end 35 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_domainItem.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer - domain item 2 | 3 | # History: 4 | # Stan Smith 2017-03-19 original script 5 | 6 | require 'jbuilder' 7 | require_relative 'mdJson_citation' 8 | 9 | module ADIWG 10 | module Mdtranslator 11 | module Writers 12 | module MdJson 13 | 14 | module DomainItem 15 | 16 | def self.build(hItem) 17 | 18 | Jbuilder.new do |json| 19 | json.name hItem[:itemName] 20 | json.value hItem[:itemValue] 21 | json.definition hItem[:itemDefinition] 22 | unless hItem[:itemReference].empty? 23 | json.reference Citation.build(hItem[:itemReference]) 24 | end 25 | end 26 | 27 | end # build 28 | end # DomainItem 29 | 30 | end 31 | end 32 | end 33 | end 34 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_duration.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer - duration 2 | 3 | # History: 4 | # Stan Smith 2017-03-14 refactored for mdJson/mdTranslator 2.0 5 | # Josh Bradley original script 6 | 7 | require 'jbuilder' 8 | 9 | module ADIWG 10 | module Mdtranslator 11 | module Writers 12 | module MdJson 13 | 14 | module Duration 15 | 16 | def self.build(hDuration) 17 | 18 | Jbuilder.new do |json| 19 | json.years hDuration[:years] unless hDuration[:years] == 0 20 | json.months hDuration[:months] unless hDuration[:months] == 0 21 | json.days hDuration[:days] unless hDuration[:days] == 0 22 | json.hours hDuration[:hours] unless hDuration[:hours] == 0 23 | json.minutes hDuration[:minutes] unless hDuration[:minutes] == 0 24 | json.seconds hDuration[:seconds] unless hDuration[:seconds] == 0 25 | end 26 | 27 | end # build 28 | end # TimePeriod 29 | 30 | end 31 | end 32 | end 33 | end 34 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_entityForeignKey.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer - entity foreign key 2 | 3 | # History: 4 | # Stan Smith 2017-03-19 original script 5 | 6 | require 'jbuilder' 7 | 8 | module ADIWG 9 | module Mdtranslator 10 | module Writers 11 | module MdJson 12 | 13 | module EntityForeignKey 14 | 15 | def self.build(hKey) 16 | 17 | Jbuilder.new do |json| 18 | json.localAttributeCodeName hKey[:fkLocalAttributes] unless hKey[:fkLocalAttributes].empty? 19 | json.referencedEntityCodeName hKey[:fkReferencedEntity] 20 | json.referencedAttributeCodeName hKey[:fkReferencedAttributes] unless hKey[:fkReferencedAttributes].empty? 21 | end 22 | 23 | end # build 24 | end # EntityForeignKey 25 | 26 | end 27 | end 28 | end 29 | end 30 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_entityIndex.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer - entity index 2 | 3 | # History: 4 | # Stan Smith 2017-03-19 original script 5 | 6 | require 'jbuilder' 7 | 8 | module ADIWG 9 | module Mdtranslator 10 | module Writers 11 | module MdJson 12 | 13 | module EntityIndex 14 | 15 | def self.build(hIndex) 16 | 17 | Jbuilder.new do |json| 18 | json.codeName hIndex[:indexCode] 19 | json.allowDuplicates hIndex[:duplicate] 20 | json.attributeCodeName hIndex[:attributeNames] unless hIndex[:attributeNames].empty? 21 | end 22 | 23 | end # build 24 | end # EntityIndex 25 | 26 | end 27 | end 28 | end 29 | end 30 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_evaluationMethod.rb: -------------------------------------------------------------------------------- 1 | require 'jbuilder' 2 | require_relative 'mdJson_citation' 3 | 4 | module ADIWG 5 | module Mdtranslator 6 | module Writers 7 | module MdJson 8 | 9 | module EvaluationMethod 10 | 11 | @Namespace = ADIWG::Mdtranslator::Writers::MdJson 12 | 13 | def self.build(hMethod) 14 | Jbuilder.new do |json| 15 | json.type hMethod[:type] 16 | json.dateTime hMethod[:dateTime] 17 | json.methodDescription hMethod[:methodDescription] 18 | json.evaluationProcedure Citation.build(hMethod[:evaluationProcedure]) 19 | json.referenceDocument @Namespace.json_map(hMethod[:referenceDocument], Citation) 20 | json.evaluationMethodType hMethod[:evaluationMethodType] 21 | json.deductiveSource hMethod[:deductiveSource] 22 | json.samplingScheme hMethod[:samplingScheme] 23 | json.lotDescription hMethod[:lotDescription] 24 | json.samplingRatio hMethod[:samplingRatio] 25 | end 26 | end 27 | end 28 | 29 | end 30 | 31 | end 32 | end 33 | end 34 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_extent.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer - extent 2 | 3 | # History: 4 | # Stan Smith 2017-03-13 refactored for mdJson/mdTranslator 2.0 5 | # Josh Bradley original script 6 | 7 | require 'jbuilder' 8 | require_relative 'mdJson_geographicExtent' 9 | require_relative 'mdJson_temporalExtent' 10 | require_relative 'mdJson_verticalExtent' 11 | 12 | module ADIWG 13 | module Mdtranslator 14 | module Writers 15 | module MdJson 16 | 17 | module Extent 18 | 19 | def self.build(hExtent) 20 | 21 | @Namespace = ADIWG::Mdtranslator::Writers::MdJson 22 | 23 | Jbuilder.new do |json| 24 | json.description hExtent[:description] 25 | json.geographicExtent @Namespace.json_map(hExtent[:geographicExtents], GeographicExtent) 26 | json.temporalExtent @Namespace.json_map(hExtent[:temporalExtents], TemporalExtent) 27 | json.verticalExtent @Namespace.json_map(hExtent[:verticalExtents], VerticalExtent) 28 | end 29 | 30 | end # build 31 | end # Extent 32 | 33 | end 34 | end 35 | end 36 | end 37 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_format.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer - format 2 | 3 | # History: 4 | # Stan Smith 2017-03-18 refactored for mdJson/mdTranslator 2.0 5 | # Josh Bradley original script 6 | 7 | require 'jbuilder' 8 | require_relative 'mdJson_citation' 9 | 10 | module ADIWG 11 | module Mdtranslator 12 | module Writers 13 | module MdJson 14 | 15 | module Format 16 | 17 | def self.build(hFormat) 18 | 19 | Jbuilder.new do |json| 20 | json.formatSpecification Citation.build(hFormat[:formatSpecification]) unless hFormat[:formatSpecification].empty? 21 | json.amendmentNumber hFormat[:amendmentNumber] 22 | json.compressionMethod hFormat[:compressionMethod] 23 | json.technicalPrerequisite hFormat[:technicalPrerequisite] 24 | end 25 | 26 | end # build 27 | end # Format 28 | 29 | end 30 | end 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_funding.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer - funding 2 | 3 | # History: 4 | # Stan Smith 2017-08-31 refactored for mdJson schema 2.3 5 | # Stan Smith 2017-03-20 original script 6 | 7 | require 'jbuilder' 8 | require_relative 'mdJson_allocation' 9 | require_relative 'mdJson_timePeriod' 10 | 11 | module ADIWG 12 | module Mdtranslator 13 | module Writers 14 | module MdJson 15 | 16 | module Funding 17 | 18 | @Namespace = ADIWG::Mdtranslator::Writers::MdJson 19 | 20 | def self.build(hFunding) 21 | 22 | Jbuilder.new do |json| 23 | json.allocation @Namespace.json_map(hFunding[:allocations], Allocation) 24 | json.timePeriod TimePeriod.build(hFunding[:timePeriod]) unless hFunding[:timePeriod].empty? 25 | json.description hFunding[:description] 26 | end 27 | 28 | end # build 29 | end # Funding 30 | 31 | end 32 | end 33 | end 34 | end 35 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_geographicResolution.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer - geographic resolution 2 | 3 | # History: 4 | # Stan Smith 2017-10-20 original script 5 | 6 | require 'jbuilder' 7 | 8 | module ADIWG 9 | module Mdtranslator 10 | module Writers 11 | module MdJson 12 | 13 | module GeographicResolution 14 | 15 | def self.build(hGeoRes) 16 | 17 | Jbuilder.new do |json| 18 | json.latitudeResolution hGeoRes[:latitudeResolution] 19 | json.longitudeResolution hGeoRes[:longitudeResolution] 20 | json.unitOfMeasure hGeoRes[:unitOfMeasure] 21 | end 22 | 23 | end # build 24 | end # GeographicResolution 25 | 26 | end 27 | end 28 | end 29 | end 30 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_geologicAge.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer - geologic age 2 | 3 | # History: 4 | # Stan Smith 2017-11-08 original script 5 | 6 | require 'jbuilder' 7 | require_relative 'mdJson_citation' 8 | 9 | module ADIWG 10 | module Mdtranslator 11 | module Writers 12 | module MdJson 13 | 14 | module GeologicAge 15 | 16 | def self.build(hGeoAge) 17 | 18 | @Namespace = ADIWG::Mdtranslator::Writers::MdJson 19 | 20 | Jbuilder.new do |json| 21 | json.ageTimeScale hGeoAge[:ageTimeScale] 22 | json.ageEstimate hGeoAge[:ageEstimate] 23 | json.ageUncertainty hGeoAge[:ageUncertainty] 24 | json.ageExplanation hGeoAge[:ageExplanation] 25 | json.ageReference @Namespace.json_map(hGeoAge[:ageReferences], Citation) 26 | end 27 | 28 | end # build 29 | end # GeologicAge 30 | 31 | end 32 | end 33 | end 34 | end 35 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_graphicOverview.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer - graphic overview 2 | 3 | # History: 4 | # Stan Smith 2017-03-12 refactored for mdJson/mdTranslator 2.0 5 | # Josh Bradley original script 6 | 7 | require 'jbuilder' 8 | require_relative 'mdJson_constraint' 9 | require_relative 'mdJson_onlineResource' 10 | 11 | module ADIWG 12 | module Mdtranslator 13 | module Writers 14 | module MdJson 15 | 16 | module GraphicOverview 17 | 18 | @Namespace = ADIWG::Mdtranslator::Writers::MdJson 19 | 20 | def self.build(hGraphic) 21 | 22 | Jbuilder.new do |json| 23 | json.fileName hGraphic[:graphicName] 24 | json.fileDescription hGraphic[:graphicDescription] 25 | json.fileType hGraphic[:graphicType] 26 | json.fileConstraint @Namespace.json_map(hGraphic[:graphicConstraints], Constraint) 27 | json.fileUri @Namespace.json_map(hGraphic[:graphicURI], OnlineResource) 28 | end 29 | 30 | end # build 31 | end # GraphicOverview 32 | 33 | end 34 | end 35 | end 36 | end 37 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_gridRepresentation.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer - grid representation 2 | 3 | # History: 4 | # Stan Smith 2017-03-14 refactored for mdJson/mdTranslator 2.0 5 | # Josh Bradley original script 6 | 7 | require 'jbuilder' 8 | require_relative 'mdJson_dimension' 9 | 10 | module ADIWG 11 | module Mdtranslator 12 | module Writers 13 | module MdJson 14 | 15 | module Grid 16 | 17 | def self.build(hGrid) 18 | 19 | @Namespace = ADIWG::Mdtranslator::Writers::MdJson 20 | 21 | Jbuilder.new do |json| 22 | json.scope hGrid[:scope] 23 | json.numberOfDimensions hGrid[:numberOfDimensions] 24 | json.dimension @Namespace.json_map(hGrid[:dimension], Dimension) 25 | json.cellGeometry hGrid[:cellGeometry] 26 | json.transformationParameterAvailable hGrid[:transformationParameterAvailable] 27 | end 28 | 29 | end # build 30 | end # Grid 31 | 32 | end 33 | end 34 | end 35 | end 36 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_identifier.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer tests - identifier 2 | 3 | # History: 4 | # Stan Smith 2018-10-18 added 'name' for projectionIdentifier & gridIdentifier 5 | # Stan Smith 2017-03-13 refactored for mdJson/mdTranslator 2.0 6 | # Josh Bradley original script 7 | 8 | require 'jbuilder' 9 | require_relative 'mdJson_citation' 10 | 11 | module ADIWG 12 | module Mdtranslator 13 | module Writers 14 | module MdJson 15 | 16 | module Identifier 17 | 18 | def self.build(hIdentifier) 19 | 20 | Jbuilder.new do |json| 21 | json.identifier hIdentifier[:identifier] 22 | json.namespace hIdentifier[:namespace] 23 | json.version hIdentifier[:version] 24 | json.name hIdentifier[:name] 25 | json.description hIdentifier[:description] 26 | json.authority Citation.build(hIdentifier[:citation]) unless hIdentifier[:citation].empty? 27 | end 28 | 29 | end# build 30 | end # Identifier 31 | 32 | end 33 | end 34 | end 35 | end 36 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_keyword.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer - keyword 2 | 3 | # History: 4 | # Stan Smith 2017-03-18 refactored for mdJson/mdTranslator 2.0 5 | # Josh Bradley original script 6 | 7 | require 'jbuilder' 8 | require_relative 'mdJson_keywordObject' 9 | require_relative 'mdJson_citation' 10 | 11 | module ADIWG 12 | module Mdtranslator 13 | module Writers 14 | module MdJson 15 | 16 | module Keyword 17 | 18 | def self.build(hKeyword) 19 | 20 | @Namespace = ADIWG::Mdtranslator::Writers::MdJson 21 | 22 | Jbuilder.new do |json| 23 | json.keyword @Namespace.json_map(hKeyword[:keywords], KeywordObject) 24 | json.keywordType hKeyword[:keywordType] 25 | json.thesaurus Citation.build(hKeyword[:thesaurus]) unless hKeyword[:thesaurus].empty? 26 | end 27 | 28 | end # build 29 | end # Keyword 30 | 31 | end 32 | end 33 | end 34 | end 35 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_keywordObject.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer - keyword object 2 | 3 | # History: 4 | # Stan Smith 2017-03-18 refactored for mdJson/mdTranslator 2.0 5 | # Josh Bradley original script 6 | 7 | require 'jbuilder' 8 | 9 | module ADIWG 10 | module Mdtranslator 11 | module Writers 12 | module MdJson 13 | 14 | module KeywordObject 15 | 16 | def self.build(hKeyword) 17 | 18 | Jbuilder.new do |json| 19 | json.keyword hKeyword[:keyword] 20 | json.keywordId hKeyword[:keywordId] 21 | end 22 | 23 | end # build 24 | end # KeywordObject 25 | 26 | end 27 | end 28 | end 29 | end 30 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_legalConstraint.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer - legal constraint 2 | 3 | # History: 4 | # Stan Smith 2017-03-17 original script 5 | 6 | require 'jbuilder' 7 | 8 | module ADIWG 9 | module Mdtranslator 10 | module Writers 11 | module MdJson 12 | 13 | module LegalConstraint 14 | 15 | def self.build(hLegal) 16 | 17 | Jbuilder.new do |json| 18 | json.accessConstraint hLegal[:accessCodes] unless hLegal[:accessCodes].empty? 19 | json.useConstraint hLegal[:useCodes] unless hLegal[:useCodes].empty? 20 | json.otherConstraint hLegal[:otherCons] unless hLegal[:otherCons].empty? 21 | end 22 | 23 | end # build 24 | end # LegalConstraint 25 | 26 | end 27 | end 28 | end 29 | end 30 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_localProjection.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer - spatial reference system projection parameters 2 | 3 | # History: 4 | # Stan Smith 2018 10-18 original script 5 | 6 | require 'jbuilder' 7 | 8 | module ADIWG 9 | module Mdtranslator 10 | module Writers 11 | module MdJson 12 | 13 | module LocalProjection 14 | 15 | @Namespace = ADIWG::Mdtranslator::Writers::MdJson 16 | 17 | def self.build(hLocal) 18 | 19 | Jbuilder.new do |json| 20 | json.fixedToEarth hLocal[:fixedToEarth] 21 | json.description hLocal[:description] 22 | json.georeference hLocal[:georeference] 23 | end 24 | 25 | end # build 26 | end # LocalProjection 27 | 28 | end 29 | end 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_locale.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer - locale 2 | 3 | # History: 4 | # Stan Smith 2017-03-11 refactored for mdJson/mdTranslator 2.0 5 | # Josh Bradley original script 6 | 7 | require 'jbuilder' 8 | 9 | module ADIWG 10 | module Mdtranslator 11 | module Writers 12 | module MdJson 13 | 14 | module Locale 15 | 16 | def self.build(hLocale) 17 | 18 | Jbuilder.new do |json| 19 | json.language hLocale[:languageCode] 20 | json.country hLocale[:countryCode] 21 | json.characterSet hLocale[:characterEncoding] 22 | end 23 | 24 | end # build 25 | end # Locale 26 | 27 | end 28 | end 29 | end 30 | end 31 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_maintenance.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer - maintenance 2 | 3 | # History: 4 | # Stan Smith 2017-03-13 refactored for mdJson/mdTranslator 2.0 5 | # Josh Bradley original script 6 | 7 | require 'jbuilder' 8 | require_relative 'mdJson_date' 9 | require_relative 'mdJson_scope' 10 | require_relative 'mdJson_responsibleParty' 11 | 12 | module ADIWG 13 | module Mdtranslator 14 | module Writers 15 | module MdJson 16 | 17 | module Maintenance 18 | 19 | @Namespace = ADIWG::Mdtranslator::Writers::MdJson 20 | 21 | def self.build(hMaint) 22 | 23 | Jbuilder.new do |json| 24 | json.frequency hMaint[:frequency] 25 | json.date @Namespace.json_map(hMaint[:dates], Date) 26 | json.scope @Namespace.json_map(hMaint[:scopes], Scope) 27 | json.note hMaint[:notes] unless hMaint[:notes].empty? 28 | json.contact @Namespace.json_map(hMaint[:contacts], ResponsibleParty) 29 | end 30 | 31 | end # build 32 | end # Maintenance 33 | 34 | end 35 | end 36 | end 37 | end 38 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_measure.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer - measure 2 | 3 | # History: 4 | # Stan Smith 2017-03-14 original script 5 | 6 | require 'jbuilder' 7 | 8 | module ADIWG 9 | module Mdtranslator 10 | module Writers 11 | module MdJson 12 | 13 | module Measure 14 | 15 | def self.build(hMeasure) 16 | 17 | Jbuilder.new do |json| 18 | json.type hMeasure[:type] 19 | json.value hMeasure[:value] 20 | json.unitOfMeasure hMeasure[:unitOfMeasure] 21 | end 22 | 23 | end # build 24 | end # Measure 25 | 26 | end 27 | end 28 | end 29 | end 30 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_nominalResolution.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer - nominal resolution 2 | 3 | # History: 4 | # Stan Smith 2019-09-24 original script 5 | 6 | require 'jbuilder' 7 | require_relative 'mdJson_measure' 8 | 9 | module ADIWG 10 | module Mdtranslator 11 | module Writers 12 | module MdJson 13 | 14 | module NominalResolution 15 | 16 | @Namespace = ADIWG::Mdtranslator::Writers::MdJson 17 | 18 | def self.build(hResolution) 19 | 20 | Jbuilder.new do |json| 21 | json.scanningResolution Measure.build(hResolution[:scanningResolution]) unless hResolution[:scanningResolution].empty? 22 | json.groundResolution Measure.build(hResolution[:groundResolution]) unless hResolution[:groundResolution].empty? 23 | end 24 | 25 | end # build 26 | end # NominalResolution 27 | 28 | end 29 | end 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_obliqueLinePoint.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer - spatial reference system oblique line point 2 | 3 | # History: 4 | # Stan Smith 2017-10-24 original script 5 | 6 | require 'jbuilder' 7 | 8 | module ADIWG 9 | module Mdtranslator 10 | module Writers 11 | module MdJson 12 | 13 | module ObliqueLinePoint 14 | 15 | def self.build(hLinePoint) 16 | 17 | Jbuilder.new do |json| 18 | json.obliqueLineLatitude hLinePoint[:obliqueLineLatitude] 19 | json.obliqueLineLongitude hLinePoint[:obliqueLineLongitude] 20 | end 21 | 22 | end # build 23 | end # ObliqueLinePoint 24 | 25 | end 26 | end 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_onlineResource.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer - online resource 2 | 3 | # History: 4 | # Stan Smith 2019-09-18 add protocolRequest and applicationProfile 5 | # Stan Smith 2017-03-11 refactored for mdJson/mdTranslator 2.0 6 | # Josh Bradley original script 7 | 8 | require 'jbuilder' 9 | 10 | module ADIWG 11 | module Mdtranslator 12 | module Writers 13 | module MdJson 14 | 15 | module OnlineResource 16 | 17 | def self.build(hOlRes) 18 | 19 | Jbuilder.new do |json| 20 | json.uri hOlRes[:olResURI] 21 | json.name hOlRes[:olResName] 22 | json.protocol hOlRes[:olResProtocol] 23 | json.description hOlRes[:olResDesc] 24 | json.function hOlRes[:olResFunction] 25 | json.applicationProfile hOlRes[:olResApplicationProfile] 26 | json.protocolRequest hOlRes[:olResProtocolRequest] 27 | end 28 | 29 | end # build 30 | end # OnlineResource 31 | 32 | end 33 | end 34 | end 35 | end 36 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_orderProcess.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer - order process 2 | 3 | # History: 4 | # Stan Smith 2017-03-20 original script 5 | 6 | require 'jbuilder' 7 | require_relative 'mdJson_dateTime' 8 | 9 | module ADIWG 10 | module Mdtranslator 11 | module Writers 12 | module MdJson 13 | 14 | module OrderProcess 15 | 16 | def self.build(hOrder) 17 | 18 | Jbuilder.new do |json| 19 | json.fees hOrder[:fees] 20 | json.plannedAvailability DateTime.build(hOrder[:plannedAvailability]) unless hOrder[:plannedAvailability].empty? 21 | json.orderingInstructions hOrder[:orderingInstructions] 22 | json.turnaround hOrder[:turnaround] 23 | end 24 | 25 | end # build 26 | end # OrderProcess 27 | 28 | end 29 | end 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_party.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer - party 2 | 3 | # History: 4 | # Stan Smith 2017-03-18 original script 5 | 6 | require 'jbuilder' 7 | 8 | module ADIWG 9 | module Mdtranslator 10 | module Writers 11 | module MdJson 12 | 13 | module Party 14 | 15 | def self.build(hParty) 16 | 17 | Jbuilder.new do |json| 18 | json.contactId hParty[:contactId] 19 | json.organizationMembers hParty[:organizationMembers] unless hParty[:organizationMembers].empty? 20 | end 21 | 22 | end # build 23 | end # Party 24 | 25 | end 26 | end 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_pass.rb: -------------------------------------------------------------------------------- 1 | require 'jbuilder' 2 | require_relative 'mdJson_identifier' 3 | require_relative 'mdJson_extent' 4 | require_relative 'mdJson_event' 5 | 6 | module ADIWG 7 | module Mdtranslator 8 | module Writers 9 | module MdJson 10 | 11 | module Pass 12 | 13 | @Namespace = ADIWG::Mdtranslator::Writers::MdJson 14 | 15 | def self.build(hPass) 16 | 17 | Jbuilder.new do |json| 18 | json.passId hPass[:passId] 19 | json.identifier Identifier.build(hPass[:identifier]) 20 | json.extent Extent.build(hPass[:extent]) unless hPass[:extent].empty? 21 | json.relatedEvent @Namespace.json_map(hPass[:relatedEvents], Event) unless hPass[:relatedEvents].empty? 22 | end 23 | 24 | end 25 | end # Pass 26 | 27 | end 28 | end 29 | end 30 | end 31 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_phone.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer - phone 2 | 3 | # History: 4 | # Stan Smith 2017-03-12 refactored for mdJson/mdTranslator 2.0 5 | # Josh Bradley original script 6 | 7 | require 'jbuilder' 8 | 9 | module ADIWG 10 | module Mdtranslator 11 | module Writers 12 | module MdJson 13 | 14 | module Phone 15 | 16 | def self.build(hPhone) 17 | 18 | Jbuilder.new do |json| 19 | json.phoneName hPhone[:phoneName] 20 | json.phoneNumber hPhone[:phoneNumber] 21 | json.service hPhone[:phoneServiceTypes] unless hPhone[:phoneServiceTypes].empty? 22 | end 23 | 24 | end # build 25 | end # Phone 26 | 27 | end 28 | end 29 | end 30 | end 31 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_plan.rb: -------------------------------------------------------------------------------- 1 | require 'jbuilder' 2 | require_relative 'mdJson_citation' 3 | require_relative 'mdJson_operation' 4 | require_relative 'mdJson_requirement' 5 | 6 | module ADIWG 7 | module Mdtranslator 8 | module Writers 9 | module MdJson 10 | 11 | module Plan 12 | 13 | @Namespace = ADIWG::Mdtranslator::Writers::MdJson 14 | 15 | def self.build(hPlan) 16 | 17 | Jbuilder.new do |json| 18 | json.planId hPlan[:planId] 19 | json.planType hPlan[:planType] unless hPlan[:planType].nil? 20 | json.status hPlan[:status] 21 | json.citation Citation.build(hPlan[:citation]) 22 | json.planOperation @Namespace.json_map(hPlan[:operations], Operation) 23 | json.satisfiedRequirement @Namespace.json_map(hPlan[:satisfiedRequirements], Requirement) 24 | 25 | end 26 | 27 | end 28 | end # Plan 29 | end 30 | end 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_processReport.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer - process step report 2 | 3 | # History: 4 | # Stan Smith 2019-09-24 original script 5 | 6 | require 'jbuilder' 7 | 8 | module ADIWG 9 | module Mdtranslator 10 | module Writers 11 | module MdJson 12 | 13 | module ProcessStepReport 14 | 15 | @Namespace = ADIWG::Mdtranslator::Writers::MdJson 16 | 17 | def self.build(hReport) 18 | 19 | Jbuilder.new do |json| 20 | json.name hReport[:name] 21 | json.description hReport[:description] 22 | json.fileType hReport[:fileType] 23 | end 24 | 25 | end # build 26 | end # ProcessStepReport 27 | 28 | end 29 | end 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_qualityMeasure.rb: -------------------------------------------------------------------------------- 1 | require 'jbuilder' 2 | require_relative 'mdJson_identifier' 3 | 4 | module ADIWG 5 | module Mdtranslator 6 | module Writers 7 | module MdJson 8 | 9 | module QualityMeasure 10 | def self.build(hQualityMeasure) 11 | Jbuilder.new do |json| 12 | json.identifier Identifier.build(hQualityMeasure[:identifier]) unless hQualityMeasure[:identifier].empty? 13 | json.name hQualityMeasure[:nameOfMeasure] unless hQualityMeasure[:nameOfMeasure].empty? 14 | json.description hQualityMeasure[:description] unless hQualityMeasure[:description].nil? 15 | end 16 | end 17 | end 18 | 19 | end 20 | end 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_qualityResultFile.rb: -------------------------------------------------------------------------------- 1 | require 'jbuilder' 2 | require_relative 'mdJson_format' 3 | 4 | module ADIWG 5 | module Mdtranslator 6 | module Writers 7 | module MdJson 8 | 9 | module QualityResultFile 10 | def self.build(hQualityResultFile) 11 | Jbuilder.new do |json| 12 | json.fileName hQualityResultFile[:fileName] 13 | json.fileDescription hQualityResultFile[:fileDescription] 14 | json.fileType hQualityResultFile[:fileType] 15 | json.fileFormat Format.build(hQualityResultFile[:fileFormat]) unless hQualityResultFile[:fileFormat].nil? 16 | end 17 | end 18 | end 19 | 20 | end 21 | end 22 | end 23 | end -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_quantitativeResult.rb: -------------------------------------------------------------------------------- 1 | require 'jbuilder' 2 | require_relative 'mdJson_scope' 3 | 4 | module ADIWG 5 | module Mdtranslator 6 | module Writers 7 | module MdJson 8 | 9 | module QuantitativeResult 10 | def self.build(hResult) 11 | Jbuilder.new do |json| 12 | json.dateTime hResult[:dateTime] unless hResult[:dateTime].nil? 13 | json.scope Scope.build(hResult[:scope]) unless hResult[:scope].empty? 14 | json.name hResult[:name] unless hResult[:name].nil? 15 | json.value hResult[:values] unless hResult[:values].empty? 16 | json.valueUnits hResult[:valueUnits] unless hResult[:valueUnits].nil? 17 | json.valueRecordType hResult[:valueRecordType] unless hResult[:valueRecordType].nil? 18 | end 19 | end 20 | end 21 | 22 | end 23 | end 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_releasability.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer - releasability 2 | 3 | # History: 4 | # Stan Smith 2017-03-17 original script 5 | 6 | require 'jbuilder' 7 | require_relative 'mdJson_responsibleParty' 8 | 9 | module ADIWG 10 | module Mdtranslator 11 | module Writers 12 | module MdJson 13 | 14 | module Releasability 15 | 16 | @Namespace = ADIWG::Mdtranslator::Writers::MdJson 17 | 18 | def self.build(hRelease) 19 | 20 | Jbuilder.new do |json| 21 | json.addressee @Namespace.json_map(hRelease[:addressee], ResponsibleParty) 22 | json.statement hRelease[:statement] 23 | json.disseminationConstraint hRelease[:disseminationConstraint] unless hRelease[:disseminationConstraint].empty? 24 | end 25 | 26 | end # build 27 | end # Releasability 28 | 29 | end 30 | end 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_repository.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer - metadataRepository 2 | 3 | # History: 4 | # Stan Smith 2017-03-11 refactored for mdJson/mdTranslator 2.0 5 | # Josh Bradley original script 6 | 7 | require 'jbuilder' 8 | require_relative 'mdJson_citation' 9 | 10 | module ADIWG 11 | module Mdtranslator 12 | module Writers 13 | module MdJson 14 | 15 | module Repository 16 | 17 | def self.build(hRepository) 18 | 19 | Jbuilder.new do |json| 20 | json.repository hRepository[:repository] 21 | json.metadataStandard hRepository[:metadataStandard] 22 | json.citation Citation.build(hRepository[:citation]) unless hRepository[:citation].empty? 23 | end 24 | 25 | end # build 26 | end # Repository 27 | 28 | end 29 | end 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_requestedDate.rb: -------------------------------------------------------------------------------- 1 | require 'jbuilder' 2 | require_relative 'mdJson_dateTime' 3 | 4 | module ADIWG 5 | module Mdtranslator 6 | module Writers 7 | module MdJson 8 | 9 | module RequestedDate 10 | 11 | @Namespace = ADIWG::Mdtranslator::Writers::MdJson 12 | 13 | def self.build(hRequestedDate) 14 | 15 | Jbuilder.new do |json| 16 | json.requestedDateOfCollection DateTime.build(hRequestedDate[:requestedDateOfCollection]) 17 | json.latestAcceptableDate DateTime.build(hRequestedDate[:latestAcceptableDate]) 18 | end 19 | 20 | end 21 | end # Requested Date 22 | 23 | end 24 | end 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_resourceType.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer - resourceType 2 | 3 | # History: 4 | # Stan Smith 2017-03-11 refactored for mdJson/mdTranslator 2.0 5 | # Josh Bradley original script 6 | 7 | require 'jbuilder' 8 | 9 | module ADIWG 10 | module Mdtranslator 11 | module Writers 12 | module MdJson 13 | 14 | module ResourceType 15 | 16 | def self.build(hResType) 17 | 18 | 19 | Jbuilder.new do |json| 20 | json.type hResType[:type] 21 | json.name hResType[:name] 22 | end 23 | 24 | end # build 25 | end # ResourceType 26 | 27 | end 28 | end 29 | end 30 | end 31 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_responsibleParty.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer - responsible party 2 | 3 | # History: 4 | # Stan Smith 2017-03-11 refactored for mdJson/mdTranslator 2.0 5 | # Josh Bradley original script 6 | 7 | require 'jbuilder' 8 | require_relative 'mdJson_extent' 9 | require_relative 'mdJson_party' 10 | 11 | module ADIWG 12 | module Mdtranslator 13 | module Writers 14 | module MdJson 15 | 16 | module ResponsibleParty 17 | 18 | @Namespace = ADIWG::Mdtranslator::Writers::MdJson 19 | 20 | def self.build(hResParty) 21 | 22 | Jbuilder.new do |json| 23 | json.role hResParty[:roleName] 24 | json.roleExtent @Namespace.json_map(hResParty[:roleExtents], Extent) 25 | json.party @Namespace.json_map(hResParty[:parties], Party) 26 | end 27 | 28 | end # build 29 | end # ResponsibleParty 30 | 31 | end 32 | end 33 | end 34 | end 35 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_revision.rb: -------------------------------------------------------------------------------- 1 | require 'jbuilder' 2 | require_relative 'mdJson_responsibleParty' 3 | require_relative 'mdJson_dateTime' 4 | 5 | module ADIWG 6 | module Mdtranslator 7 | module Writers 8 | module MdJson 9 | 10 | module Revision 11 | 12 | @Namespace = ADIWG::Mdtranslator::Writers::MdJson 13 | 14 | def self.build(hRevision) 15 | 16 | Jbuilder.new do |json| 17 | json.description hRevision[:description] 18 | json.responsibleParty @Namespace.json_map(hRevision[:responsibleParties], ResponsibleParty) 19 | json.dateInfo @Namespace.json_map(hRevision[:dateInfo], DateTime) 20 | end 21 | 22 | end 23 | end # Revision 24 | 25 | end 26 | end 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_scope.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer - scope 2 | 3 | # History: 4 | # Stan Smith 2017-03-12 refactored for mdJson/mdTranslator 2.0 5 | # Josh Bradley original script 6 | 7 | require 'jbuilder' 8 | require_relative 'mdJson_scopeDescription' 9 | require_relative 'mdJson_extent' 10 | 11 | module ADIWG 12 | module Mdtranslator 13 | module Writers 14 | module MdJson 15 | 16 | module Scope 17 | 18 | @Namespace = ADIWG::Mdtranslator::Writers::MdJson 19 | 20 | def self.build(hScope) 21 | 22 | Jbuilder.new do |json| 23 | json.scopeCode hScope[:scopeCode] 24 | json.scopeDescription @Namespace.json_map(hScope[:scopeDescriptions], ScopeDescription) 25 | json.scopeExtent @Namespace.json_map(hScope[:extents], Extent) 26 | end 27 | 28 | end # build 29 | end # Scope 30 | 31 | end 32 | end 33 | end 34 | end 35 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_scopeDescription.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer - scope description 2 | 3 | # History: 4 | # Stan Smith 2017-03-18 refactored for mdJson/mdTranslator 2.0 5 | # Josh Bradley original script 6 | 7 | require 'jbuilder' 8 | 9 | module ADIWG 10 | module Mdtranslator 11 | module Writers 12 | module MdJson 13 | 14 | module ScopeDescription 15 | 16 | def self.build(hScopeDesc) 17 | 18 | Jbuilder.new do |json| 19 | json.dataset hScopeDesc[:dataset] 20 | json.attributes hScopeDesc[:attributes] 21 | json.features hScopeDesc[:features] 22 | json.other hScopeDesc[:other] 23 | end 24 | 25 | end # build 26 | end # ScopeDescription 27 | 28 | end 29 | end 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_securityConstraint.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer - security constraint 2 | 3 | # History: 4 | # Stan Smith 2017-03-17 original script 5 | 6 | require 'jbuilder' 7 | 8 | module ADIWG 9 | module Mdtranslator 10 | module Writers 11 | module MdJson 12 | 13 | module SecurityConstraint 14 | 15 | def self.build(hSecurity) 16 | 17 | Jbuilder.new do |json| 18 | json.classification hSecurity[:classCode] 19 | json.classificationSystem hSecurity[:classSystem] 20 | json.userNote hSecurity[:userNote] 21 | json.handlingDescription hSecurity[:handling] 22 | end 23 | 24 | end # build 25 | end # SecurityConstraint 26 | 27 | end 28 | end 29 | end 30 | end 31 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_series.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer - series 2 | 3 | # History: 4 | # Stan Smith 2017-03-12 refactored for mdJson/mdTranslator 2.0 5 | # Josh Bradley original script 6 | 7 | require 'jbuilder' 8 | 9 | module ADIWG 10 | module Mdtranslator 11 | module Writers 12 | module MdJson 13 | 14 | module Series 15 | 16 | def self.build(hSeries) 17 | 18 | Jbuilder.new do |json| 19 | json.seriesName hSeries[:seriesName] 20 | json.seriesIssue hSeries[:seriesIssue] 21 | json.issuePage hSeries[:issuePage] 22 | end 23 | 24 | end # build 25 | end # Series 26 | 27 | end 28 | end 29 | end 30 | end 31 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_spatialReference.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer - spatial reference system 2 | 3 | # History: 4 | # Stan Smith 2017-03-11 refactored for mdJson/mdTranslator 2.0 5 | # Josh Bradley original script 6 | 7 | require 'jbuilder' 8 | require_relative 'mdJson_identifier' 9 | require_relative 'mdJson_spatialReferenceParameters' 10 | 11 | module ADIWG 12 | module Mdtranslator 13 | module Writers 14 | module MdJson 15 | 16 | module SpatialReference 17 | 18 | def self.build(hSystem) 19 | 20 | Jbuilder.new do |json| 21 | json.referenceSystemType hSystem[:systemType] 22 | json.referenceSystemIdentifier Identifier.build(hSystem[:systemIdentifier]) unless hSystem[:systemIdentifier].empty? 23 | json.referenceSystemWKT hSystem[:systemWKT] 24 | json.referenceSystemParameterSet SpatialReferenceParameters.build(hSystem[:systemParameterSet]) unless hSystem[:systemParameterSet].empty? 25 | end 26 | 27 | end # build 28 | end # SpatialReference 29 | 30 | end 31 | end 32 | end 33 | end 34 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_spatialReferenceParameters.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer - spatial reference system parameters 2 | 3 | # History: 4 | # Stan Smith 2017-10-24 original script 5 | 6 | require 'jbuilder' 7 | require_relative 'mdJson_projectionParameters' 8 | require_relative 'mdJson_geodeticParameters' 9 | require_relative 'mdJson_verticalDatumParameters' 10 | 11 | module ADIWG 12 | module Mdtranslator 13 | module Writers 14 | module MdJson 15 | 16 | module SpatialReferenceParameters 17 | 18 | def self.build(hSystem) 19 | 20 | Jbuilder.new do |json| 21 | json.projection ProjectionParameters.build(hSystem[:projection]) unless hSystem[:projection].empty? 22 | json.geodetic GeodeticParameters.build(hSystem[:geodetic]) unless hSystem[:geodetic].empty? 23 | json.verticalDatum VerticalDatumParameters.build(hSystem[:verticalDatum]) unless hSystem[:verticalDatum].empty? 24 | end 25 | 26 | end # build 27 | end # SpatialReferenceParameters 28 | 29 | end 30 | end 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_standaloneQualityReport.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer - dataQuality 2 | 3 | require 'jbuilder' 4 | require_relative 'mdJson_citation' 5 | 6 | module ADIWG 7 | module Mdtranslator 8 | module Writers 9 | module MdJson 10 | 11 | module StandaloneQualityReport 12 | 13 | @Namespace = ADIWG::Mdtranslator::Writers::MdJson 14 | 15 | def self.build(hStandaloneReport) 16 | reportReference = hStandaloneReport[:reportReference] 17 | Jbuilder.new do |json| 18 | json.reportReference Citation.build(reportReference) 19 | json.abstract hStandaloneReport[:abstract] 20 | end 21 | 22 | end 23 | 24 | end 25 | 26 | end 27 | end 28 | end 29 | end 30 | 31 | 32 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_taxonomicSystem.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer - taxonomic System 2 | 3 | # History: 4 | # Stan Smith 2017-03-17 original script 5 | 6 | require 'jbuilder' 7 | require_relative 'mdJson_citation' 8 | 9 | module ADIWG 10 | module Mdtranslator 11 | module Writers 12 | module MdJson 13 | 14 | module TaxonomicSystem 15 | 16 | def self.build(hTaxSystem) 17 | 18 | Jbuilder.new do |json| 19 | json.citation Citation.build(hTaxSystem[:citation]) unless hTaxSystem[:citation].empty? 20 | json.modifications hTaxSystem[:modifications] 21 | end 22 | 23 | end # build 24 | end # TaxonomicSystem 25 | 26 | end 27 | end 28 | end 29 | end 30 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_temporalExtent.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer - temporal extent 2 | 3 | # History: 4 | # Stan Smith 2017-03-15 refactored for mdJson/mdTranslator 2.0 5 | # Josh Bradley original script 6 | 7 | require 'jbuilder' 8 | require_relative 'mdJson_timePeriod' 9 | require_relative 'mdJson_timeInstant' 10 | 11 | module ADIWG 12 | module Mdtranslator 13 | module Writers 14 | module MdJson 15 | 16 | module TemporalExtent 17 | 18 | def self.build(hTemporal) 19 | 20 | Jbuilder.new do |json| 21 | json.timePeriod TimePeriod.build(hTemporal[:timePeriod]) unless hTemporal[:timePeriod].empty? 22 | json.timeInstant TimeInstant.build(hTemporal[:timeInstant]) unless hTemporal[:timeInstant].empty? 23 | end 24 | 25 | end # build 26 | end # TemporalExtent 27 | 28 | end 29 | end 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_timeInterval.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer - time interval 2 | 3 | # History: 4 | # Stan Smith 2017-03-14 refactored for mdJson/mdTranslator 2.0 5 | # Josh Bradley original script 6 | 7 | require 'jbuilder' 8 | 9 | module ADIWG 10 | module Mdtranslator 11 | module Writers 12 | module MdJson 13 | 14 | module TimeInterval 15 | 16 | def self.build(hInterval) 17 | 18 | Jbuilder.new do |json| 19 | json.interval hInterval[:interval] 20 | json.units hInterval[:units] 21 | end 22 | 23 | end # build 24 | end # TimePeriod 25 | 26 | end 27 | end 28 | end 29 | end 30 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_valueRange.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer - value range 2 | 3 | # History: 4 | # Stan Smith 2017-11-01 original script 5 | 6 | require 'jbuilder' 7 | 8 | module ADIWG 9 | module Mdtranslator 10 | module Writers 11 | module MdJson 12 | 13 | module ValueRange 14 | 15 | def self.build(hRange) 16 | 17 | Jbuilder.new do |json| 18 | json.minRangeValue hRange[:minRangeValue] 19 | json.maxRangeValue hRange[:maxRangeValue] 20 | end 21 | 22 | end # build 23 | end # ValueRange 24 | 25 | end 26 | end 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_vectorObject.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer - vector object 2 | 3 | # History: 4 | # Stan Smith 2017-03-14 original script 5 | 6 | require 'jbuilder' 7 | 8 | module ADIWG 9 | module Mdtranslator 10 | module Writers 11 | module MdJson 12 | 13 | module VectorObject 14 | 15 | def self.build(hObject) 16 | 17 | Jbuilder.new do |json| 18 | json.objectType hObject[:objectType] 19 | json.objectCount hObject[:objectCount] 20 | end 21 | 22 | end # build 23 | end # VectorObject 24 | 25 | end 26 | end 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_vectorRepresentation.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer - vector representation 2 | 3 | # History: 4 | # Stan Smith 2017-03-14 original script 5 | 6 | require 'jbuilder' 7 | require_relative 'mdJson_vectorObject' 8 | 9 | module ADIWG 10 | module Mdtranslator 11 | module Writers 12 | module MdJson 13 | 14 | module Vector 15 | 16 | def self.build(hVector) 17 | 18 | @Namespace = ADIWG::Mdtranslator::Writers::MdJson 19 | 20 | Jbuilder.new do |json| 21 | json.scope hVector[:scope] 22 | json.topologyLevel hVector[:topologyLevel] 23 | json.vectorObject @Namespace.json_map(hVector[:vectorObject], VectorObject) 24 | end 25 | 26 | end # build 27 | end # Vector 28 | 29 | end 30 | end 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_verticalDatumParameters.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer - spatial reference system vertical datum parameters 2 | 3 | # History: 4 | # Stan Smith 2018-09-26 datumName is deprecated 5 | # Stan Smith 2017-10-24 original script 6 | 7 | require 'jbuilder' 8 | require_relative 'mdJson_identifier' 9 | 10 | module ADIWG 11 | module Mdtranslator 12 | module Writers 13 | module MdJson 14 | 15 | module VerticalDatumParameters 16 | 17 | def self.build(hDatum) 18 | 19 | Jbuilder.new do |json| 20 | json.datumIdentifier Identifier.build(hDatum[:datumIdentifier]) unless hDatum[:datumIdentifier].empty? 21 | json.encodingMethod hDatum[:encodingMethod] 22 | json.isDepthSystem hDatum[:isDepthSystem] 23 | json.verticalResolution hDatum[:verticalResolution] 24 | json.unitOfMeasure hDatum[:unitOfMeasure] 25 | end 26 | 27 | end # build 28 | end # VerticalDatumParameters 29 | 30 | end 31 | end 32 | end 33 | end 34 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_verticalExtent.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer - temporal extent 2 | 3 | # History: 4 | # Stan Smith 2017-03-15 refactored for mdJson/mdTranslator 2.0 5 | # Josh Bradley original script 6 | 7 | require 'jbuilder' 8 | require_relative 'mdJson_spatialReference' 9 | 10 | module ADIWG 11 | module Mdtranslator 12 | module Writers 13 | module MdJson 14 | 15 | module VerticalExtent 16 | 17 | def self.build(hVertical) 18 | 19 | Jbuilder.new do |json| 20 | json.description hVertical[:description] 21 | json.minValue hVertical[:minValue] 22 | json.maxValue hVertical[:maxValue] 23 | json.crsId SpatialReference.build(hVertical[:crsId]) unless hVertical[:crsId].empty? 24 | end 25 | 26 | end # build 27 | end # VerticalExtent 28 | 29 | end 30 | end 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_voucher.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer - taxonomic voucher 2 | 3 | # History: 4 | # Stan Smith 2017-03-17 original script 5 | 6 | require 'jbuilder' 7 | require_relative 'mdJson_responsibleParty' 8 | 9 | module ADIWG 10 | module Mdtranslator 11 | module Writers 12 | module MdJson 13 | 14 | module Voucher 15 | 16 | def self.build(hVoucher) 17 | 18 | Jbuilder.new do |json| 19 | json.specimen hVoucher[:specimen] 20 | json.repository ResponsibleParty.build(hVoucher[:repository]) unless hVoucher[:repository].empty? 21 | end 22 | 23 | end # build 24 | end # Voucher 25 | 26 | end 27 | end 28 | end 29 | end 30 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/mdJson/version.rb: -------------------------------------------------------------------------------- 1 | # mdJson version history 2 | # Stan Smith 2017-11-13 added support for spatial reference, geologic time, others 3 | # Stan Smith 2017-03-10 refactored for mdJson/mdTranslator 2.0 4 | 5 | module ADIWG 6 | module Mdtranslator 7 | module Writers 8 | module MdJson 9 | 10 | VERSION = '2.1.0' 11 | 12 | end 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/sbJson/readme.md: -------------------------------------------------------------------------------- 1 | 2 | ## sbJson 3 | 4 | ### Supported versions 5 | 6 | > 0.0.x (sbJSON is not currently versioned) 7 | 8 | ### Writer for ScienceBase JSON metadata format (sbJSON) 9 | 10 | The ScienceBase Item core is based on the Dublin Core Metadata 11 | Element Set but also includes other elements that may or may not 12 | be associated with other metadata standards that are useful for 13 | the core attribution of ScienceBase items. It is used as a means 14 | to integrate across multiple metadata standards, conventions, and 15 | practices in describing a wide array of scientific data and 16 | information assets important to science teams using ScienceBase. 17 | 18 | The sbJSON format is fully documented on 19 | the [ScienceBase Confluence page](https://my.usgs.gov/confluence/display/sciencebase/ScienceBase+Information+Model). 20 | 21 | The U.S. Geological Survey (USGS) ScienceBase Catalog contains 22 | metadata about digital and non-digital scientific data assets. 23 | The ScienceBase Catalog provides the central information about 24 | everything in ScienceBase using a flexible information model 25 | based on the simple metadata elements of the Dublin Core Metadata 26 | Element Set. 27 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_abstract.rb: -------------------------------------------------------------------------------- 1 | # sbJson 1.0 writer 2 | 3 | # History: 4 | # Stan Smith 2017-06-16 original script 5 | 6 | require 'kramdown' 7 | 8 | module ADIWG 9 | module Mdtranslator 10 | module Writers 11 | module SbJson 12 | 13 | module Abstract 14 | 15 | def self.build(abstract) 16 | 17 | abstract = Kramdown::Document.new(abstract).to_html 18 | abstract.gsub!(/\n/, '') 19 | 20 | end 21 | 22 | end 23 | 24 | end 25 | end 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_browseCategory.rb: -------------------------------------------------------------------------------- 1 | # sbJson 1.0 writer browse categories 2 | 3 | # History: 4 | # Stan Smith 2017-05-31 original script 5 | 6 | require 'jbuilder' 7 | require_relative 'sbJson_codelists' 8 | 9 | module ADIWG 10 | module Mdtranslator 11 | module Writers 12 | module SbJson 13 | 14 | module BrowseCategory 15 | 16 | def self.build(aTypes) 17 | 18 | aCategories = [] 19 | 20 | # always include a 'Data' browse category 21 | aCategories << 'Data' 22 | 23 | aTypes.each do |hType| 24 | type = hType[:type] 25 | sbType = Codelists.codelist_adiwg2sb('scope_adiwg2sb', type) 26 | aCategories << sbType unless sbType.nil? 27 | end 28 | 29 | aCategories = aCategories.uniq 30 | 31 | end 32 | 33 | end 34 | 35 | end 36 | end 37 | end 38 | end 39 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_hours.rb: -------------------------------------------------------------------------------- 1 | # sbJson 1.0 writer hours 2 | 3 | # History: 4 | # Stan Smith 2017-05-26 original script 5 | 6 | module ADIWG 7 | module Mdtranslator 8 | module Writers 9 | module SbJson 10 | 11 | module Hours 12 | 13 | def self.build(aHours) 14 | 15 | hours = '' 16 | 17 | aHours.each do |hour| 18 | hours += hour + '; ' 19 | end 20 | 21 | # clean off last semicolon 22 | if hours.length > 2 23 | hours = hours[0...-2] 24 | end 25 | 26 | hours 27 | 28 | end 29 | 30 | end 31 | 32 | end 33 | end 34 | end 35 | end 36 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_identifier.rb: -------------------------------------------------------------------------------- 1 | # sbJson 1.0 writer 2 | 3 | # History: 4 | # Stan Smith 2017-05-16 refactored for mdTranslator 2.0 5 | # Json Bradley original script 6 | 7 | require 'jbuilder' 8 | 9 | module ADIWG 10 | module Mdtranslator 11 | module Writers 12 | module SbJson 13 | 14 | module Identifier 15 | 16 | def self.build(hIdentifier) 17 | 18 | Jbuilder.new do |json| 19 | json.key hIdentifier[:identifier] 20 | json.scheme hIdentifier[:namespace] 21 | json.type hIdentifier[:description] 22 | end 23 | end 24 | 25 | end 26 | 27 | end 28 | end 29 | end 30 | end 31 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_parentId.rb: -------------------------------------------------------------------------------- 1 | # sbJson 1.0 writer 2 | 3 | # History: 4 | # Stan Smith 2017-10-24 fix bug that returns first identifier if no SB namespace is found 5 | # Stan Smith 2017-05-25 original script 6 | 7 | module ADIWG 8 | module Mdtranslator 9 | module Writers 10 | module SbJson 11 | 12 | module ParentId 13 | 14 | def self.build(hCitation) 15 | 16 | # return identifier as parentId where namespace = 'gov.sciencebase.catalog' 17 | hCitation[:identifiers].each do |hIdentifier| 18 | unless hIdentifier[:namespace].nil? 19 | if hIdentifier[:namespace] == 'gov.sciencebase.catalog' 20 | return hIdentifier[:identifier] 21 | end 22 | end 23 | end 24 | 25 | return nil 26 | 27 | end 28 | 29 | end 30 | 31 | end 32 | end 33 | end 34 | end 35 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_provenance.rb: -------------------------------------------------------------------------------- 1 | # sbJson 1.0 writer 2 | 3 | # History: 4 | # Stan Smith 2017-05-23 original script 5 | 6 | module ADIWG 7 | module Mdtranslator 8 | module Writers 9 | module SbJson 10 | 11 | module Provenance 12 | 13 | def self.build 14 | 15 | hProvenance = {} 16 | hProvenance[:annotation] = 'generated using ADIwg mdTranslator ' + ADIWG::Mdtranslator::VERSION 17 | 18 | hProvenance 19 | 20 | end 21 | 22 | end 23 | 24 | end 25 | end 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/sbJson/version.rb: -------------------------------------------------------------------------------- 1 | # sbJson version history 2 | # Stan Smith 2017-05-12 refactored for mdJson/mdTranslator 2.0 3 | 4 | module ADIWG 5 | module Mdtranslator 6 | module Writers 7 | module SbJson 8 | 9 | VERSION = '1.0.0' 10 | 11 | end 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/simple_html/readme.md: -------------------------------------------------------------------------------- 1 | 2 | ## html 3 | 4 | ### Supported versions 5 | 6 | > Supports mdTranslator version 2.x 7 | 8 | ### Writer for HTML 'human-readable' output of metadata 9 | 10 | The HTML Metadata Record output from the mdTranslator is intended to 11 | be a human readable version of the metadata content read in by the 12 | translator. The HTML output does not attempt mimic any established 13 | metadata standard but remains agnostic in its presentation. 14 | The HTML metadata output will display the full content of the 15 | metadata record ingested by the mdTranslator while translation to 16 | established standards may not support all fields. 17 | 18 | The HTML output can be conveniently embedded in a users web page to 19 | present metadata content to visitors. 20 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/simple_html/sections/html_obliqueLinePoint.rb: -------------------------------------------------------------------------------- 1 | # HTML writer 2 | # spatial reference system oblique line point 3 | 4 | # History: 5 | # Stan Smith 2017-10-24 original script 6 | 7 | module ADIWG 8 | module Mdtranslator 9 | module Writers 10 | module Simple_html 11 | 12 | class Html_ObliqueLinePoint 13 | 14 | def writeHtml(hLinePoint) 15 | 16 | long = 'missing' 17 | lat = 'missing' 18 | 19 | # oblique line point - point latitude 20 | unless hLinePoint[:obliqueLineLatitude].nil? 21 | long = hLinePoint[:obliqueLineLatitude].to_s 22 | end 23 | 24 | # oblique line point - point longitude 25 | unless hLinePoint[:obliqueLineLongitude].nil? 26 | lat = hLinePoint[:obliqueLineLongitude].to_s 27 | end 28 | 29 | return '( Longitude: ' + long + ', Latitude: ' + lat + ' )' 30 | 31 | end # writeHtml 32 | end # Html_ObliqueLinePoint 33 | 34 | end 35 | end 36 | end 37 | end 38 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/simple_html/sections/html_rangeElementDescription.rb: -------------------------------------------------------------------------------- 1 | # HTML writer 2 | # range element description 3 | 4 | module ADIWG 5 | module Mdtranslator 6 | module Writers 7 | module Simple_html 8 | 9 | class Html_RangeElementDescription 10 | 11 | def initialize(html) 12 | @html = html 13 | end 14 | 15 | def writeHtml(red) 16 | unless red[:name].nil? 17 | @html.em('Name:') 18 | @html.text!(red[:name]) 19 | @html.br 20 | end 21 | 22 | unless red[:definition].nil? 23 | @html.em('Definition:') 24 | @html.text!(red[:definition]) 25 | @html.br 26 | end 27 | 28 | red[:rangeElement].each do |hRangeElement| 29 | @html.em('Range Element:') 30 | @html.text!(hRangeElement) 31 | @html.br 32 | end 33 | 34 | end # writeHtml 35 | end # Html_RangeElementDescription 36 | 37 | end 38 | end 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/simple_html/sections/html_resourceFormat.rb: -------------------------------------------------------------------------------- 1 | # HTML writer 2 | # resource format 3 | 4 | # History: 5 | # Stan Smith 2015-03-24 original script 6 | 7 | module ADIWG 8 | module Mdtranslator 9 | module Writers 10 | module Simple_html 11 | 12 | class MdHtmlResourceFormat 13 | def initialize(html) 14 | @html = html 15 | end 16 | 17 | def writeHtml(hResFormat) 18 | 19 | # resource format - name - required 20 | unless hResFormat[:formatName].nil? 21 | @html.em('Resource Format: ') 22 | @html.text!(hResFormat[:formatName]) 23 | end 24 | 25 | # resource format - version 26 | unless !hResFormat[:formatVersion].nil? 27 | @html.em(' Version: ') 28 | @html.text!(hResFormat[:formatVersion]) 29 | end 30 | 31 | @html.br 32 | 33 | end # writeHtml 34 | 35 | end # class 36 | 37 | end 38 | end 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/simple_html/sections/html_resourceType.rb: -------------------------------------------------------------------------------- 1 | # HTML writer 2 | # resource type 3 | 4 | # History: 5 | # Stan Smith 2017-05-24 Fixed problem with nil name 6 | # Stan Smith 2015-03-25 original script 7 | 8 | module ADIWG 9 | module Mdtranslator 10 | module Writers 11 | module Simple_html 12 | 13 | class Html_ResourceType 14 | 15 | def initialize(html) 16 | @html = html 17 | end 18 | 19 | def writeHtml(hType) 20 | 21 | # resource type - (required) 22 | unless hType[:type].nil? 23 | @html.em('Resource Type: ') 24 | @html.text!(hType[:type]) 25 | unless hType[:name].nil? 26 | @html.em(' Name: ') 27 | @html.text!(hType[:name]) 28 | end 29 | @html.br 30 | end 31 | 32 | end # writeHtml 33 | end # Html_ResourceType 34 | 35 | end 36 | end 37 | end 38 | end 39 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/simple_html/sections/html_timeInterval.rb: -------------------------------------------------------------------------------- 1 | # HTML writer 2 | # time interval 3 | 4 | # History: 5 | # Stan Smith 2017-03-27 original script 6 | 7 | module ADIWG 8 | module Mdtranslator 9 | module Writers 10 | module Simple_html 11 | 12 | class Html_TimeInterval 13 | 14 | def initialize(html) 15 | @html = html 16 | end 17 | 18 | def writeHtml(hInterval) 19 | 20 | # time interval - interval 21 | unless hInterval[:interval].nil? 22 | @html.em('Interval: ') 23 | @html.text!(hInterval[:interval].to_s) 24 | @html.br 25 | end 26 | 27 | # time interval - units 28 | unless hInterval[:units].nil? 29 | @html.em('Units: ') 30 | @html.text!(hInterval[:units]) 31 | @html.br 32 | end 33 | 34 | end # writeHtml 35 | end # Html_TimeInterval 36 | 37 | end 38 | end 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/simple_html/sections/html_vectorObject.rb: -------------------------------------------------------------------------------- 1 | # HTML writer 2 | # vector object 3 | 4 | # History: 5 | # Stan Smith 2017-03-28 original script 6 | 7 | module ADIWG 8 | module Mdtranslator 9 | module Writers 10 | module Simple_html 11 | 12 | class Html_VectorObject 13 | 14 | def initialize(html) 15 | @html = html 16 | end 17 | 18 | def writeHtml(hObject) 19 | 20 | # vector object - type 21 | unless hObject[:objectType].nil? 22 | @html.em('Object Type: ') 23 | @html.text!(hObject[:objectType]) 24 | @html.br 25 | end 26 | 27 | # vector object - count 28 | unless hObject[:objectCount].nil? 29 | @html.em('Object Count: ') 30 | @html.text!(hObject[:objectCount].to_s) 31 | @html.br 32 | end 33 | 34 | end # writeHtml 35 | end # Html_VectorObject 36 | 37 | end 38 | end 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /lib/adiwg/mdtranslator/writers/simple_html/version.rb: -------------------------------------------------------------------------------- 1 | # html version history 2 | # Stan Smith 2.1.0 2017-11-13 added support for spatial reference, geologic time, others 3 | # Stan Smith 2.0.0 2017-03-21 refactored for mdTranslator 2.0 4 | # Stan Smith 1.1.0 2015-08-28 added support for content coverage information 5 | # Stan Smith 1.1.0 2015-07-31 added support for grid information 6 | # Stan Smith 1.1.0 2015-07-30 added support for locale in metadata record information 7 | 8 | module ADIWG 9 | module Mdtranslator 10 | module Writers 11 | module Simple_html 12 | 13 | # current version of html writer 14 | VERSION = '2.1.0' 15 | 16 | end 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /scripts/build-gem.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This script builds the gem and runs tests. 4 | bundle install && bundle exec rake test && gem build adiwg-mdtranslator.gemspec -------------------------------------------------------------------------------- /scripts/publish-gem.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Verify that the gemspec file is provided as an argument 4 | if [ -z "$1" ]; then 5 | echo "Usage: $0 " 6 | exit 1 7 | fi 8 | 9 | gem push "$1" -------------------------------------------------------------------------------- /test/debug/test_19115-1_writer.rb: -------------------------------------------------------------------------------- 1 | # MdTranslator - test example mdJson files with errors 2 | 3 | # History: 4 | # Stan Smith 2019-08-21 original script 5 | 6 | require_relative 'debug_test_parent' 7 | 8 | class Test191151WriterDebug < TestDebugParent 9 | 10 | def test_ISO191151_writer 11 | 12 | # read the json input file 13 | mdJson = TestDebugParent.get_json('schemaExample') 14 | 15 | hResponseObj = ADIWG::Mdtranslator.translate( 16 | file: mdJson, reader: 'mdJson', writer: 'iso19115_3', showAllTags: true, forceValid: true 17 | ) 18 | 19 | xMetadata = Nokogiri::XML(hResponseObj[:writerOutput]) 20 | 21 | puts 'Structure Messages:' 22 | puts hResponseObj[:readerStructureMessages] 23 | 24 | puts 'Validation Messages:' 25 | puts hResponseObj[:readerValidationMessages] 26 | 27 | puts 'Reader Messages:' 28 | puts hResponseObj[:readerExecutionMessages] 29 | 30 | puts 'Writer Messages:' 31 | puts hResponseObj[:writerMessages] 32 | 33 | refute_nil xMetadata 34 | 35 | end 36 | 37 | end 38 | -------------------------------------------------------------------------------- /test/debug/test_19115-2_writer.rb: -------------------------------------------------------------------------------- 1 | # MdTranslator - test example mdJson files with errors 2 | 3 | # History: 4 | # Stan Smith 2018-10-31 original script 5 | 6 | require_relative 'debug_test_parent' 7 | 8 | class Test191152WriterDebug < TestDebugParent 9 | 10 | def test_ISO191152_writer 11 | 12 | # read the json input file 13 | mdJson = TestDebugParent.get_json('josh01') 14 | 15 | hResponseObj = ADIWG::Mdtranslator.translate( 16 | file: mdJson, reader: 'mdJson', writer: 'iso19115_2', showAllTags: true, forceValid: true 17 | ) 18 | 19 | xMetadata = Nokogiri::XML(hResponseObj[:writerOutput]) 20 | 21 | puts 'Structure Messages:' 22 | puts hResponseObj[:readerStructureMessages] 23 | 24 | puts 'Validation Messages:' 25 | puts hResponseObj[:readerValidationMessages] 26 | 27 | puts 'Reader Messages:' 28 | puts hResponseObj[:readerExecutionMessages] 29 | 30 | puts 'Writer Messages:' 31 | puts hResponseObj[:writerMessages] 32 | 33 | refute_nil xMetadata 34 | 35 | end 36 | 37 | end 38 | -------------------------------------------------------------------------------- /test/debug/test_fgdc_reader.rb: -------------------------------------------------------------------------------- 1 | # MdTranslator - test example mdJson files with errors 2 | 3 | # History: 4 | # Stan Smith 2018-09-05 original script 5 | 6 | require_relative 'debug_test_parent' 7 | 8 | class TestFgdcReaderDebug < TestDebugParent 9 | 10 | def test_fgdc_reader 11 | 12 | # read the json input file 13 | xmlFile = TestDebugParent.get_xml('gulkanaGlacierGPR') 14 | 15 | hResponseObj = ADIWG::Mdtranslator.translate( 16 | file: xmlFile, reader: 'fgdc', writer: 'mdJson', showAllTags: true, forceValid: true 17 | ) 18 | 19 | htmlOut = hResponseObj[:writerOutput] 20 | 21 | puts 'Structure Messages:' 22 | puts hResponseObj[:readerStructureMessages] 23 | 24 | puts 'Validation Messages:' 25 | puts hResponseObj[:readerValidationMessages] 26 | 27 | puts 'Reader Messages:' 28 | puts hResponseObj[:readerExecutionMessages] 29 | 30 | puts 'Writer Messages:' 31 | puts hResponseObj[:writerMessages] 32 | 33 | refute_nil htmlOut 34 | 35 | end 36 | 37 | end 38 | -------------------------------------------------------------------------------- /test/debug/test_fgdc_writer.rb: -------------------------------------------------------------------------------- 1 | # MdTranslator - test example mdJson files with errors 2 | 3 | # History: 4 | # Stan Smith 2017-11-16 original script 5 | 6 | require_relative 'debug_test_parent' 7 | 8 | class TestFgdcWriterDebug < TestDebugParent 9 | 10 | def test_fgdc_writer 11 | 12 | # read the json input file 13 | mdJson = TestDebugParent.get_json('josh01') 14 | 15 | hResponseObj = ADIWG::Mdtranslator.translate( 16 | file: mdJson, reader: 'mdJson', writer: 'fgdc', showAllTags: true, forceValid: true 17 | ) 18 | 19 | xMetadata = Nokogiri::XML(hResponseObj[:writerOutput]) 20 | got = xMetadata.xpath('./metadata') 21 | 22 | puts 'Structure Messages:' 23 | puts hResponseObj[:readerStructureMessages] 24 | 25 | puts 'Validation Messages:' 26 | puts hResponseObj[:readerValidationMessages] 27 | 28 | puts 'Reader Messages:' 29 | puts hResponseObj[:readerExecutionMessages] 30 | 31 | puts 'Writer Messages:' 32 | puts hResponseObj[:writerMessages] 33 | 34 | refute_nil got 35 | 36 | end 37 | 38 | end 39 | -------------------------------------------------------------------------------- /test/readers/fgdc/tc_fgdc_onlineResource.rb: -------------------------------------------------------------------------------- 1 | # MdTranslator - minitest of 2 | # readers / fgdc / module_onlineResource 3 | 4 | # History: 5 | # Stan Smith 2017-08-18 original script 6 | 7 | require_relative 'fgdc_test_parent' 8 | require 'adiwg/mdtranslator/readers/fgdc/modules/module_onlineResource' 9 | 10 | class TestReaderFgdcOnlineResource < TestReaderFGDCParent 11 | 12 | @@NameSpace = ADIWG::Mdtranslator::Readers::Fgdc::OnlineResource 13 | 14 | def test_onlineResource_complete 15 | 16 | linkName = 'https://link.name' 17 | linkDescription = 'link description' 18 | hResponse = Marshal::load(Marshal.dump(@@hResponseObj)) 19 | hOnline = @@NameSpace.unpack(linkName, linkDescription,hResponse) 20 | 21 | refute_empty hOnline 22 | assert_equal linkName, hOnline[:olResURI] 23 | assert_equal linkDescription, hOnline[:olResDesc] 24 | assert hResponse[:readerExecutionPass] 25 | assert_empty hResponse[:readerExecutionMessages] 26 | 27 | end 28 | 29 | end 30 | -------------------------------------------------------------------------------- /test/readers/fgdc/tc_fgdc_series.rb: -------------------------------------------------------------------------------- 1 | # MdTranslator - minitest of 2 | # readers / fgdc / module_series 3 | 4 | # History: 5 | # Stan Smith 2017-08-14 original script 6 | 7 | require 'adiwg/mdtranslator/readers/fgdc/modules/module_fgdc' 8 | require_relative 'fgdc_test_parent' 9 | 10 | class TestReaderFgdcSeries < TestReaderFGDCParent 11 | 12 | @@xDoc = TestReaderFGDCParent.get_XML('series.xml') 13 | @@NameSpace = ADIWG::Mdtranslator::Readers::Fgdc::Series 14 | 15 | def test_series_complete 16 | 17 | xIn = @@xDoc.xpath('./serinfo') 18 | hResponse = Marshal::load(Marshal.dump(@@hResponseObj)) 19 | hSeries = @@NameSpace.unpack(xIn, hResponse) 20 | 21 | refute_empty hSeries 22 | assert_equal 'Series Name', hSeries[:seriesName] 23 | assert_equal 'Spring 2017', hSeries[:seriesIssue] 24 | assert_nil hSeries[:issuePage] 25 | assert hResponse[:readerExecutionPass] 26 | assert_empty hResponse[:readerExecutionMessages] 27 | 28 | end 29 | 30 | end 31 | -------------------------------------------------------------------------------- /test/readers/fgdc/testData/date_local.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | local time 5 | 6 | 7 | -------------------------------------------------------------------------------- /test/readers/fgdc/testData/date_utc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | universal time 5 | 6 | 7 | -------------------------------------------------------------------------------- /test/readers/fgdc/testData/keyword.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ISO 19115 Topic Category 7 | biota 8 | farming 9 | 10 | 11 | NASA GCMD Earth Science Keywords 12 | Earth Science 13 | Biological Classification 14 | 15 | 16 | USGS Geographic Names Information System 17 | Alaska 18 | Colville River Delta 19 | 20 | 21 | NGA GEOnet Names Server 22 | Canada 23 | 24 | 25 | Integumentary System 26 | stratum corneum 27 | stratum lucidum 28 | 29 | 30 | Gregorian Calendar 31 | year 32 | month 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /test/readers/fgdc/testData/pointVector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | indirect reference 4 | Point 5 | 6 | 7 | Circular arc, three point center 8 | 9 9 | 10 | 11 | G-polygon 12 | 99 13 | 14 | 15 | 2 16 | 17 | Node 18 | 999 19 | 20 | 21 | Edge 22 | 9999 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /test/readers/fgdc/testData/publication.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | City, State, USA 7 | My Publisher 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /test/readers/fgdc/testData/raster.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | indirect reference 4 | Raster 5 | 6 | Pixel 7 | 999 8 | 99 9 | 9 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /test/readers/fgdc/testData/security.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | my security system name 6 | secret 7 | my security handling instructions 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/readers/fgdc/testData/series.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Series Name 4 | Spring 2017 5 | 6 | -------------------------------------------------------------------------------- /test/readers/fgdc/testData/spatialReferenceGeodetic.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | World Geodetic System of 1984 8 | World Geodetic System of 1984 9 | 6378137.0 10 | 298.257223563 11 | 12 | 13 | 14 | 15 | planar coordinate encoding method 16 | 17 | 9.9 18 | 99.9 19 | 20 | feet 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /test/readers/fgdc/testData/spatialReferenceLocal.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | local description 8 | local georeference 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /test/readers/fgdc/testData/spatialResolutionGeographic.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 0.00009 8 | 0.00004 9 | decimal degrees 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /test/readers/fgdc/testData/spatialResolutionPlanar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | planar coordinate encoding method 9 | 10 | 9.9 11 | 99.9 12 | 13 | 14 | 99.99 15 | 9.99 16 | bearing units 17 | bearing direction 18 | bearing meridian 19 | 20 | feet 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /test/readers/fgdc/testData/temporalExtent.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 20120121 9 | 10 | 11 | 12 | 20170821 13 | 14 | 15 | 16 | 17 | ground condition 18 | 19 | 20 | 21 | universal time 22 | 23 | 24 | -------------------------------------------------------------------------------- /test/readers/fgdc/testData/timePeriod_range.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 19900701 8 | 12:30:00 9 | 2016 10 | 17:30:00 11 | 12 | time scale 13 | geologic estimate first 14 | geologic uncertainty 15 | method to estimate 16 | 17 | 18 | time scale 19 | geologic estimate last 20 | geologic uncertainty 21 | method to estimate 22 | 23 | 24 | 25 | ground condition 26 | 27 | 28 | 29 | universal time 30 | 31 | 32 | -------------------------------------------------------------------------------- /test/readers/fgdc/testData/verticalSystem.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | altitude datum name 7 | 0.9 8 | 1.9 9 | kilometers 10 | attribute values 11 | 12 | 13 | depth datum name 14 | 1.0 15 | 3.0 16 | fathom 17 | explicit depth coordinate 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /test/readers/sbJson/sbjson_test_parent.rb: -------------------------------------------------------------------------------- 1 | # MdTranslator - minitest of 2 | # parent class for all tc_sbjson tests 3 | 4 | # History: 5 | # Stan Smith 2017-06- original script 6 | 7 | require 'minitest/autorun' 8 | require 'json' 9 | require 'json-schema' 10 | require 'adiwg-mdjson_schemas' 11 | require 'adiwg/mdtranslator/readers/sbJson/modules/module_sbJson' 12 | 13 | class TestReaderSbJsonParent < Minitest::Test 14 | 15 | @@responseObj = { 16 | readerExecutionPass: true, 17 | readerExecutionMessages: [] 18 | } 19 | 20 | # create new internal metadata container for the reader 21 | @@intMetadataClass = InternalMetadata.new 22 | 23 | # get json file for tests from examples folder 24 | def self.getJson(fileName) 25 | 26 | file = File.join(File.dirname(__FILE__), 'testData', fileName) 27 | file = File.open(file, 'r') 28 | jsonFile = file.read 29 | file.close 30 | return JSON.parse(jsonFile) 31 | 32 | end 33 | 34 | end 35 | -------------------------------------------------------------------------------- /test/readers/sbJson/testData/body.json: -------------------------------------------------------------------------------- 1 | { 2 | "body": "### Title\n**BOLD**\n\n* Item 1\n* Item 2\n\nWhitespace paragraph 1\n\nWhitespace paragraph 2", 3 | "summary": "mySummary" 4 | } -------------------------------------------------------------------------------- /test/readers/sbJson/testData/browseCategory.json: -------------------------------------------------------------------------------- 1 | { 2 | "browseCategories": [ 3 | "Data", 4 | "Publication", 5 | "Project", 6 | "Physical Item", 7 | "Some other category" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /test/readers/sbJson/testData/budget.json: -------------------------------------------------------------------------------- 1 | { 2 | "className": "gov.sciencebase.catalog.item.facet.BudgetFacet", 3 | "annualBudgets": [ 4 | { 5 | "fundingSources": [ 6 | { 7 | "amount": 9.0, 8 | "matching": true, 9 | "recipient": "Bar", 10 | "source": "Foo" 11 | }, 12 | { 13 | "amount": 90.0, 14 | "matching": false, 15 | "recipient": "Baz", 16 | "source": "Biz" 17 | } 18 | ], 19 | "totalFunding": 99.0, 20 | "year": "2017" 21 | }, 22 | { 23 | "fundingSources": [ 24 | { 25 | "amount": 9000.0, 26 | "matching": null 27 | } 28 | ], 29 | "totalFunding": 9000.0, 30 | "year": "2016" 31 | }, 32 | { 33 | "year": "2015" 34 | }, 35 | { 36 | "fundingSources": [ 37 | { 38 | "amount": 90000.0, 39 | "matching": null 40 | } 41 | ], 42 | "totalFunding": 90000.0 43 | } 44 | ] 45 | } 46 | -------------------------------------------------------------------------------- /test/readers/sbJson/testData/citation.json: -------------------------------------------------------------------------------- 1 | { 2 | "citation": "names, dates, and links" 3 | } -------------------------------------------------------------------------------- /test/readers/sbJson/testData/date.json: -------------------------------------------------------------------------------- 1 | { 2 | "dates": [ 3 | { 4 | "type":"Publication", 5 | "dateString":"2012-01-01", 6 | "label": "Publication Date" 7 | }, 8 | { 9 | "type":"Repository Created", 10 | "dateString":"2012", 11 | "label":"Repository Created" 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /test/readers/sbJson/testData/extent.json: -------------------------------------------------------------------------------- 1 | { 2 | "extents": [ 3 | 2005798, 4 | 5551212 5 | ] 6 | } -------------------------------------------------------------------------------- /test/readers/sbJson/testData/id.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "SB123456789" 3 | } -------------------------------------------------------------------------------- /test/readers/sbJson/testData/identifier.json: -------------------------------------------------------------------------------- 1 | { 2 | "identifiers": [ 3 | { 4 | "type": "identifier 1 type", 5 | "scheme": "namespace 1", 6 | "key": "identifier 1" 7 | }, 8 | { 9 | "type": "identifier 2 type", 10 | "scheme": "namespace 2", 11 | "key": "identifier 2" 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /test/readers/sbJson/testData/materialRequest.json: -------------------------------------------------------------------------------- 1 | { 2 | "materialRequestInstructions": "Material Request Instructions" 3 | } -------------------------------------------------------------------------------- /test/readers/sbJson/testData/parentId.json: -------------------------------------------------------------------------------- 1 | { 2 | "parentId": "4f46607504a61aa9773f463d" 3 | } -------------------------------------------------------------------------------- /test/readers/sbJson/testData/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "className": "gov.sciencebase.catalog.item.facet.ProjectFacet", 3 | "projectStatus": "Active", 4 | "parts": [ 5 | { 6 | "type": "Short Project Description", 7 | "value": "Precipitation has affected forest." 8 | } 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /test/readers/sbJson/testData/provenance.json: -------------------------------------------------------------------------------- 1 | { 2 | "provenance": { 3 | "annotation": "", 4 | "dataSource": "Input directly", 5 | "dateCreated": "2016-02-05", 6 | "lastUpdated": "2017-04-06T20:12:01Z", 7 | "createdBy": "", 8 | "lastUpdatedBy": "", 9 | "fileProcess": "", 10 | "linkProcess": "" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /test/readers/sbJson/testData/publication.json: -------------------------------------------------------------------------------- 1 | { 2 | "className":"gov.sciencebase.catalog.item.facet.CitationFacet", 3 | "citationType":"journal", 4 | "note":"Citation note", 5 | "journal":"The Journal Name", 6 | "conference":"notMapped", 7 | "tableOfContents":"notMapped", 8 | "edition":"February 2016", 9 | "language": "ESP", 10 | "parts": 11 | [ 12 | { 13 | "type":"notMapped", 14 | "value":"notMapped" 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /test/readers/sbJson/testData/purpose.json: -------------------------------------------------------------------------------- 1 | { 2 | "purpose": "This is my purpose." 3 | } -------------------------------------------------------------------------------- /test/readers/sbJson/testData/relatedItem.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "56b3e649e4b0cc79997fb5ec", 3 | "relatedItems": { 4 | "link": { 5 | "url": "https://www.sciencebase.gov/catalog/itemLinks?itemId=56b3e649e4b0cc79997fb5ec", 6 | "rel": "related" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /test/readers/sbJson/testData/rights.json: -------------------------------------------------------------------------------- 1 | { 2 | "rights": "These are my rights." 3 | } -------------------------------------------------------------------------------- /test/readers/sbJson/testData/spatial.json: -------------------------------------------------------------------------------- 1 | { 2 | "spatial": { 3 | "representationalPoint": [123,23], 4 | "representationalPointIsDerived": false, 5 | "boundingBox": { 6 | "maxY": 23.22, 7 | "maxX": 12.12, 8 | "minX": 23.21, 9 | "minY": 43 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /test/readers/sbJson/testData/titles.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "title", 3 | "alternateTitles": [ 4 | "alternate title 1", 5 | "alternate title 2" 6 | ] 7 | } -------------------------------------------------------------------------------- /test/readers/sbJson/xc_sbjson_clean.rb: -------------------------------------------------------------------------------- 1 | # MdTranslator - minitest of 2 | # reader / sbJson / module_sbJson 3 | 4 | # History: 5 | # Stan Smith 2017-08-24 original script 6 | 7 | require_relative 'sbjson_test_parent' 8 | require 'adiwg/mdtranslator/readers/sbJson/modules/module_sbJson' 9 | 10 | class TestReaderSbJsonClean < TestReaderSbJsonParent 11 | 12 | @@NameSpace = ADIWG::Mdtranslator::Readers::SbJson::SbJson 13 | @@hIn = TestReaderSbJsonParent.getJson('clean.json') 14 | 15 | def test_complete_sbJson 16 | 17 | hIn = Marshal::load(Marshal.dump(@@hIn)) 18 | hResponse = Marshal::load(Marshal.dump(@@responseObj)) 19 | 20 | metadata = @@NameSpace.unpack(hIn, hResponse) 21 | 22 | refute_empty metadata 23 | assert hResponse[:readerExecutionPass] 24 | assert_empty hResponse[:readerExecutionMessages] 25 | 26 | end 27 | 28 | end 29 | -------------------------------------------------------------------------------- /test/readers/sbJson/xc_sbjson_sbSbJson.rb: -------------------------------------------------------------------------------- 1 | # MdTranslator - minitest of 2 | # reader / sbJson / module_sbJson 3 | 4 | # History: 5 | # Stan Smith 2017-06-19 original script 6 | 7 | require_relative 'sbjson_test_parent' 8 | require 'adiwg/mdtranslator/readers/sbJson/modules/module_sbJson' 9 | 10 | class TestReaderSbJsonSbJson < TestReaderSbJsonParent 11 | 12 | @@NameSpace = ADIWG::Mdtranslator::Readers::SbJson::SbJson 13 | @@hIn = TestReaderSbJsonParent.getJson('sbTabular.json') 14 | 15 | def test_complete_sbJson 16 | 17 | hIn = Marshal::load(Marshal.dump(@@hIn)) 18 | hResponse = Marshal::load(Marshal.dump(@@responseObj)) 19 | 20 | metadata = @@NameSpace.unpack(hIn, hResponse) 21 | 22 | refute_empty metadata 23 | assert hResponse[:readerExecutionPass] 24 | refute_empty hResponse[:readerExecutionMessages] 25 | 26 | end 27 | 28 | end 29 | -------------------------------------------------------------------------------- /test/translator/tc_mdJson_schemaExample.rb: -------------------------------------------------------------------------------- 1 | # MdTranslator - minitest of 2 | # adiwg / mdtranslator / mdReaders / mdJson 3 | 4 | # History: 5 | # Stan Smith 2018-07-31 original script 6 | 7 | require 'minitest/autorun' 8 | require 'rubygems' 9 | require 'adiwg/mdtranslator' 10 | 11 | class TestMdjsonSchemaExample < Minitest::Test 12 | 13 | def test_mdJson_schema_example 14 | 15 | # read in schema example from gem 16 | path = Gem::Specification.find_by_name('adiwg-mdjson_schemas').full_gem_path() 17 | file = File.join(path, 'examples','mdJson.json') 18 | file = File.open(file, 'r') 19 | example = file.read 20 | file.close 21 | 22 | metadata = ADIWG::Mdtranslator.translate(file: example, reader: 'mdJson', validate: 'none') 23 | 24 | refute_empty metadata 25 | assert metadata[:readerStructurePass] 26 | assert_empty metadata[:readerStructureMessages] 27 | assert metadata[:readerValidationPass] 28 | assert_empty metadata[:readerValidationMessages] 29 | 30 | end 31 | 32 | end 33 | 34 | -------------------------------------------------------------------------------- /test/translator/tc_mdReaders.rb: -------------------------------------------------------------------------------- 1 | # MdTranslator - minitest of 2 | # adiwg / mdtranslator / mdReaders 3 | 4 | # History: 5 | # Stan Smith 2016-11-14 original script 6 | 7 | require 'minitest/autorun' 8 | require 'json' 9 | require 'adiwg/mdtranslator' 10 | 11 | class TestMdReaders < Minitest::Test 12 | 13 | # read in an mdJson 2.x file 14 | file = File.join(File.dirname(__FILE__), 'testData', 'mdJson_minimal.json') 15 | file = File.open(file, 'r') 16 | @@jsonObj = file.read 17 | file.close 18 | 19 | def test_mdReaders_invalid_reader 20 | 21 | metadata = ADIWG::Mdtranslator.translate( 22 | file: @@jsonObj, reader: 'xxx', writer: 'html', 23 | validate: 'none', showAllTags: true, cssLink: 'http://example.com/my.css' 24 | ) 25 | 26 | refute_empty metadata 27 | assert_equal 'xxx', metadata[:readerRequested] 28 | refute metadata[:readerValidationPass] 29 | refute_empty metadata[:readerValidationMessages] 30 | 31 | end 32 | 33 | end 34 | 35 | -------------------------------------------------------------------------------- /test/translator/tc_mdWriters.rb: -------------------------------------------------------------------------------- 1 | # MdTranslator - minitest of 2 | # adiwg / mdtranslator / mdWriters 3 | 4 | # History: 5 | # Stan Smith 2016-11-14 original script 6 | 7 | require 'minitest/autorun' 8 | require 'json' 9 | require 'adiwg/mdtranslator' 10 | 11 | class TestMdWriters < Minitest::Test 12 | 13 | # read in an mdJson 2.x file 14 | file = File.join(File.dirname(__FILE__), 'testData', 'mdJson_minimal.json') 15 | file = File.open(file, 'r') 16 | @@jsonObj = file.read 17 | file.close 18 | 19 | def test_mdWriters_invalid_writer 20 | 21 | metadata = ADIWG::Mdtranslator.translate( 22 | file: @@jsonObj, writer: 'xxx' 23 | ) 24 | 25 | refute_empty metadata 26 | assert_equal 'xxx', metadata[:writerRequested] 27 | refute metadata[:writerPass] 28 | refute_empty metadata[:writerMessages] 29 | 30 | end 31 | 32 | end 33 | 34 | -------------------------------------------------------------------------------- /test/translator/tc_translator_roundTrip.rb: -------------------------------------------------------------------------------- 1 | # MdTranslator - minitest of 2 | # adiwg / mdtranslator / mdReaders / fgdc_reader 3 | 4 | # History: 5 | # Stan Smith 2017-08-14 original script 6 | 7 | require 'minitest/autorun' 8 | require 'nokogiri' 9 | require 'adiwg/mdtranslator' 10 | require 'adiwg/mdtranslator/readers/fgdc/version' 11 | 12 | class TestTranslatorRoundTrip < Minitest::Test 13 | 14 | def test_fgdc_demo_to_iso191152 15 | 16 | # read in fgdc demo file 17 | file = File.join(File.dirname(__FILE__), 'testData', 'fgdc_demo.xml') 18 | file = File.open(file, 'r') 19 | demo = file.read 20 | file.close 21 | 22 | metadata = ADIWG::Mdtranslator.translate(file: demo, reader: 'fgdc', writer: 'iso19115_2') 23 | 24 | refute_empty metadata 25 | assert_equal 'fgdc', metadata[:readerRequested] 26 | assert metadata[:readerStructurePass] 27 | assert_empty metadata[:readerStructureMessages] 28 | 29 | end 30 | 31 | end 32 | 33 | -------------------------------------------------------------------------------- /test/translator/testData/fgdc_badForm.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | David Ward 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /test/translator/testData/fgdc_invalid.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | David Ward 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /test/translator/testData/fgdc_minimal.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | David Ward 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/translator/testData/mdJson_invalid.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": { 3 | "name": "mdJson",, 4 | "version": "2.0.0" 5 | }, 6 | "contact": [ 7 | { 8 | "contactId": "CID001", 9 | "isOrganization": false, 10 | "name": "Stan W. Smith" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /test/translator/testData/sbJson_invalid.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": { 3 | "name": "sbJson",, 4 | "version": "2.0.0" 5 | }, 6 | "contact": [ 7 | { 8 | "contactId": "CID001", 9 | "isOrganization": false, 10 | "name": "Stan W. Smith" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /test/writers/dcat_us/tc_dcat_us_contact_point.rb: -------------------------------------------------------------------------------- 1 | require 'minitest/autorun' 2 | require 'json' 3 | require 'adiwg-mdtranslator' 4 | require_relative 'dcat_us_test_parent' 5 | 6 | class TestWriterDcatUsContactPoint < TestWriterDcatUsParent 7 | 8 | # get input JSON for test 9 | @@jsonIn = TestWriterDcatUsParent.getJson('contactPoint.json') 10 | 11 | def test_sample 12 | metadata = ADIWG::Mdtranslator.translate( 13 | file: @@jsonIn, reader: 'mdJson', validate: 'normal', 14 | writer: 'dcat_us', showAllTags: false) 15 | 16 | hJsonOut = JSON.parse(metadata[:writerOutput]) 17 | got = hJsonOut['contactPoint'] 18 | 19 | expect = {"@type"=>"vcard:Contact", "fn"=>"Stan Smith", "hasEmail"=>"e.mail@address.com1"} 20 | 21 | assert_equal expect, got 22 | end 23 | 24 | end 25 | -------------------------------------------------------------------------------- /test/writers/dcat_us/tc_dcat_us_described_by.rb: -------------------------------------------------------------------------------- 1 | require 'minitest/autorun' 2 | require 'json' 3 | require 'adiwg-mdtranslator' 4 | require_relative 'dcat_us_test_parent' 5 | 6 | class TestWriterDcatUsDescribedBy < TestWriterDcatUsParent 7 | 8 | # get input JSON for test 9 | @@jsonIn = TestWriterDcatUsParent.getJson('describedBy.json') 10 | 11 | def test_described_by 12 | metadata = ADIWG::Mdtranslator.translate( 13 | file: @@jsonIn, reader: 'mdJson', validate: 'normal', 14 | writer: 'dcat_us', showAllTags: false) 15 | 16 | hJsonOut = JSON.parse(metadata[:writerOutput]) 17 | got = hJsonOut['describedBy'] 18 | 19 | expect = 'http://adiwg.org/described/by' 20 | 21 | assert_equal expect, got 22 | end 23 | 24 | end 25 | -------------------------------------------------------------------------------- /test/writers/dcat_us/tc_dcat_us_description.rb: -------------------------------------------------------------------------------- 1 | require 'minitest/autorun' 2 | require 'json' 3 | require 'adiwg-mdtranslator' 4 | require_relative 'dcat_us_test_parent' 5 | 6 | class TestWriterDcatUsTitle < TestWriterDcatUsParent 7 | 8 | # get input JSON for test 9 | @@jsonIn = TestWriterDcatUsParent.getJson('description.json') 10 | 11 | def test_title 12 | metadata = ADIWG::Mdtranslator.translate( 13 | file: @@jsonIn, reader: 'mdJson', validate: 'normal', 14 | writer: 'dcat_us', showAllTags: false) 15 | 16 | hJsonOut = JSON.parse(metadata[:writerOutput]) 17 | got = hJsonOut['description'] 18 | 19 | assert_equal 'myBody', got 20 | end 21 | 22 | end 23 | -------------------------------------------------------------------------------- /test/writers/dcat_us/tc_dcat_us_distribution.rb: -------------------------------------------------------------------------------- 1 | require 'minitest/autorun' 2 | require 'json' 3 | require 'adiwg-mdtranslator' 4 | require_relative 'dcat_us_test_parent' 5 | 6 | class TestWriterDcatUsDistribution < TestWriterDcatUsParent 7 | 8 | # get input JSON for test 9 | @@jsonIn = TestWriterDcatUsParent.getJson('distribution.json') 10 | 11 | def test_distribution 12 | metadata = ADIWG::Mdtranslator.translate( 13 | file: @@jsonIn, reader: 'mdJson', validate: 'normal', 14 | writer: 'dcat_us', showAllTags: false) 15 | 16 | hJsonOut = JSON.parse(metadata[:writerOutput]) 17 | got = hJsonOut['distribution'] 18 | 19 | expect = [{"@type"=>"dcat:Distribution", "description"=>"Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore.", "downloadURL"=>"http://ISO.uri/adiwg/0", "mediaType"=>"CSV", "title"=>""}] 20 | 21 | assert_equal expect, got 22 | end 23 | 24 | end 25 | -------------------------------------------------------------------------------- /test/writers/dcat_us/tc_dcat_us_identifier.rb: -------------------------------------------------------------------------------- 1 | require 'minitest/autorun' 2 | require 'json' 3 | require 'adiwg-mdtranslator' 4 | require_relative 'dcat_us_test_parent' 5 | 6 | class TestWriterDcatUsIdentifier < TestWriterDcatUsParent 7 | 8 | # get input JSON for test 9 | @@jsonIn = TestWriterDcatUsParent.getJson('identifier.json') 10 | @@jsonIn2 = TestWriterDcatUsParent.getJson('identifier2.json') 11 | 12 | def test_identifier_namespace 13 | metadata = ADIWG::Mdtranslator.translate( 14 | file: @@jsonIn, reader: 'mdJson', validate: 'normal', 15 | writer: 'dcat_us', showAllTags: false) 16 | 17 | hJsonOut = JSON.parse(metadata[:writerOutput]) 18 | got = hJsonOut['identifier'] 19 | 20 | assert_equal 'http://myOnlineResource-namespace.com', got 21 | end 22 | 23 | def test_identifier_url 24 | metadata = ADIWG::Mdtranslator.translate( 25 | file: @@jsonIn2, reader: 'mdJson', validate: 'normal', 26 | writer: 'dcat_us', showAllTags: false) 27 | 28 | hJsonOut = JSON.parse(metadata[:writerOutput]) 29 | got = hJsonOut['identifier'] 30 | 31 | assert_equal 'http://myOnlineResource-doi.com', got 32 | end 33 | 34 | end 35 | -------------------------------------------------------------------------------- /test/writers/dcat_us/tc_dcat_us_is_part_of.rb: -------------------------------------------------------------------------------- 1 | require 'minitest/autorun' 2 | require 'json' 3 | require 'adiwg-mdtranslator' 4 | require_relative 'dcat_us_test_parent' 5 | 6 | class TestWriterDcatUsIsPartOf < TestWriterDcatUsParent 7 | 8 | # get input JSON for test 9 | @@jsonIn = TestWriterDcatUsParent.getJson('isPartOf.json') 10 | 11 | def test_isPartOf 12 | metadata = ADIWG::Mdtranslator.translate( 13 | file: @@jsonIn, reader: 'mdJson', validate: 'normal', 14 | writer: 'dcat_us', showAllTags: false) 15 | 16 | hJsonOut = JSON.parse(metadata[:writerOutput]) 17 | got = hJsonOut['isPartOf'] 18 | 19 | expect = 'http://ISO.uri/adiwg/0' 20 | 21 | assert_equal expect, got 22 | end 23 | 24 | end 25 | -------------------------------------------------------------------------------- /test/writers/dcat_us/tc_dcat_us_issued.rb: -------------------------------------------------------------------------------- 1 | require 'minitest/autorun' 2 | require 'json' 3 | require 'adiwg-mdtranslator' 4 | require_relative 'dcat_us_test_parent' 5 | 6 | class TestWriterDcatUsIssued < TestWriterDcatUsParent 7 | 8 | # get input JSON for test 9 | @@jsonIn = TestWriterDcatUsParent.getJson('issued.json') 10 | 11 | def test_issued 12 | metadata = ADIWG::Mdtranslator.translate( 13 | file: @@jsonIn, reader: 'mdJson', validate: 'normal', 14 | writer: 'dcat_us', showAllTags: false) 15 | 16 | hJsonOut = JSON.parse(metadata[:writerOutput]) 17 | got = hJsonOut['issued'] 18 | 19 | expect = '2017-06-13T00:00:00+00:00' 20 | 21 | assert_equal expect, got 22 | end 23 | 24 | end 25 | -------------------------------------------------------------------------------- /test/writers/dcat_us/tc_dcat_us_keyword.rb: -------------------------------------------------------------------------------- 1 | require 'minitest/autorun' 2 | require 'json' 3 | require 'adiwg-mdtranslator' 4 | require_relative 'dcat_us_test_parent' 5 | 6 | class TestWriterDcatUsKeyword < TestWriterDcatUsParent 7 | 8 | # get input JSON for test 9 | @@jsonIn = TestWriterDcatUsParent.getJson('keyword.json') 10 | 11 | def test_keyword 12 | metadata = ADIWG::Mdtranslator.translate( 13 | file: @@jsonIn, reader: 'mdJson', validate: 'normal', 14 | writer: 'dcat_us', showAllTags: false) 15 | 16 | hJsonOut = JSON.parse(metadata[:writerOutput]) 17 | got = hJsonOut['keyword'] 18 | 19 | expect = ["Barrow", "Prudhoe Bay", "Kaparuk", "Brown Bear", "Polar Bear", "Black Bear", "Cinnamon Bear", "Teddy Bear", "butter", "sugar", "eggs", "inlandWaters", "location", "climatologyMeteorologyAtmosphere", "carbon dating", "ionization"] 20 | 21 | assert_equal expect, got 22 | end 23 | 24 | end 25 | -------------------------------------------------------------------------------- /test/writers/dcat_us/tc_dcat_us_landing_page.rb: -------------------------------------------------------------------------------- 1 | require 'minitest/autorun' 2 | require 'json' 3 | require 'adiwg-mdtranslator' 4 | require_relative 'dcat_us_test_parent' 5 | 6 | class TestWriterDcatUsLandingPage < TestWriterDcatUsParent 7 | 8 | # get input JSON for test 9 | @@jsonIn = TestWriterDcatUsParent.getJson('landingPage.json') 10 | 11 | def test_landingPage 12 | metadata = ADIWG::Mdtranslator.translate( 13 | file: @@jsonIn, reader: 'mdJson', validate: 'normal', 14 | writer: 'dcat_us', showAllTags: false) 15 | 16 | hJsonOut = JSON.parse(metadata[:writerOutput]) 17 | got = hJsonOut['landingPage'] 18 | 19 | expect = 'http://ISO.uri/adiwg/0' 20 | 21 | assert_equal expect, got 22 | end 23 | 24 | end 25 | -------------------------------------------------------------------------------- /test/writers/dcat_us/tc_dcat_us_license.rb: -------------------------------------------------------------------------------- 1 | require 'minitest/autorun' 2 | require 'json' 3 | require 'adiwg-mdtranslator' 4 | require_relative 'dcat_us_test_parent' 5 | 6 | class TestWriterDcatUsLicense < TestWriterDcatUsParent 7 | 8 | # get input JSON for test 9 | @@jsonIn = TestWriterDcatUsParent.getJson('license.json') 10 | 11 | def test_license 12 | metadata = ADIWG::Mdtranslator.translate( 13 | file: @@jsonIn, reader: 'mdJson', validate: 'normal', 14 | writer: 'dcat_us', showAllTags: false) 15 | 16 | hJsonOut = JSON.parse(metadata[:writerOutput]) 17 | got = hJsonOut['license'] 18 | 19 | expect = 'title0' 20 | 21 | assert_equal expect, got 22 | end 23 | 24 | end 25 | -------------------------------------------------------------------------------- /test/writers/dcat_us/tc_dcat_us_modified.rb: -------------------------------------------------------------------------------- 1 | require 'minitest/autorun' 2 | require 'json' 3 | require 'adiwg-mdtranslator' 4 | require_relative 'dcat_us_test_parent' 5 | 6 | class TestWriterDcatUsModified < TestWriterDcatUsParent 7 | 8 | # get input JSON for test 9 | @@jsonIn = TestWriterDcatUsParent.getJson('modified.json') 10 | @@jsonIn2 = TestWriterDcatUsParent.getJson('modified2.json') 11 | 12 | def test_modified_basic 13 | metadata = ADIWG::Mdtranslator.translate( 14 | file: @@jsonIn, reader: 'mdJson', validate: 'normal', 15 | writer: 'dcat_us', showAllTags: false) 16 | 17 | hJsonOut = JSON.parse(metadata[:writerOutput]) 18 | got = hJsonOut['modified'] 19 | 20 | assert_equal '2017-06-22T16:15:14+00:00', got 21 | end 22 | 23 | def test_modified_out_of_order 24 | metadata = ADIWG::Mdtranslator.translate( 25 | file: @@jsonIn2, reader: 'mdJson', validate: 'normal', 26 | writer: 'dcat_us', showAllTags: false) 27 | 28 | hJsonOut = JSON.parse(metadata[:writerOutput]) 29 | got = hJsonOut['modified'] 30 | 31 | assert_equal '2022-06-22T16:15:14+00:00', got 32 | end 33 | 34 | end 35 | -------------------------------------------------------------------------------- /test/writers/dcat_us/tc_dcat_us_references.rb: -------------------------------------------------------------------------------- 1 | require 'minitest/autorun' 2 | require 'json' 3 | require 'adiwg-mdtranslator' 4 | require_relative 'dcat_us_test_parent' 5 | 6 | class TestWriterDcatUsReferences < TestWriterDcatUsParent 7 | 8 | # get input JSON for test 9 | @@jsonIn = TestWriterDcatUsParent.getJson('references.json') 10 | 11 | def test_references 12 | metadata = ADIWG::Mdtranslator.translate( 13 | file: @@jsonIn, reader: 'mdJson', validate: 'normal', 14 | writer: 'dcat_us', showAllTags: false) 15 | 16 | hJsonOut = JSON.parse(metadata[:writerOutput]) 17 | got = hJsonOut['references'] 18 | 19 | expect = 'http://ISO.uri/adiwg/0,http://ISO.uri/adiwg/1,http://ISO.uri/adiwg/2,http://ISO.uri/adiwg/3,http://ISO.uri/adiwg/4,http://ISO.uri/adiwg/5,http://ISO.uri/adiwg/6,http://ISO.uri/adiwg/7,http://ISO.uri/adiwg/8,http://ISO.uri/adiwg/9,http://ISO.uri/adiwg/10,http://ISO.uri/adiwg/11' 20 | 21 | assert_equal expect, got 22 | end 23 | 24 | end 25 | -------------------------------------------------------------------------------- /test/writers/dcat_us/tc_dcat_us_rights.rb: -------------------------------------------------------------------------------- 1 | require 'minitest/autorun' 2 | require 'json' 3 | require 'adiwg-mdtranslator' 4 | require_relative 'dcat_us_test_parent' 5 | 6 | class TestWriterDcatUsRights < TestWriterDcatUsParent 7 | 8 | # get input JSON for test 9 | @@jsonIn = TestWriterDcatUsParent.getJson('rights.json') 10 | 11 | def test_rights 12 | metadata = ADIWG::Mdtranslator.translate( 13 | file: @@jsonIn, reader: 'mdJson', validate: 'normal', 14 | writer: 'dcat_us', showAllTags: false) 15 | 16 | hJsonOut = JSON.parse(metadata[:writerOutput]) 17 | got = hJsonOut['rights'] 18 | 19 | expect = 'Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. restricted unrestricted' 20 | 21 | assert_equal expect, got 22 | end 23 | 24 | end 25 | -------------------------------------------------------------------------------- /test/writers/dcat_us/tc_dcat_us_spatial.rb: -------------------------------------------------------------------------------- 1 | require 'minitest/autorun' 2 | require 'json' 3 | require 'adiwg-mdtranslator' 4 | require_relative 'dcat_us_test_parent' 5 | 6 | class TestWriterDcatUsSpatial < TestWriterDcatUsParent 7 | 8 | # get input JSON for test 9 | @@jsonIn = TestWriterDcatUsParent.getJson('spatial.json') 10 | 11 | def test_spatial 12 | metadata = ADIWG::Mdtranslator.translate( 13 | file: @@jsonIn, reader: 'mdJson', validate: 'normal', 14 | writer: 'dcat_us', showAllTags: false) 15 | 16 | hJsonOut = JSON.parse(metadata[:writerOutput]) 17 | got = hJsonOut['spatial'] 18 | 19 | expect = '-120.0,49.0,-140.0,70.0' 20 | 21 | assert_equal expect, got 22 | end 23 | 24 | end 25 | -------------------------------------------------------------------------------- /test/writers/dcat_us/tc_dcat_us_system_of_records.rb: -------------------------------------------------------------------------------- 1 | require 'minitest/autorun' 2 | require 'json' 3 | require 'adiwg-mdtranslator' 4 | require_relative 'dcat_us_test_parent' 5 | 6 | class TestWriterDcatUsSystemOfRecords < TestWriterDcatUsParent 7 | 8 | # get input JSON for test 9 | @@jsonIn = TestWriterDcatUsParent.getJson('systemOfRecords.json') 10 | 11 | def test_system_of_records 12 | metadata = ADIWG::Mdtranslator.translate( 13 | file: @@jsonIn, reader: 'mdJson', validate: 'normal', 14 | writer: 'dcat_us', showAllTags: false) 15 | 16 | hJsonOut = JSON.parse(metadata[:writerOutput]) 17 | got = hJsonOut['systemOfRecords'] 18 | 19 | expect = 'http://ISO.uri/adiwg/0' 20 | 21 | assert_equal expect, got 22 | end 23 | 24 | end 25 | -------------------------------------------------------------------------------- /test/writers/dcat_us/tc_dcat_us_temporal.rb: -------------------------------------------------------------------------------- 1 | require 'minitest/autorun' 2 | require 'json' 3 | require 'adiwg-mdtranslator' 4 | require_relative 'dcat_us_test_parent' 5 | 6 | class TestWriterDcatUsTemporal < TestWriterDcatUsParent 7 | 8 | # get input JSON for test 9 | @@jsonIn = TestWriterDcatUsParent.getJson('temporal.json') 10 | 11 | def test_Temporal 12 | metadata = ADIWG::Mdtranslator.translate( 13 | file: @@jsonIn, reader: 'mdJson', validate: 'normal', 14 | writer: 'dcat_us', showAllTags: false) 15 | 16 | hJsonOut = JSON.parse(metadata[:writerOutput]) 17 | got = hJsonOut['temporal'] 18 | 19 | expect = '2016-10-24T11:10:15-10:00' 20 | 21 | assert_equal expect, got 22 | end 23 | 24 | end 25 | -------------------------------------------------------------------------------- /test/writers/dcat_us/tc_dcat_us_theme.rb: -------------------------------------------------------------------------------- 1 | require 'minitest/autorun' 2 | require 'json' 3 | require 'adiwg-mdtranslator' 4 | require_relative 'dcat_us_test_parent' 5 | 6 | class TestWriterDcatUsTheme < TestWriterDcatUsParent 7 | 8 | # get input JSON for test 9 | @@jsonIn = TestWriterDcatUsParent.getJson('theme.json') 10 | 11 | def test_theme 12 | metadata = ADIWG::Mdtranslator.translate( 13 | file: @@jsonIn, reader: 'mdJson', validate: 'normal', 14 | writer: 'dcat_us', showAllTags: false) 15 | 16 | hJsonOut = JSON.parse(metadata[:writerOutput]) 17 | got = hJsonOut['theme'] 18 | 19 | expect = 'inlandWaters location climatologyMeteorologyAtmosphere' 20 | 21 | assert_equal expect, got 22 | end 23 | 24 | end 25 | -------------------------------------------------------------------------------- /test/writers/dcat_us/tc_dcat_us_title.rb: -------------------------------------------------------------------------------- 1 | require 'minitest/autorun' 2 | require 'json' 3 | require 'adiwg-mdtranslator' 4 | require_relative 'dcat_us_test_parent' 5 | 6 | class TestWriterDcatUsTitle < TestWriterDcatUsParent 7 | 8 | # get input JSON for test 9 | @@jsonIn = TestWriterDcatUsParent.getJson('title.json') 10 | 11 | def test_title 12 | metadata = ADIWG::Mdtranslator.translate( 13 | file: @@jsonIn, reader: 'mdJson', validate: 'normal', 14 | writer: 'dcat_us', showAllTags: false) 15 | 16 | hJsonOut = JSON.parse(metadata[:writerOutput]) 17 | got = hJsonOut['title'] 18 | 19 | assert_equal 'myCitationTitle', got 20 | end 21 | 22 | end 23 | -------------------------------------------------------------------------------- /test/writers/fgdc/tc_geographicResolution.rb: -------------------------------------------------------------------------------- 1 | # MdTranslator - minitest of 2 | # writers / fgdc / class_geographicResolution 3 | 4 | # History: 5 | # Stan Smith 2017-12-29 original script 6 | 7 | require_relative 'fgdc_test_parent' 8 | require_relative '../../helpers/mdJson_hash_objects' 9 | require_relative '../../helpers/mdJson_hash_functions' 10 | 11 | class TestWriterFgdcGeographicResolution < TestWriterFGDCParent 12 | 13 | # instance classes needed in script 14 | TDClass = MdJsonHashWriter.new 15 | 16 | # build mdJson test file in hash 17 | mdHash = TDClass.base 18 | 19 | # geographic resolution 20 | mdHash[:metadata][:resourceInfo][:spatialResolution] = [] 21 | mdHash[:metadata][:resourceInfo][:spatialResolution] << TDClass.build_geographicResolution 22 | 23 | @@mdHash = mdHash 24 | 25 | def test_geographicResolution_complete 26 | 27 | hReturn = TestWriterFGDCParent.get_complete(@@mdHash, 'geographicResolution', './metadata/spref/horizsys/geograph') 28 | assert_equal hReturn[0], hReturn[1] 29 | assert hReturn[2] 30 | 31 | end 32 | 33 | end 34 | -------------------------------------------------------------------------------- /test/writers/fgdc/tc_quality.rb: -------------------------------------------------------------------------------- 1 | # MdTranslator - minitest of 2 | # writers / fgdc / class_quality 3 | 4 | # History: 5 | # Stan Smith 2018-03-23 original script 6 | 7 | require_relative 'fgdc_test_parent' 8 | require_relative '../../helpers/mdJson_hash_objects' 9 | require_relative '../../helpers/mdJson_hash_functions' 10 | 11 | class TestWriterFgdcQuality < TestWriterFGDCParent 12 | 13 | # instance classes needed in script 14 | TDClass = MdJsonHashWriter.new 15 | 16 | # build mdJson test file in hash 17 | mdHash = TDClass.base 18 | 19 | # build lineage 20 | hLineage = TDClass.lineage 21 | mdHash[:metadata][:resourceLineage] = [] 22 | mdHash[:metadata][:resourceLineage] << hLineage 23 | mdHash[:metadata][:dataQuality] << TDClass.dataQuality 24 | 25 | # require 'pry'; binding.pry 26 | 27 | @@mdHash = mdHash 28 | 29 | def test_quality_complete 30 | 31 | hReturn = TestWriterFGDCParent.get_complete(@@mdHash, 'quality', './metadata/dataqual') 32 | assert_equal hReturn[0], hReturn[1] 33 | refute hReturn[2] 34 | 35 | end 36 | 37 | end 38 | -------------------------------------------------------------------------------- /test/writers/fgdc/testData/browse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | graphic name one 6 | description 7 | type 8 | 9 | 10 | graphic name two 11 | description 12 | type 13 | 14 | 15 | -------------------------------------------------------------------------------- /test/writers/fgdc/testData/constraint.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | access constraint 5 | use constraint 6 | 7 | -------------------------------------------------------------------------------- /test/writers/fgdc/testData/description.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | abstract 6 | purpose 7 | supplemental information 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/writers/fgdc/testData/geodeticReference.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | datum name 7 | ellipsoid name 8 | 9999.9 9 | 999.9 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /test/writers/fgdc/testData/geographicResolution.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 99.9 7 | 9.9 8 | unit 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /test/writers/fgdc/testData/localSystem.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | local description 7 | local georeference 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /test/writers/fgdc/testData/mapLocal.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | local description 8 | local georeference 9 | 10 | 11 | feet 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /test/writers/fgdc/testData/mapPlanarInfo.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | planar coordinate encoding method 8 | 9 | 9.99 10 | 9.99 11 | 12 | unit of measure 13 | 14 | 15 | 16 | 17 | planar coordinate encoding method 18 | 19 | 9.99 20 | 9.99 21 | bearing units 22 | bearing direction 23 | bearing meridian 24 | 25 | unit of measure 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /test/writers/fgdc/testData/publisher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | person name 7 | 2017-11-20 8 | citation title 9 | 10 | city, administrative area, country 11 | person name 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /test/writers/fgdc/testData/quality.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Not Reported 5 | Not Reported 6 | Not Reported 7 | Not Reported 8 | 9 | 10 | statement 11 | statement 12 | 13 | 14 | person name three 15 | 20171122 16 | 17 | citation title 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | missing 30 | 31 | Not Reported 32 | 33 | 34 | -------------------------------------------------------------------------------- /test/writers/fgdc/testData/security.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | security system name 6 | classification 7 | handling instructions 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/writers/fgdc/testData/series.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | person name 7 | 2017-11-20 8 | citation title 9 | 10 | series name 11 | series issue 12 | 13 | 14 | city, administrative area, country 15 | person name 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /test/writers/fgdc/testData/status.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | status 1 6 | resource maintenance frequency 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /test/writers/fgdc/testData/timePeriod.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | person name 7 | 20171122 8 | title 9 | 10 | 11 | 12 | abstract 13 | purpose 14 | 15 | 16 | 17 | 18 | 20171123 19 | 10:42:50 20 | 20171123 21 | 17:19:58 22 | 23 | 24 | resource time period 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /test/writers/fgdc/testData/verticalDatum.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | altitude datum name 7 | 9.99 8 | unit of measure 9 | encoding method 10 | 11 | 12 | depth datum name 13 | 9.99 14 | unit of measure 15 | encoding method 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /test/writers/html/tc_html_document.rb: -------------------------------------------------------------------------------- 1 | # html 2.0 writer tests - document 2 | 3 | # History: 4 | # Stan Smith 2017-03-22 original script 5 | 6 | require 'minitest/autorun' 7 | require 'json' 8 | require 'adiwg-mdtranslator' 9 | 10 | class TestHtmlDocument < Minitest::Test 11 | 12 | # get input JSON for test 13 | fname = File.join(File.dirname(__FILE__), 'testData', 'metadataGeo.json') 14 | file = File.open(fname, 'r') 15 | @@mdJson = file.read 16 | file.close 17 | 18 | def test_complete_document 19 | 20 | metadata = ADIWG::Mdtranslator.translate( 21 | file: @@mdJson, reader: 'mdJson', validate: 'none', writer: 'html', showAllTags: false) 22 | 23 | got = metadata[:writerOutput] 24 | 25 | refute_empty got 26 | 27 | end 28 | 29 | end 30 | -------------------------------------------------------------------------------- /test/writers/iso19115-2/tc_19115_2_boundingBox.rb: -------------------------------------------------------------------------------- 1 | # MdTranslator - minitest of 2 | # writers / iso19115_2 / class_boundingBox 3 | 4 | # History: 5 | # Stan Smith 2018-04-17 refactored for error messaging 6 | # Stan Smith 2017-11-18 replace REXML with Nokogiri 7 | # Stan Smith 2016-12-19 original script 8 | 9 | require_relative '../../helpers/mdJson_hash_objects' 10 | require_relative '../../helpers/mdJson_hash_functions' 11 | require_relative 'iso19115_2_test_parent' 12 | 13 | class TestWriter191152BoundingBox < TestWriter191152Parent 14 | 15 | # instance classes needed in script 16 | TDClass = MdJsonHashWriter.new 17 | 18 | # build mdJson test file in hash 19 | mdHash = TDClass.base 20 | 21 | @@mdHash = mdHash 22 | 23 | def test_boundingBox_complete 24 | 25 | hIn = Marshal::load(Marshal.dump(@@mdHash)) 26 | 27 | hReturn = TestWriter191152Parent.run_test(hIn, '19115_2_boundingBox', 28 | '//gmd:geographicElement[1]', 29 | '//gmd:geographicElement', 0) 30 | 31 | assert_equal hReturn[0], hReturn[1] 32 | assert hReturn[2] 33 | assert_empty hReturn[3] 34 | 35 | end 36 | 37 | end 38 | -------------------------------------------------------------------------------- /test/writers/iso19115-2/testData/19115_2_metadataDate.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 2018-01-26 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /test/writers/iso19115-3/tc_19115_3_boundingBox.rb: -------------------------------------------------------------------------------- 1 | # MdTranslator - minitest of 2 | # writers / iso19115_3 / class_boundingBox 3 | 4 | # History: 5 | # Stan Smith 2019-04-17 original script 6 | 7 | require_relative '../../helpers/mdJson_hash_objects' 8 | require_relative '../../helpers/mdJson_hash_functions' 9 | require_relative 'iso19115_3_test_parent' 10 | 11 | class TestWriter191151BoundingBox < TestWriter191151Parent 12 | 13 | # instance classes needed in script 14 | TDClass = MdJsonHashWriter.new 15 | 16 | # build mdJson test file in hash 17 | mdHash = TDClass.base 18 | 19 | @@mdHash = mdHash 20 | 21 | def test_boundingBox_complete 22 | 23 | hIn = Marshal::load(Marshal.dump(@@mdHash)) 24 | 25 | hReturn = TestWriter191151Parent.run_test(hIn, '19115_3_boundingBox', 26 | '//gex:geographicElement[1]', 27 | '//gex:geographicElement', 0) 28 | 29 | assert_equal hReturn[0], hReturn[1] 30 | assert hReturn[2] 31 | assert_empty hReturn[3] 32 | 33 | end 34 | 35 | end 36 | -------------------------------------------------------------------------------- /test/writers/iso19115-3/tc_19115_3_spatialRepresentation_scope.rb: -------------------------------------------------------------------------------- 1 | # MdTranslator - minitest of 2 | # writers / iso19115_3 / class_spatialRepresentation_scope 3 | 4 | require_relative '../../helpers/mdJson_hash_objects' 5 | require_relative '../../helpers/mdJson_hash_functions' 6 | require_relative 'iso19115_3_test_parent' 7 | 8 | class TestWriter191151SpatialRepresentationScope < TestWriter191151Parent 9 | 10 | # instance classes needed in script 11 | TDClass = MdJsonHashWriter.new 12 | 13 | # build mdJson test file in hash 14 | mdHash = TDClass.base 15 | 16 | mdHash[:metadata][:resourceInfo][:spatialRepresentation] = TDClass.build_spatialRepresentation_with_scope 17 | 18 | @@mdHash = mdHash 19 | 20 | 21 | 22 | def test_spatialRepresentation_grid_scope 23 | hIn = Marshal::load(Marshal.dump(@@mdHash)) 24 | 25 | hReturn = TestWriter191151Parent.run_test(hIn, '19115_3_spatialRepresentation_scope', 26 | '//mdb:spatialRepresentationInfo[1]', 27 | '//mdb:spatialRepresentationInfo', 0) 28 | 29 | assert_equal hReturn[0], hReturn[1] 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /test/writers/mdJson/tc_mdjson_dataQuality.rb: -------------------------------------------------------------------------------- 1 | require 'adiwg-mdtranslator' 2 | require_relative '../../helpers/mdJson_hash_objects' 3 | require_relative '../../helpers/mdJson_hash_functions' 4 | require_relative 'mdjson_test_parent' 5 | 6 | class TestWriterMdJsonDataQuality < TestWriterMdJsonParent 7 | TDClass = MdJsonHashWriter.new 8 | 9 | mdHash = TDClass.base 10 | 11 | # data quality [] 12 | mdHash[:metadata][:dataQuality] = [] 13 | mdHash[:metadata][:dataQuality] << TDClass.build_dataQuality 14 | mdHash[:metadata][:dataQuality] << TDClass.build_dataQuality 15 | 16 | @@mdHash = mdHash 17 | 18 | def test_schema_dataQuality 19 | hTest = @@mdHash[:metadata][:dataQuality][0] 20 | errors = TestWriterMdJsonParent.testSchema(hTest, 'dataQuality.json') 21 | 22 | assert_empty errors 23 | end 24 | 25 | def test_schema_conformanceResult 26 | hTest = @@mdHash[:metadata][:dataQuality][0][:report][0][:conformanceResult][0] 27 | errors = TestWriterMdJsonParent.testSchema(hTest, 'conformanceResult.json') 28 | 29 | assert_empty errors 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /test/writers/mdJson/tc_mdjson_keywordObject.rb: -------------------------------------------------------------------------------- 1 | # mdJson 2.0 writer tests - keyword object 2 | 3 | # History: 4 | # Stan Smith 2018-06-06 refactor to use mdJson construction helpers 5 | # Stan Smith 2017-03-18 original script 6 | 7 | require 'adiwg-mdtranslator' 8 | require_relative '../../helpers/mdJson_hash_objects' 9 | require_relative '../../helpers/mdJson_hash_functions' 10 | require_relative 'mdjson_test_parent' 11 | 12 | class TestWriterMdJsonKeywordObject < TestWriterMdJsonParent 13 | 14 | # instance classes needed in script 15 | TDClass = MdJsonHashWriter.new 16 | 17 | # build mdJson test file in hash 18 | mdHash = TDClass.base 19 | 20 | @@mdHash = mdHash 21 | 22 | def test_schema_keywordObject 23 | 24 | hTest = @@mdHash[:metadata][:resourceInfo][:keyword][0][:keyword][0] 25 | errors = TestWriterMdJsonParent.testSchema(hTest, 'keyword.json', :fragment=>'keywordObject') 26 | assert_empty errors 27 | 28 | end 29 | 30 | end 31 | -------------------------------------------------------------------------------- /test/writers/sbJson/tc_sbjson_browseCategory.rb: -------------------------------------------------------------------------------- 1 | # sbJson 1 writer tests - browse categories 2 | 3 | # History: 4 | # Stan Smith 2017-05-31 original script 5 | 6 | require 'minitest/autorun' 7 | require 'json' 8 | require 'adiwg-mdtranslator' 9 | require_relative 'sbjson_test_parent' 10 | 11 | class TestWriterSbJsonBrowseCategory < TestWriterSbJsonParent 12 | 13 | # get input JSON for test 14 | @@jsonIn = TestWriterSbJsonParent.getJson('browseCategory.json') 15 | 16 | def test_browseCategories 17 | 18 | metadata = ADIWG::Mdtranslator.translate( 19 | file: @@jsonIn, reader: 'mdJson', validate: 'normal', 20 | writer: 'sbJson', showAllTags: false) 21 | 22 | expect = ['Data', 'Document', 'Collection', 'Project', 'Image', 'Report', 'Physical Item'] 23 | 24 | hJsonOut = JSON.parse(metadata[:writerOutput]) 25 | got = hJsonOut['browseCategories'] 26 | 27 | assert_equal expect, got 28 | 29 | end 30 | 31 | end 32 | 33 | 34 | -------------------------------------------------------------------------------- /test/writers/sbJson/tc_sbjson_citation.rb: -------------------------------------------------------------------------------- 1 | # sbJson 1 writer tests - citation 2 | 3 | # History: 4 | # Stan Smith 2017-05-16 original script 5 | 6 | require 'minitest/autorun' 7 | require 'json' 8 | require 'adiwg-mdtranslator' 9 | require_relative 'sbjson_test_parent' 10 | 11 | class TestWriterSbJsonCitation < TestWriterSbJsonParent 12 | 13 | # get input JSON for test 14 | @@jsonIn = TestWriterSbJsonParent.getJson('citation.json') 15 | 16 | def test_citation 17 | 18 | metadata = ADIWG::Mdtranslator.translate( 19 | file: @@jsonIn, reader: 'mdJson', validate: 'normal', 20 | writer: 'sbJson', showAllTags: false) 21 | 22 | expect = 'Person 001, myCitationTitle' 23 | hJsonOut = JSON.parse(metadata[:writerOutput]) 24 | got = hJsonOut['citation'] 25 | 26 | assert_equal expect, got 27 | 28 | end 29 | 30 | end 31 | -------------------------------------------------------------------------------- /test/writers/sbJson/tc_sbjson_geographicExtent.rb: -------------------------------------------------------------------------------- 1 | # sbJson 1 writer tests - geographic extent 2 | 3 | # History: 4 | # Stan Smith 2017-06-06 original script 5 | 6 | require 'minitest/autorun' 7 | require 'json' 8 | require 'adiwg-mdtranslator' 9 | require_relative 'sbjson_test_parent' 10 | 11 | class TestWriterSbJsonGeographicExtent < TestWriterSbJsonParent 12 | 13 | # get input JSON for test 14 | @@jsonIn = TestWriterSbJsonParent.getJson('geographicExtent.json') 15 | 16 | def test_geographicExtent 17 | 18 | metadata = ADIWG::Mdtranslator.translate( 19 | file: @@jsonIn, reader: 'mdJson', validate: 'normal', 20 | writer: 'sbJson', showAllTags: false) 21 | 22 | hJsonOut = JSON.parse(metadata[:writerOutput]) 23 | got = hJsonOut['geographicExtents'] 24 | 25 | assert_equal 5, got.length 26 | 27 | end 28 | 29 | end 30 | 31 | 32 | -------------------------------------------------------------------------------- /test/writers/sbJson/tc_sbjson_materialRequest.rb: -------------------------------------------------------------------------------- 1 | # sbJson 1 writer tests - material request instructions 2 | 3 | # History: 4 | # Stan Smith 2017-05-25 original script 5 | 6 | require 'minitest/autorun' 7 | require 'json' 8 | require 'adiwg-mdtranslator' 9 | require_relative 'sbjson_test_parent' 10 | 11 | class TestWriterSbJsonMaterialRequest < TestWriterSbJsonParent 12 | 13 | # get input JSON for test 14 | @@jsonIn = TestWriterSbJsonParent.getJson('materialRequest.json') 15 | 16 | def test_materialRequest 17 | 18 | metadata = ADIWG::Mdtranslator.translate( 19 | file: @@jsonIn, reader: 'mdJson', validate: 'normal', 20 | writer: 'sbJson', showAllTags: false) 21 | 22 | hJsonOut = JSON.parse(metadata[:writerOutput]) 23 | 24 | got = hJsonOut['materialRequestInstructions'] 25 | expect = 'Person 1(userRole - Instruction set 1); Organization 1(Distributor - Instruction set 3); Organization 2(Distributor - Instruction set 3); Organization 2(SoftwareEngineer)' 26 | 27 | assert_equal expect, got 28 | 29 | end 30 | 31 | end 32 | 33 | 34 | -------------------------------------------------------------------------------- /test/writers/sbJson/tc_sbjson_parentId.rb: -------------------------------------------------------------------------------- 1 | # sbJson 1 writer tests - parent identifier 2 | 3 | # History: 4 | # Stan Smith 2017-05-25 original script 5 | 6 | require 'minitest/autorun' 7 | require 'json' 8 | require 'adiwg-mdtranslator' 9 | require_relative 'sbjson_test_parent' 10 | 11 | class TestWriterSbJsonParentId < TestWriterSbJsonParent 12 | 13 | # get input JSON for test 14 | @@jsonIn = TestWriterSbJsonParent.getJson('parentId.json') 15 | 16 | def test_parentIdentifier 17 | 18 | metadata = ADIWG::Mdtranslator.translate( 19 | file: @@jsonIn, reader: 'mdJson', validate: 'normal', 20 | writer: 'sbJson', showAllTags: false) 21 | 22 | hJsonOut = JSON.parse(metadata[:writerOutput]) 23 | 24 | got = hJsonOut['parentId'] 25 | expect = '1866dd77-d40c-4a0d-8589-cf6d0dec3ee4' 26 | 27 | assert_equal expect, got 28 | 29 | end 30 | 31 | end 32 | 33 | 34 | -------------------------------------------------------------------------------- /test/writers/sbJson/tc_sbjson_provenance.rb: -------------------------------------------------------------------------------- 1 | # sbJson 1 writer tests - provenance 2 | 3 | # History: 4 | # Stan Smith 2017-05-23 original script 5 | 6 | require 'minitest/autorun' 7 | require 'json' 8 | require 'adiwg-mdtranslator' 9 | require_relative 'sbjson_test_parent' 10 | 11 | class TestWriterSbJsonProvenance < TestWriterSbJsonParent 12 | 13 | # get input JSON for test 14 | @@jsonIn = TestWriterSbJsonParent.getJson('provenance.json') 15 | 16 | def test_provenance 17 | 18 | metadata = ADIWG::Mdtranslator.translate( 19 | file: @@jsonIn, reader: 'mdJson', validate: 'normal', 20 | writer: 'sbJson', showAllTags: false) 21 | 22 | hJsonOut = JSON.parse(metadata[:writerOutput]) 23 | got = hJsonOut['provenance'] 24 | version = ADIWG::Mdtranslator::VERSION 25 | expect = { 26 | 'annotation' => 'generated using ADIwg mdTranslator ' + version, 27 | } 28 | 29 | assert_equal expect, got 30 | 31 | end 32 | 33 | end 34 | 35 | 36 | -------------------------------------------------------------------------------- /test/writers/sbJson/tc_sbjson_spatial.rb: -------------------------------------------------------------------------------- 1 | # sbJson 1 writer tests - spatial 2 | 3 | # History: 4 | # Stan Smith 2017-06-01 original script 5 | 6 | require 'minitest/autorun' 7 | require 'json' 8 | require 'adiwg-mdtranslator' 9 | require_relative 'sbjson_test_parent' 10 | 11 | class TestWriterSbJsonSpatial < TestWriterSbJsonParent 12 | 13 | # get input JSON for test 14 | @@jsonIn = TestWriterSbJsonParent.getJson('spatial.json') 15 | 16 | def test_boundingBox 17 | 18 | metadata = ADIWG::Mdtranslator.translate( 19 | file: @@jsonIn, reader: 'mdJson', validate: 'normal', 20 | writer: 'sbJson', showAllTags: false) 21 | 22 | expect = { 23 | 'boundingBox' => { 24 | 'maxY' =>67.663378, 25 | 'minY' =>-20.0, 26 | 'maxX' =>-80.0, 27 | 'minX' =>160.0 28 | } 29 | } 30 | 31 | hJsonOut = JSON.parse(metadata[:writerOutput]) 32 | got = hJsonOut['spatial'] 33 | 34 | assert_equal expect, got 35 | 36 | end 37 | 38 | end 39 | 40 | 41 | -------------------------------------------------------------------------------- /test/writers/simple_html/tc_simple_html_document.rb: -------------------------------------------------------------------------------- 1 | require 'minitest/autorun' 2 | require 'json' 3 | require 'adiwg-mdtranslator' 4 | 5 | class TestSimpleHtmlDocument < Minitest::Test 6 | 7 | # get input JSON for test 8 | fname = File.join(File.dirname(__FILE__), 'testData', 'metadataGeo.json') 9 | file = File.open(fname, 'r') 10 | @@mdJson = file.read 11 | file.close 12 | 13 | def test_complete_document 14 | 15 | metadata = ADIWG::Mdtranslator.translate( 16 | file: @@mdJson, reader: 'mdJson', validate: 'none', writer: 'simple_html', showAllTags: false) 17 | 18 | got = metadata[:writerOutput] 19 | 20 | refute_empty got 21 | 22 | end 23 | 24 | end 25 | -------------------------------------------------------------------------------- /version.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.21.0" 3 | } 4 | --------------------------------------------------------------------------------