adiwg-mdtranslator 0.12.1 → 1.0.0rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -1
- data/.gitmodules +3 -3
- data/Rakefile +1 -1
- data/adiwg-mdtranslator.gemspec +3 -3
- data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +5 -1
- data/lib/adiwg/mdtranslator/readers/mdJson/mdJson_validator.rb +2 -2
- data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_entity.rb +9 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_entityAttribute.rb +9 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_mdJson.rb +7 -2
- data/lib/adiwg/mdtranslator/readers/mdJson/readme.md +2 -2
- data/lib/adiwg/mdtranslator/version.rb +5 -1
- data/lib/adiwg/mdtranslator/writers/html/html_writer.rb +43 -0
- data/lib/adiwg/mdtranslator/writers/html/md_html_writer.rb +25 -0
- data/lib/adiwg/mdtranslator/writers/html/readme.md +10 -0
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_aggregateInformation.rb +3 -3
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_boundingPolygon.rb +4 -4
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_citation.rb +4 -4
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_contact.rb +3 -3
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_dataIdentification.rb +17 -17
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_dataQuality.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_date.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_digitalTransferOptions.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_distribution.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_distributor.rb +4 -4
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_extent.rb +4 -4
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_featureAttribute.rb +3 -3
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_featureType.rb +11 -2
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_genericMetaData.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_geographicDescription.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_geographicElement.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_identifier.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_keyword.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_legalConstraints.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_lineage.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_maintenanceInformation.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_medium.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_metadataExtension.rb +4 -4
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_multiGeometry.rb +3 -3
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_onlineResource.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_processStep.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_referenceSystem.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_responsibleParty.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_securityConstraints.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_source.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_taxonSystem.rb +4 -4
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_temporalExtent.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_usage.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_vouchers.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/iso19110/class_FCfeatureCatalogue.rb +159 -147
- data/lib/adiwg/mdtranslator/writers/iso19110/iso19110_writer.rb +17 -23
- data/lib/adiwg/mdtranslator/writers/iso19115_2/class_MImetadata.rb +11 -10
- data/lib/adiwg/mdtranslator/writers/iso19115_2/iso19115_2_writer.rb +97 -103
- data/lib/adiwg/mdtranslator/writers/mdWriters.rb +1 -11
- data/test/readers/mdJson/{v0_9 → v1_0}/tc_reader_mdjson_additionalDocumentation.rb +4 -4
- data/test/readers/mdJson/{v0_9 → v1_0}/tc_reader_mdjson_address.rb +3 -3
- data/test/readers/mdJson/{v0_9 → v1_0}/tc_reader_mdjson_associatedResource.rb +4 -4
- data/test/readers/mdJson/{v0_9 → v1_0}/tc_reader_mdjson_browseGraphic.rb +3 -3
- data/test/readers/mdJson/{v0_9 → v1_0}/tc_reader_mdjson_citation.rb +4 -4
- data/test/readers/mdJson/{v0_9 → v1_0}/tc_reader_mdjson_contact.rb +4 -4
- data/test/readers/mdJson/{v0_9 → v1_0}/tc_reader_mdjson_dictionaryInfo.rb +4 -4
- data/test/readers/mdJson/{v0_9 → v1_0}/tc_reader_mdjson_domain.rb +4 -4
- data/test/readers/mdJson/{v0_9 → v1_0}/tc_reader_mdjson_onlineResource.rb +3 -3
- data/test/readers/mdJson/{v0_9 → v1_0}/tc_reader_mdjson_phone.rb +3 -3
- data/test/readers/mdJson/{v0_9 → v1_0}/tc_reader_mdjson_responsibleParty.rb +3 -3
- data/test/readers/mdJson/{v0_9 → v1_0}/tc_translation.rb +4 -4
- data/test/schemas/v1_0/.gitignore +18 -0
- data/test/schemas/v1_0/.travis.yml +7 -0
- data/test/schemas/v1_0/CREDITS +3 -0
- data/test/schemas/v1_0/Gemfile +4 -0
- data/test/schemas/v1_0/LICENSE +24 -0
- data/test/schemas/v1_0/README.md +36 -0
- data/test/schemas/v1_0/Rakefile +12 -0
- data/test/schemas/v1_0/adiwg-json_schemas.gemspec +25 -0
- data/test/schemas/v1_0/examples/additionalDocumentation.json +61 -0
- data/test/schemas/v1_0/examples/address.json +10 -0
- data/test/schemas/v1_0/examples/associatedResource.json +119 -0
- data/test/schemas/v1_0/examples/citation.json +128 -0
- data/test/schemas/v1_0/examples/contact.json +205 -0
- data/test/schemas/v1_0/examples/contactRef.json +12 -0
- data/test/schemas/v1_0/examples/dataDictionary.json +547 -0
- data/test/schemas/v1_0/examples/dataQuality.json +272 -0
- data/test/schemas/v1_0/examples/date.json +19 -0
- data/test/schemas/v1_0/examples/distributor.json +113 -0
- data/test/schemas/v1_0/examples/extent_linestring.json +288 -0
- data/test/schemas/v1_0/examples/extent_point.json +246 -0
- data/test/schemas/v1_0/examples/extent_polygon.json +353 -0
- data/test/schemas/v1_0/examples/format.json +14 -0
- data/test/schemas/v1_0/examples/full_example.json +2844 -0
- data/test/schemas/v1_0/examples/full_example2.json +2325 -0
- data/test/schemas/v1_0/examples/geojson.json +446 -0
- data/test/schemas/v1_0/examples/graphicOverview.json +28 -0
- data/test/schemas/v1_0/examples/hierarchyLevel.json +90 -0
- data/test/schemas/v1_0/examples/keywords.json +144 -0
- data/test/schemas/v1_0/examples/lcc_project_example.json +326 -0
- data/test/schemas/v1_0/examples/legalConstraints.json +17 -0
- data/test/schemas/v1_0/examples/maintInfo.json +34 -0
- data/test/schemas/v1_0/examples/metadataInfo.json +103 -0
- data/test/schemas/v1_0/examples/minimum_example.json +35 -0
- data/test/schemas/v1_0/examples/onlineResource.json +17 -0
- data/test/schemas/v1_0/examples/resolution.json +9 -0
- data/test/schemas/v1_0/examples/resourceInfo.json +1264 -0
- data/test/schemas/v1_0/examples/resourceMaintenance.json +10 -0
- data/test/schemas/v1_0/examples/securityConstraints.json +13 -0
- data/test/schemas/v1_0/examples/spatialRef.json +14 -0
- data/test/schemas/v1_0/examples/taxonomy.json +197 -0
- data/test/schemas/v1_0/examples/temporalElement.json +29 -0
- data/test/schemas/v1_0/examples/uri.json +16 -0
- data/test/schemas/v1_0/examples/usage.json +35 -0
- data/test/schemas/v1_0/examples/verticalExtent.json +18 -0
- data/test/schemas/v1_0/lib/adiwg/mdjson_schemas/utils.rb +20 -0
- data/test/schemas/v1_0/lib/adiwg/mdjson_schemas/validator.rb +42 -0
- data/test/schemas/v1_0/lib/adiwg/mdjson_schemas/version.rb +6 -0
- data/test/schemas/v1_0/lib/adiwg/mdjson_schemas.rb +7 -0
- data/test/schemas/v1_0/lib/adiwg-mdjson_schemas.rb +1 -0
- data/test/schemas/v1_0/schema/schema/citation.json +186 -0
- data/test/schemas/v1_0/schema/schema/contact.json +255 -0
- data/test/schemas/v1_0/schema/schema/dataDictionary.json +209 -0
- data/test/schemas/v1_0/schema/schema/dataQuality.json +159 -0
- data/test/schemas/v1_0/schema/schema/distributor.json +171 -0
- data/test/schemas/v1_0/schema/schema/extent.json +214 -0
- data/test/schemas/v1_0/schema/schema/geojson/bbox.json +14 -0
- data/test/schemas/v1_0/schema/schema/geojson/crs.json +99 -0
- data/test/schemas/v1_0/schema/schema/geojson/geojson.json +194 -0
- data/test/schemas/v1_0/schema/schema/geojson/geometry.json +203 -0
- data/test/schemas/v1_0/schema/schema/graphicOverview.json +42 -0
- data/test/schemas/v1_0/schema/schema/keyword.json +39 -0
- data/test/schemas/v1_0/schema/schema/maintInfo.json +43 -0
- data/test/schemas/v1_0/schema/schema/metadata.json +173 -0
- data/test/schemas/v1_0/schema/schema/onlineResource.json +42 -0
- data/test/schemas/v1_0/schema/schema/resolution.json +51 -0
- data/test/schemas/v1_0/schema/schema/resourceConstraint.json +108 -0
- data/test/schemas/v1_0/schema/schema/resourceInfo.json +305 -0
- data/test/schemas/v1_0/schema/schema/taxonomy.json +122 -0
- data/test/schemas/v1_0/schema/schema/usage.json +39 -0
- data/test/schemas/v1_0/schema/schema.json +64 -0
- data/test/schemas/v1_0/templates/mdJson_template.json +1065 -0
- data/test/schemas/v1_0/test/draft-04.json +189 -0
- data/test/schemas/v1_0/test/tc_schemas.rb +210 -0
- data/test/schemas/v1_0/test/tc_utils.rb +27 -0
- metadata +241 -90
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_additionalDocumentation.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_address.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_associatedResource.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_boundingBox.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_browseGraphic.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_citation.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_contacts.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_coordinates.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_dataDictionary.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_dataQuality.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_dateTime.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_descriptiveKeyword.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_dictionaryInfo.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_distributionInfo.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_domain.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_domainItem.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_entityForeignKey.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_entityIndex.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_extent.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_geoCoordSystem.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_geoProperties.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_geographicElement.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_legalConstraint.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_lineString.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_lineage.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_metadata.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_metadataExtension.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_metadataInfo.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_onlineResource.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_phone.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_point.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_polygon.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_processStep.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_resolution.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_resourceFormat.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_resourceIdentifier.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_resourceInfo.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_resourceMaintenance.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_resourceSpecificUsage.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_responsibleParty.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_securityConstraint.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_source.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_spatialReference.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_taxonClass.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_taxonomy.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_temporalElement.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_timeInstant.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_timePeriod.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_verticalElement.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_voucher.rb +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c323c30414ec1eba70403136085ae2eeba8f288f
|
4
|
+
data.tar.gz: 5b0f79036a8d2513e5b73a2c9eb29b651d8a4603
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 278f8307994c6faa5995139f61041721e91c1baca1fb2fceb3a92ef228597c9425e51c981a33abe22e6b512d4516c6cde9095fff1660f0115809a0f285c12a26
|
7
|
+
data.tar.gz: 7bcc1201a25fdbb735a00d71c68f412df564068ebcd0daacdc6ef7c537f3d763d588aaf62de1475ed439d614fee556ddb2e10885d4607f70e096c3add9b7873d
|
data/.gitignore
CHANGED
data/.gitmodules
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
[submodule "test/schemas/
|
2
|
-
path = test/schemas/
|
3
|
-
url = https://github.com/adiwg/
|
1
|
+
[submodule "test/schemas/v1_0"]
|
2
|
+
path = test/schemas/v1_0
|
3
|
+
url = https://github.com/adiwg/mdJson-schemas.git
|
data/Rakefile
CHANGED
data/adiwg-mdtranslator.gemspec
CHANGED
@@ -9,8 +9,8 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.version = ADIWG::Mdtranslator::VERSION
|
10
10
|
spec.authors = ["Stan Smith", "Josh Bradley"]
|
11
11
|
spec.email = ["stansmith@usgs.gov", "joshua_bradley@fws.gov"]
|
12
|
-
spec.summary = %q{The mdtranslator (metadata translator) is a
|
13
|
-
spec.description = %q{The mdtranslator was written by the Alaska Data Integration Working Group (ADIwg) to assist
|
12
|
+
spec.summary = %q{The mdtranslator (metadata translator) is a tool for translating metadata in one format to another. The tool is written and maintained by the Alaska Data Integration Working Group (ADIwg).}
|
13
|
+
spec.description = %q{The mdtranslator was written by the Alaska Data Integration Working Group (ADIwg) to assist with creating ISO 19139 metadata records. Input to the mdtranslator is simple JSON using the mdJson-schema. The mdtranslator architecture allows developers to write additional readers for other input formats and/or write additional writers for other output other than ISO 19139.}
|
14
14
|
spec.homepage = "http://www.adiwg.org/mdTranslator"
|
15
15
|
spec.license = "UNLICENSED"
|
16
16
|
|
@@ -30,5 +30,5 @@ Gem::Specification.new do |spec|
|
|
30
30
|
spec.add_runtime_dependency "thor", "~> 0.19"
|
31
31
|
spec.add_runtime_dependency "uuidtools", "~> 2.1"
|
32
32
|
spec.add_runtime_dependency "json-schema", "~> 2.4.0", "< 2.5.0"
|
33
|
-
spec.add_runtime_dependency "adiwg-
|
33
|
+
spec.add_runtime_dependency "adiwg-mdjson_schemas", "~> 1.0.0rc1"
|
34
34
|
end
|
@@ -46,6 +46,8 @@
|
|
46
46
|
# Stan Smith 2014-11-06 removed metadataScope from metadataInfo for 0.9.0
|
47
47
|
# Stan Smith 2014-11-06 added newAdditionalDocumentation
|
48
48
|
# Stan Smith 2014-12-01 added data dictionary
|
49
|
+
# Stan Smith 2015-02-17 add entity and attribute alias
|
50
|
+
# Stan Smith 2015-02-17 added support for multiple data dictionaries
|
49
51
|
|
50
52
|
class InternalMetadata
|
51
53
|
|
@@ -64,7 +66,7 @@ class InternalMetadata
|
|
64
66
|
},
|
65
67
|
contacts: [],
|
66
68
|
metadata: {},
|
67
|
-
dataDictionary:
|
69
|
+
dataDictionary: []
|
68
70
|
}
|
69
71
|
end
|
70
72
|
|
@@ -550,6 +552,7 @@ class InternalMetadata
|
|
550
552
|
entityId: nil,
|
551
553
|
entityName: nil,
|
552
554
|
entityCode: nil,
|
555
|
+
entityAlias: [],
|
553
556
|
entityDefinition: nil,
|
554
557
|
primaryKey: [],
|
555
558
|
indexes: [],
|
@@ -570,6 +573,7 @@ class InternalMetadata
|
|
570
573
|
intObj = {
|
571
574
|
attributeName: nil,
|
572
575
|
attributeCode: nil,
|
576
|
+
attributeAlias: [],
|
573
577
|
attributeDefinition: nil,
|
574
578
|
dataType: nil,
|
575
579
|
allowNull: true,
|
@@ -11,7 +11,7 @@
|
|
11
11
|
|
12
12
|
require 'json'
|
13
13
|
require 'json-schema'
|
14
|
-
require 'adiwg-
|
14
|
+
require 'adiwg-mdjson_schemas'
|
15
15
|
# temporary json-schema patch
|
16
16
|
# waiting for rubygem json-schema patch
|
17
17
|
require 'adiwg/mdtranslator/readers/mdJson/validator.rb'
|
@@ -26,7 +26,7 @@ module ADIWG
|
|
26
26
|
def self.validate(file)
|
27
27
|
begin
|
28
28
|
|
29
|
-
schema = ADIWG::
|
29
|
+
schema = ADIWG::MdjsonSchemas::Utils.schema_path
|
30
30
|
aValErrs = Array.new
|
31
31
|
if $response[:readerValidationLevel] == 'strict'
|
32
32
|
aValErrs = JSON::Validator.fully_validate(schema, file, :strict => true, :errors_as_objects => true)
|
@@ -4,6 +4,7 @@
|
|
4
4
|
# History:
|
5
5
|
# Stan Smith 2013-12-01 original script
|
6
6
|
# Stan Smith 2014-12-15 refactored to handle namespacing readers and writers
|
7
|
+
# Stan Smith 2015-02-17 add entity aliases
|
7
8
|
|
8
9
|
require $ReaderNS.readerModule('module_entityIndex')
|
9
10
|
require $ReaderNS.readerModule('module_entityAttribute')
|
@@ -46,6 +47,14 @@ module ADIWG
|
|
46
47
|
end
|
47
48
|
end
|
48
49
|
|
50
|
+
# data entity - alias []
|
51
|
+
if hEntity.has_key?('alias')
|
52
|
+
a = hEntity['alias']
|
53
|
+
unless a.empty?
|
54
|
+
intEntity[:entityAlias] = a
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
49
58
|
# data entity - definition
|
50
59
|
if hEntity.has_key?('definition')
|
51
60
|
s = hEntity['definition']
|
data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_entityAttribute.rb
RENAMED
@@ -4,6 +4,7 @@
|
|
4
4
|
# History:
|
5
5
|
# Stan Smith 2013-12-01 original script
|
6
6
|
# Stan Smith 2014-12-15 refactored to handle namespacing readers and writers
|
7
|
+
# Stan Smith 2015-02-17 added support for attribute aliases
|
7
8
|
|
8
9
|
module ADIWG
|
9
10
|
module Mdtranslator
|
@@ -34,6 +35,14 @@ module ADIWG
|
|
34
35
|
end
|
35
36
|
end
|
36
37
|
|
38
|
+
# attribute - alias []
|
39
|
+
if hAttribute.has_key?('alias')
|
40
|
+
a = hAttribute['alias']
|
41
|
+
unless a.empty?
|
42
|
+
intAttribute[:attributeAlias] = a
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
37
46
|
# attribute - definition
|
38
47
|
if hAttribute.has_key?('definition')
|
39
48
|
s = hAttribute['definition']
|
@@ -4,6 +4,7 @@
|
|
4
4
|
# History:
|
5
5
|
# Stan Smith 2014-12-12 original script
|
6
6
|
# Stan Smith 2014-12-15 refactored to handle namespacing readers and writers
|
7
|
+
# Stan Smith 2015-02-17 added support for multiple data dictionaries
|
7
8
|
|
8
9
|
require $ReaderNS.readerModule('module_contacts')
|
9
10
|
require $ReaderNS.readerModule('module_metadata')
|
@@ -53,8 +54,12 @@ module ADIWG
|
|
53
54
|
|
54
55
|
# data dictionary
|
55
56
|
if hMdJson.has_key?('dataDictionary')
|
56
|
-
|
57
|
-
|
57
|
+
aDictionary = hMdJson['dataDictionary']
|
58
|
+
aDictionary.each do |hDictionary|
|
59
|
+
unless hDictionary.empty?
|
60
|
+
intObj[:dataDictionary] << $ReaderNS::DataDictionary.unpack(hDictionary)
|
61
|
+
end
|
62
|
+
end
|
58
63
|
end
|
59
64
|
|
60
65
|
# return ADIwg internal container
|
@@ -3,7 +3,7 @@
|
|
3
3
|
|
4
4
|
### Supported versions
|
5
5
|
|
6
|
-
>
|
6
|
+
> 1.0.x
|
7
7
|
|
8
8
|
### Reader for ADIwg JSON metadata format (mdJson)
|
9
9
|
|
@@ -16,4 +16,4 @@ to many. The mdJson standard is also a convenient format to exchange directly wi
|
|
16
16
|
the JSON structure is easier create and ingest by programming languages.
|
17
17
|
|
18
18
|
The mdJson format is fully documented on the interactive
|
19
|
-
[
|
19
|
+
[mdTools](http://www.adiwg.org/mdTools) website.
|
@@ -33,11 +33,15 @@
|
|
33
33
|
# 0.12.0 2015-01-16 changed translate entry point method to use keyword parameters
|
34
34
|
# ... must now be ruby version 2.0.0 or higher
|
35
35
|
# 0.12.1 2015-01-21 fixed problem with crash on writer = ''
|
36
|
+
# 0.13.0 2015-01-28 made data dictionary an array
|
37
|
+
# ... added alias to entity and attribute
|
38
|
+
# ... added local names to iso 19110 writer
|
39
|
+
# 1.0.0rc1 2015-02-27 schema 1.0 support
|
36
40
|
|
37
41
|
module ADIWG
|
38
42
|
module Mdtranslator
|
39
43
|
# current mdtranslator version
|
40
|
-
VERSION = "0.
|
44
|
+
VERSION = "1.0.0rc1"
|
41
45
|
end
|
42
46
|
end
|
43
47
|
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# Writer - html metadata writer
|
2
|
+
|
3
|
+
# History:
|
4
|
+
# Stan Smith 2015-01-28 original script
|
5
|
+
|
6
|
+
require 'builder'
|
7
|
+
require 'liquid'
|
8
|
+
require 'kramdown'
|
9
|
+
require 'adiwg/mdtranslator/writers/html/md_html_writer'
|
10
|
+
|
11
|
+
module ADIWG
|
12
|
+
module Mdtranslator
|
13
|
+
module Writers
|
14
|
+
module Html
|
15
|
+
|
16
|
+
# set writer namespace
|
17
|
+
$WriterNS = ADIWG::Mdtranslator::Writers::Html
|
18
|
+
|
19
|
+
def self.startWriter(intObj)
|
20
|
+
|
21
|
+
# set the format of the output file based on the writer specified
|
22
|
+
$response[:writerFormat] = 'html'
|
23
|
+
$response[:writerVersion] = ADIWG::Mdtranslator::VERSION
|
24
|
+
|
25
|
+
# create new HTML document
|
26
|
+
html = Builder::XmlMarkup.new(indent: 3)
|
27
|
+
metadataWriter = $WriterNS::MdHtmlWriter.new(html)
|
28
|
+
metadata = metadataWriter.writeHtml(intObj)
|
29
|
+
|
30
|
+
# set writer pass to true if no messages
|
31
|
+
# false or warning will be set by code that places the message
|
32
|
+
if $response[:writerMessages].length == 0
|
33
|
+
$response[:writerPass] = true
|
34
|
+
end
|
35
|
+
|
36
|
+
return metadata
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
@@ -0,0 +1,25 @@
|
|
1
|
+
|
2
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), './templates'))
|
3
|
+
|
4
|
+
module ADIWG
|
5
|
+
module Mdtranslator
|
6
|
+
module Writers
|
7
|
+
module Html
|
8
|
+
|
9
|
+
class MdHtmlWriter
|
10
|
+
def initialize(html)
|
11
|
+
@html = html
|
12
|
+
end
|
13
|
+
|
14
|
+
def writeHtml(intObj)
|
15
|
+
|
16
|
+
# set template namespace
|
17
|
+
$TempNS = ADIWG::Mdtranslator::Writers::Html
|
18
|
+
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
|
2
|
+
## html
|
3
|
+
|
4
|
+
### Writer for HTML 'human-readable' version of metadata
|
5
|
+
|
6
|
+
The HTML version of metadata is intended to be a human readable
|
7
|
+
version of the metadata content. The HTML output does not mimic
|
8
|
+
any established metadata standard but remains agnostic in its
|
9
|
+
presentation. The HTML metadata version will present the entire
|
10
|
+
content of the metadata record delivered to the reader.
|
@@ -31,9 +31,9 @@ module ADIWG
|
|
31
31
|
# ... citation > identifier section
|
32
32
|
|
33
33
|
# classes used
|
34
|
-
assocCode = $
|
35
|
-
initCode = $
|
36
|
-
citationClass = $
|
34
|
+
assocCode = $IsoNS::DS_AssociationTypeCode.new(@xml)
|
35
|
+
initCode = $IsoNS::DS_InitiativeTypeCode.new(@xml)
|
36
|
+
citationClass = $IsoNS::CI_Citation.new(@xml)
|
37
37
|
|
38
38
|
@xml.tag!('gmd:MD_AggregateInformation') do
|
39
39
|
|
@@ -30,10 +30,10 @@ module ADIWG
|
|
30
30
|
def writeXML(hGeoElement)
|
31
31
|
|
32
32
|
# classes used
|
33
|
-
pointClass = $
|
34
|
-
lineClass = $
|
35
|
-
multiGeoClass = $
|
36
|
-
polygonClass = $
|
33
|
+
pointClass = $IsoNS::Point.new(@xml)
|
34
|
+
lineClass = $IsoNS::LineString.new(@xml)
|
35
|
+
multiGeoClass = $IsoNS::MultiGeometry.new(@xml)
|
36
|
+
polygonClass = $IsoNS::Polygon.new(@xml)
|
37
37
|
|
38
38
|
hGeometry = hGeoElement[:elementGeometry]
|
39
39
|
polyType = hGeometry[:geoType]
|
@@ -31,10 +31,10 @@ module ADIWG
|
|
31
31
|
def writeXML(hCitation)
|
32
32
|
|
33
33
|
# classes used
|
34
|
-
presFormClass = $
|
35
|
-
rPartyClass = $
|
36
|
-
dateClass = $
|
37
|
-
idClass = $
|
34
|
+
presFormClass = $IsoNS::CI_PresentationFormCode.new(@xml)
|
35
|
+
rPartyClass = $IsoNS::CI_ResponsibleParty.new(@xml)
|
36
|
+
dateClass = $IsoNS::CI_Date.new(@xml)
|
37
|
+
idClass = $IsoNS::MD_Identifier.new(@xml)
|
38
38
|
|
39
39
|
@xml.tag!('gmd:CI_Citation') do
|
40
40
|
|
@@ -26,9 +26,9 @@ module ADIWG
|
|
26
26
|
def writeXML(hContact)
|
27
27
|
|
28
28
|
# classes used
|
29
|
-
pBookClass = $
|
30
|
-
addClass = $
|
31
|
-
resourceClass = $
|
29
|
+
pBookClass = $IsoNS::CI_Telephone.new(@xml)
|
30
|
+
addClass = $IsoNS::CI_Address.new(@xml)
|
31
|
+
resourceClass = $IsoNS::CI_OnlineResource.new(@xml)
|
32
32
|
|
33
33
|
@xml.tag!('gmd:CI_Contact') do
|
34
34
|
|
@@ -49,26 +49,26 @@ module ADIWG
|
|
49
49
|
def writeXML(hDataId, aAssocRes)
|
50
50
|
|
51
51
|
# codes used
|
52
|
-
progressCode = $
|
53
|
-
spatialCode = $
|
54
|
-
topicCode = $
|
52
|
+
progressCode = $IsoNS::MD_ProgressCode.new(@xml)
|
53
|
+
spatialCode = $IsoNS::MD_SpatialRepresentationTypeCode.new(@xml)
|
54
|
+
topicCode = $IsoNS::MD_TopicCategoryCode.new(@xml)
|
55
55
|
|
56
56
|
# classes used
|
57
57
|
intMetadataClass = InternalMetadata.new
|
58
|
-
citationClass = $
|
59
|
-
rPartyClass = $
|
60
|
-
mInfoClass = $
|
61
|
-
bGraphicClass = $
|
62
|
-
rFormatClass = $
|
63
|
-
keywordClass = $
|
64
|
-
useClass = $
|
65
|
-
uConClass = $
|
66
|
-
lConClass = $
|
67
|
-
sConClass = $
|
68
|
-
aggInfoClass = $
|
69
|
-
taxClass = $
|
70
|
-
resolutionClass = $
|
71
|
-
extentClass = $
|
58
|
+
citationClass = $IsoNS::CI_Citation.new(@xml)
|
59
|
+
rPartyClass = $IsoNS::CI_ResponsibleParty.new(@xml)
|
60
|
+
mInfoClass = $IsoNS::MD_MaintenanceInformation.new(@xml)
|
61
|
+
bGraphicClass = $IsoNS::MD_BrowseGraphic.new(@xml)
|
62
|
+
rFormatClass = $IsoNS::MD_Format.new(@xml)
|
63
|
+
keywordClass = $IsoNS::MD_Keywords.new(@xml)
|
64
|
+
useClass = $IsoNS::MD_Usage.new(@xml)
|
65
|
+
uConClass = $IsoNS::MD_Constraints.new(@xml)
|
66
|
+
lConClass = $IsoNS::MD_LegalConstraints.new(@xml)
|
67
|
+
sConClass = $IsoNS::MD_SecurityConstraints.new(@xml)
|
68
|
+
aggInfoClass = $IsoNS::MD_AggregateInformation.new(@xml)
|
69
|
+
taxClass = $IsoNS::MD_TaxonSys.new(@xml)
|
70
|
+
resolutionClass = $IsoNS::MD_Resolution.new(@xml)
|
71
|
+
extentClass = $IsoNS::EX_Extent.new(@xml)
|
72
72
|
|
73
73
|
# data identification
|
74
74
|
@xml.tag!('gmd:MD_DataIdentification') do
|
@@ -24,8 +24,8 @@ module ADIWG
|
|
24
24
|
def writeXML(hDataQ)
|
25
25
|
|
26
26
|
# classes used
|
27
|
-
scopeCode = $
|
28
|
-
lineClass = $
|
27
|
+
scopeCode = $IsoNS::MD_ScopeCode.new(@xml)
|
28
|
+
lineClass = $IsoNS::LI_Lineage.new(@xml)
|
29
29
|
|
30
30
|
@xml.tag!('gmd:DQ_DataQuality') do
|
31
31
|
|
@@ -23,8 +23,8 @@ module ADIWG
|
|
23
23
|
def writeXML(transOption)
|
24
24
|
|
25
25
|
# classes used
|
26
|
-
olResClass = $
|
27
|
-
medClass = $
|
26
|
+
olResClass = $IsoNS::CI_OnlineResource.new(@xml)
|
27
|
+
medClass = $IsoNS::MD_Medium.new(@xml)
|
28
28
|
|
29
29
|
@xml.tag!('gmd:MD_DigitalTransferOptions') do
|
30
30
|
|
@@ -25,10 +25,10 @@ module ADIWG
|
|
25
25
|
def writeXML(distributor)
|
26
26
|
|
27
27
|
# classes used
|
28
|
-
rPartyClass = $
|
29
|
-
sOrderProcClass = $
|
30
|
-
rFormatClass = $
|
31
|
-
dTranOptClass = $
|
28
|
+
rPartyClass = $IsoNS::CI_ResponsibleParty.new(@xml)
|
29
|
+
sOrderProcClass = $IsoNS::MD_StandardOrderProcess.new(@xml)
|
30
|
+
rFormatClass = $IsoNS::MD_Format.new(@xml)
|
31
|
+
dTranOptClass = $IsoNS::MD_DigitalTransferOptions.new(@xml)
|
32
32
|
|
33
33
|
@xml.tag!('gmd:MD_Distributor') do
|
34
34
|
|
@@ -29,10 +29,10 @@ module ADIWG
|
|
29
29
|
def writeXML(hExtent)
|
30
30
|
|
31
31
|
# classes used
|
32
|
-
tempExtClass = $
|
33
|
-
vertExtClass = $
|
34
|
-
geoEleClass = $
|
35
|
-
geoEleIdClass = $
|
32
|
+
tempExtClass = $IsoNS::EX_TemporalExtent.new(@xml)
|
33
|
+
vertExtClass = $IsoNS::EX_VerticalExtent.new(@xml)
|
34
|
+
geoEleClass = $IsoNS::GeographicElement.new(@xml)
|
35
|
+
geoEleIdClass = $IsoNS::EX_GeographicDescription.new(@xml)
|
36
36
|
|
37
37
|
@xml.tag!('gmd:EX_Extent') do
|
38
38
|
|
@@ -24,9 +24,9 @@ module ADIWG
|
|
24
24
|
def writeXML(hAttribute)
|
25
25
|
|
26
26
|
# classes used
|
27
|
-
multiClass = $
|
28
|
-
listClass = $
|
29
|
-
uomClass = $
|
27
|
+
multiClass = $IsoNS::Multiplicity.new(@xml)
|
28
|
+
listClass = $IsoNS::FC_ListedValue.new(@xml)
|
29
|
+
uomClass = $IsoNS::UnitsOfMeasure.new(@xml)
|
30
30
|
|
31
31
|
@xml.tag!('gfc:FC_FeatureAttribute') do
|
32
32
|
|
@@ -4,6 +4,7 @@
|
|
4
4
|
# History:
|
5
5
|
# Stan Smith 2014-12-02 original script
|
6
6
|
# Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
|
7
|
+
# Stan Smith 2015-02-18 added aliases for entities
|
7
8
|
|
8
9
|
require 'class_featureConstraint'
|
9
10
|
require 'class_featureAttribute'
|
@@ -22,8 +23,8 @@ module ADIWG
|
|
22
23
|
def writeXML(hEntity)
|
23
24
|
|
24
25
|
# classes used
|
25
|
-
fConClass = $
|
26
|
-
fAttClass = $
|
26
|
+
fConClass = $IsoNS::FC_Constraint.new(@xml)
|
27
|
+
fAttClass = $IsoNS::FC_FeatureAttribute.new(@xml)
|
27
28
|
|
28
29
|
# create and identity for the entity
|
29
30
|
$idCount = $idCount.succ
|
@@ -68,6 +69,14 @@ module ADIWG
|
|
68
69
|
@xml.tag!('gco:Boolean', 'false')
|
69
70
|
end
|
70
71
|
|
72
|
+
# feature type - aliases
|
73
|
+
aAliases = hEntity[:entityAlias]
|
74
|
+
aAliases.each do |myAlias|
|
75
|
+
@xml.tag!('gfc:aliases') do
|
76
|
+
@xml.tag!('gco:LocalName',myAlias)
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
71
80
|
# feature type - feature catalogue - required
|
72
81
|
# 'role that links this feature type to the feature catalogue that contains it'
|
73
82
|
# confusing, allow definition of another feature catalogue here
|
@@ -30,8 +30,8 @@ module ADIWG
|
|
30
30
|
def writeXML(aTempExt)
|
31
31
|
|
32
32
|
# classes used
|
33
|
-
timeIClass = $
|
34
|
-
timePClass = $
|
33
|
+
timeIClass = $IsoNS::TimeInstant.new(@xml)
|
34
|
+
timePClass = $IsoNS::TimePeriod.new(@xml)
|
35
35
|
|
36
36
|
@xml.tag!('gml:GenericMetaData') do
|
37
37
|
|
@@ -24,8 +24,8 @@ module ADIWG
|
|
24
24
|
def writeXML(hGeoElement)
|
25
25
|
|
26
26
|
# classes used
|
27
|
-
geoBBoxClass = $
|
28
|
-
geoBPolyClass = $
|
27
|
+
geoBBoxClass = $IsoNS::EX_GeographicBoundingBox.new(@xml)
|
28
|
+
geoBPolyClass = $IsoNS::EX_BoundingPolygon.new(@xml)
|
29
29
|
|
30
30
|
geoType = hGeoElement[:elementGeometry][:geoType]
|
31
31
|
case geoType
|
@@ -24,8 +24,8 @@ module ADIWG
|
|
24
24
|
def writeXML(hDKeyword)
|
25
25
|
|
26
26
|
# classes used
|
27
|
-
citationClass = $
|
28
|
-
keywordCode = $
|
27
|
+
citationClass = $IsoNS::CI_Citation.new(@xml)
|
28
|
+
keywordCode = $IsoNS::MD_KeywordTypeCode.new(@xml)
|
29
29
|
|
30
30
|
@xml.tag!('gmd:MD_Keywords') do
|
31
31
|
|
@@ -23,8 +23,8 @@ module ADIWG
|
|
23
23
|
def writeXML(hLineage)
|
24
24
|
|
25
25
|
# classes used
|
26
|
-
sourceClass = $
|
27
|
-
pStepClass = $
|
26
|
+
sourceClass = $IsoNS::LI_Source.new(@xml)
|
27
|
+
pStepClass = $IsoNS::LI_ProcessStep.new(@xml)
|
28
28
|
|
29
29
|
@xml.tag!('gmd:LI_Lineage') do
|
30
30
|
|
@@ -24,8 +24,8 @@ module ADIWG
|
|
24
24
|
def writeXML(hMaintInfo)
|
25
25
|
|
26
26
|
# classes used
|
27
|
-
maintFreqCode = $
|
28
|
-
rPartyClass = $
|
27
|
+
maintFreqCode = $IsoNS::MD_MaintenanceFrequencyCode.new(@xml)
|
28
|
+
rPartyClass = $IsoNS::CI_ResponsibleParty.new(@xml)
|
29
29
|
|
30
30
|
@xml.tag! 'gmd:MD_MaintenanceInformation' do
|
31
31
|
|
@@ -23,8 +23,8 @@ module ADIWG
|
|
23
23
|
def writeXML(medium)
|
24
24
|
|
25
25
|
# classes used
|
26
|
-
medFormatCode = $
|
27
|
-
medNameCode = $
|
26
|
+
medFormatCode = $IsoNS::MD_MediumFormatCode.new(@xml)
|
27
|
+
medNameCode = $IsoNS::MD_MediumNameCode.new(@xml)
|
28
28
|
|
29
29
|
@xml.tag!('gmd:MD_Medium') do
|
30
30
|
|