adiwg-mdtranslator 0.8.6 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.gitmodules +2 -2
- data/adiwg-mdtranslator.gemspec +3 -2
- data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +13 -1
- data/lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.9.0/module_additionalDocumentation.rb +36 -0
- data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_address.rb +0 -0
- data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_associatedResource.rb +12 -3
- data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_boundingBox.rb +0 -0
- data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_browseGraphic.rb +0 -0
- data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_citation.rb +0 -0
- data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_contacts.rb +0 -0
- data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_coordinates.rb +0 -0
- data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_dataQuality.rb +0 -0
- data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_dateTime.rb +0 -0
- data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_descriptiveKeyword.rb +0 -0
- data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_distributionInfo.rb +0 -0
- data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_extent.rb +0 -0
- data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_geoCoordSystem.rb +0 -0
- data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_geoProperties.rb +0 -0
- data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_geographicElement.rb +0 -0
- data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_legalConstraint.rb +0 -0
- data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_lineString.rb +0 -0
- data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_lineage.rb +0 -0
- data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_metadata.rb +5 -4
- data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_metadataExtension.rb +0 -0
- data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_metadataInfo.rb +1 -8
- data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_onlineResource.rb +0 -0
- data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_phone.rb +0 -0
- data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_point.rb +0 -0
- data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_polygon.rb +0 -0
- data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_processStep.rb +0 -0
- data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_resolution.rb +0 -0
- data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_resourceFormat.rb +0 -0
- data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_resourceIdentifier.rb +0 -0
- data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_resourceInfo.rb +19 -0
- data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_resourceMaintenance.rb +0 -0
- data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_resourceSpecificUsage.rb +0 -0
- data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_responsibleParty.rb +0 -0
- data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_securityConstraint.rb +0 -0
- data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_source.rb +0 -0
- data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_spatialReference.rb +0 -0
- data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_taxonClass.rb +0 -0
- data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_taxonomy.rb +0 -0
- data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_temporalElement.rb +0 -0
- data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_timeInstant.rb +0 -0
- data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_timePeriod.rb +0 -0
- data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_verticalElement.rb +0 -0
- data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_voucher.rb +0 -0
- data/lib/adiwg/mdtranslator/version.rb +4 -1
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_aggregateInformation.rb +3 -1
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_dataIdentification.rb +20 -1
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_extent.rb +0 -2
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_metadata.rb +8 -12
- data/test/tc_translation.rb +3 -3
- metadata +50 -57
- data/test/adiwgJson_template.json +0 -977
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 010b1cbf2339294147a58e5b78ded88b4df91be5
|
4
|
+
data.tar.gz: 8364931e9e108a14613fc714c32062e6c76f068c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 31f1fb5def4ba901a6c029f785c6c30d551e9e1e5a66aaaac3b7484d0bfbcfb78f47ee813997fd09d81a2193c7b626102712c2bb9b5b1a97daef9333509ac42a
|
7
|
+
data.tar.gz: d941add4d9e083587fd7fb800b2bb828373022ae9920343d59278357fcc91ab0fc0070e5e196036b0c47adad33a06bfe7db24f5a0b59d6c06f2d0924c9c066b1
|
data/.gitignore
CHANGED
data/.gitmodules
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
[submodule "test/schemas/
|
2
|
-
path = test/schemas/
|
1
|
+
[submodule "test/schemas/v0_9"]
|
2
|
+
path = test/schemas/v0_9
|
3
3
|
url = https://github.com/adiwg/adiwg-json-schemas.git
|
data/adiwg-mdtranslator.gemspec
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
lib = File.expand_path('../lib', __FILE__)
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
|
4
5
|
require 'adiwg/mdtranslator/version'
|
5
6
|
|
6
7
|
Gem::Specification.new do |spec|
|
@@ -26,6 +27,6 @@ Gem::Specification.new do |spec|
|
|
26
27
|
spec.add_runtime_dependency "builder", "~>3.2"
|
27
28
|
spec.add_runtime_dependency "thor", "~>0.19"
|
28
29
|
spec.add_runtime_dependency "uuidtools", "~>2.1"
|
29
|
-
spec.add_runtime_dependency "json-schema", "~>2.
|
30
|
-
spec.add_runtime_dependency "adiwg-json_schemas", "~>0.
|
30
|
+
spec.add_runtime_dependency "json-schema", "~>2.4"
|
31
|
+
spec.add_runtime_dependency "adiwg-json_schemas", "~>0.9"
|
31
32
|
end
|
@@ -42,6 +42,9 @@
|
|
42
42
|
# Stan Smith 2014-05-28 modified resourceId & responsibleParty for schema 0.5.0
|
43
43
|
# Stan Smith 2014-08-15 modified citation, onlineResource, resourceId for 0.6.0
|
44
44
|
# Stan Smith 2014-09-03 added spatialReferenceSystems for name, EPSG, and WKT for 0.6.0
|
45
|
+
# Stan Smith 2014-11-06 added resourceType to resourceInfo for 0.9.0
|
46
|
+
# Stan Smith 2014-11-06 removed metadataScope from metadataInfo for 0.9.0
|
47
|
+
# Stan Smith 2014-11-06 added newAdditionalDocumentation
|
45
48
|
|
46
49
|
class InternalMetadata
|
47
50
|
|
@@ -117,7 +120,6 @@ class InternalMetadata
|
|
117
120
|
intObj = {
|
118
121
|
metadataId: {},
|
119
122
|
parentMetadata: {},
|
120
|
-
metadataScope: [],
|
121
123
|
metadataCustodians: [],
|
122
124
|
metadataCreateDate: {},
|
123
125
|
metadataUpdateDate: {},
|
@@ -147,7 +149,9 @@ class InternalMetadata
|
|
147
149
|
|
148
150
|
def newResourceInfo
|
149
151
|
intObj = {
|
152
|
+
resourceType: nil,
|
150
153
|
citation: {},
|
154
|
+
timePeriod: {},
|
151
155
|
abstract: nil,
|
152
156
|
shortAbstract: nil,
|
153
157
|
hasMapLocation?: nil,
|
@@ -490,10 +494,18 @@ class InternalMetadata
|
|
490
494
|
def newAssociatedResource
|
491
495
|
intObj = {
|
492
496
|
associationType: nil,
|
497
|
+
initiativeType: nil,
|
493
498
|
resourceType: nil,
|
494
499
|
resourceCitation: {},
|
495
500
|
metadataCitation: {}
|
496
501
|
}
|
497
502
|
end
|
498
503
|
|
504
|
+
def newAdditionalDocumentation
|
505
|
+
intObj = {
|
506
|
+
resourceType: nil,
|
507
|
+
citation: {}
|
508
|
+
}
|
509
|
+
end
|
510
|
+
|
499
511
|
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# unpack additional doucmentation
|
2
|
+
# Reader - ADIwg JSON V1 to internal data structure
|
3
|
+
|
4
|
+
# History:
|
5
|
+
# Stan Smith 2014-11-06 original script
|
6
|
+
|
7
|
+
require ADIWG::Mdtranslator.reader_module('module_citation', $response[:readerVersionUsed])
|
8
|
+
|
9
|
+
module Adiwg_AdditionalDocumentation
|
10
|
+
|
11
|
+
def self.unpack(hAddDoc)
|
12
|
+
|
13
|
+
# instance classes needed in script
|
14
|
+
intMetadataClass = InternalMetadata.new
|
15
|
+
intAddDoc = intMetadataClass.newAssociatedResource
|
16
|
+
|
17
|
+
# associated resource - resource type
|
18
|
+
if hAddDoc.has_key?('resourceType')
|
19
|
+
s = hAddDoc['resourceType']
|
20
|
+
if s != ''
|
21
|
+
intAddDoc[:resourceType] = s
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
# associated resource - resource citation
|
26
|
+
if hAddDoc.has_key?('citation')
|
27
|
+
hCitation = hAddDoc['citation']
|
28
|
+
unless hCitation.empty?
|
29
|
+
intAddDoc[:citation] = Adiwg_Citation.unpack(hCitation)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
return intAddDoc
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_address.rb
RENAMED
File without changes
|
@@ -7,9 +7,10 @@
|
|
7
7
|
# Stan Smith 2014-06-02 added resource metadata citation section
|
8
8
|
# Stan Smith 2014-07-08 resolve require statements using Mdtranslator.reader_module
|
9
9
|
# Stan Smith 2014-08-18 moved resourceIdentifier to citation module schema 0.6.0
|
10
|
+
# Stan Smith 2014-11-06 changed resourceType to initiative type for 0.9.0
|
11
|
+
# Stan Smith 2014-11-06 added resourceType for 0.9.0
|
10
12
|
|
11
13
|
require ADIWG::Mdtranslator.reader_module('module_citation', $response[:readerVersionUsed])
|
12
|
-
require ADIWG::Mdtranslator.reader_module('module_resourceIdentifier', $response[:readerVersionUsed])
|
13
14
|
|
14
15
|
module Adiwg_AssociatedResource
|
15
16
|
|
@@ -19,7 +20,7 @@ module Adiwg_AssociatedResource
|
|
19
20
|
intMetadataClass = InternalMetadata.new
|
20
21
|
intAssocRes = intMetadataClass.newAssociatedResource
|
21
22
|
|
22
|
-
# associated resource -
|
23
|
+
# associated resource - association type
|
23
24
|
if hAssocRes.has_key?('associationType')
|
24
25
|
s = hAssocRes['associationType']
|
25
26
|
if s != ''
|
@@ -27,7 +28,15 @@ module Adiwg_AssociatedResource
|
|
27
28
|
end
|
28
29
|
end
|
29
30
|
|
30
|
-
# associated resource -
|
31
|
+
# associated resource - initiative type
|
32
|
+
if hAssocRes.has_key?('initiativeType')
|
33
|
+
s = hAssocRes['initiativeType']
|
34
|
+
if s != ''
|
35
|
+
intAssocRes[:initiativeType] = s
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
# associated resource - resource type
|
31
40
|
if hAssocRes.has_key?('resourceType')
|
32
41
|
s = hAssocRes['resourceType']
|
33
42
|
if s != ''
|
data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_boundingBox.rb
RENAMED
File without changes
|
File without changes
|
data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_citation.rb
RENAMED
File without changes
|
data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_contacts.rb
RENAMED
File without changes
|
data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_coordinates.rb
RENAMED
File without changes
|
data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_dataQuality.rb
RENAMED
File without changes
|
data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_dateTime.rb
RENAMED
File without changes
|
File without changes
|
File without changes
|
data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_extent.rb
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_lineString.rb
RENAMED
File without changes
|
data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_lineage.rb
RENAMED
File without changes
|
data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_metadata.rb
RENAMED
@@ -17,6 +17,7 @@ require ADIWG::Mdtranslator.reader_module('module_metadataInfo', $response[:read
|
|
17
17
|
require ADIWG::Mdtranslator.reader_module('module_resourceInfo', $response[:readerVersionUsed])
|
18
18
|
require ADIWG::Mdtranslator.reader_module('module_distributionInfo', $response[:readerVersionUsed])
|
19
19
|
require ADIWG::Mdtranslator.reader_module('module_associatedResource', $response[:readerVersionUsed])
|
20
|
+
require ADIWG::Mdtranslator.reader_module('module_additionalDocumentation', $response[:readerVersionUsed])
|
20
21
|
require ADIWG::Mdtranslator.reader_module('module_citation', $response[:readerVersionUsed])
|
21
22
|
|
22
23
|
module Adiwg_Metadata
|
@@ -61,10 +62,10 @@ module Adiwg_Metadata
|
|
61
62
|
|
62
63
|
# metadata - additional documents
|
63
64
|
if hMetadata.has_key?('additionalDocumentation')
|
64
|
-
|
65
|
-
unless
|
66
|
-
|
67
|
-
intMetadata[:additionalDocuments] <<
|
65
|
+
aAddDocs = hMetadata['additionalDocumentation']
|
66
|
+
unless aAddDocs.empty?
|
67
|
+
aAddDocs.each do |hAddDoc|
|
68
|
+
intMetadata[:additionalDocuments] << Adiwg_AdditionalDocumentation.unpack(hAddDoc)
|
68
69
|
end
|
69
70
|
end
|
70
71
|
end
|
File without changes
|
data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_metadataInfo.rb
RENAMED
@@ -6,6 +6,7 @@
|
|
6
6
|
# Stan Smith 2014-07-03 resolve require statements using Mdtranslator.reader_module
|
7
7
|
# Stan Smith 2014-09-19 changed metadata identifier type resource identifier json 0.8.0
|
8
8
|
# Stan Smith 2014-09-19 changed parent metadata identifier type citation json 0.8.0
|
9
|
+
# Stan Smith 2014-11-06 removed metadataScope, moved to resourceType under resourceInfo json 0.9.0
|
9
10
|
|
10
11
|
require ADIWG::Mdtranslator.reader_module('module_responsibleParty', $response[:readerVersionUsed])
|
11
12
|
require ADIWG::Mdtranslator.reader_module('module_dateTime', $response[:readerVersionUsed])
|
@@ -39,14 +40,6 @@ module Adiwg_MetadataInfo
|
|
39
40
|
end
|
40
41
|
end
|
41
42
|
|
42
|
-
# metadata - scope - from codeList
|
43
|
-
if hMetadataInfo.has_key?('metadataScope')
|
44
|
-
aMetadataScope = hMetadataInfo['metadataScope']
|
45
|
-
unless aMetadataScope.empty?
|
46
|
-
intMetadataInfo[:metadataScope] = aMetadataScope
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
43
|
# metadata - metadata contacts, custodians
|
51
44
|
if hMetadataInfo.has_key?('metadataContact')
|
52
45
|
aCust = hMetadataInfo['metadataContact']
|
File without changes
|
data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_phone.rb
RENAMED
File without changes
|
data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_point.rb
RENAMED
File without changes
|
data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_polygon.rb
RENAMED
File without changes
|
data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_processStep.rb
RENAMED
File without changes
|
data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_resolution.rb
RENAMED
File without changes
|
File without changes
|
File without changes
|
data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_resourceInfo.rb
RENAMED
@@ -13,6 +13,8 @@
|
|
13
13
|
# Stan Smith 2014-07-03 resolve require statements using Mdtranslator.reader_module
|
14
14
|
# Stan Smith 2014-08-18 moved resourceIdentifier to citation module schema 0.6.0
|
15
15
|
# Stan Smith 2014-09-03 added spatial reference system module for 0.7.0
|
16
|
+
# Stan Smith 2014-10-29 added support for resource time period
|
17
|
+
# Stan Smith 2014-11-06 added resourceType for 0.9.0
|
16
18
|
|
17
19
|
require ADIWG::Mdtranslator.reader_module('module_citation', $response[:readerVersionUsed])
|
18
20
|
require ADIWG::Mdtranslator.reader_module('module_resourceIdentifier', $response[:readerVersionUsed])
|
@@ -29,6 +31,7 @@ require ADIWG::Mdtranslator.reader_module('module_resolution', $response[:reader
|
|
29
31
|
require ADIWG::Mdtranslator.reader_module('module_extent', $response[:readerVersionUsed])
|
30
32
|
require ADIWG::Mdtranslator.reader_module('module_dataQuality', $response[:readerVersionUsed])
|
31
33
|
require ADIWG::Mdtranslator.reader_module('module_spatialReference', $response[:readerVersionUsed])
|
34
|
+
require ADIWG::Mdtranslator.reader_module('module_timePeriod', $response[:readerVersionUsed])
|
32
35
|
|
33
36
|
module Adiwg_ResourceInfo
|
34
37
|
|
@@ -38,6 +41,14 @@ module Adiwg_ResourceInfo
|
|
38
41
|
intMetadataClass = InternalMetadata.new
|
39
42
|
intResInfo = intMetadataClass.newResourceInfo
|
40
43
|
|
44
|
+
# resource information - resource type
|
45
|
+
if hResourceInfo.has_key?('resourceType')
|
46
|
+
s = hResourceInfo['resourceType']
|
47
|
+
if s != ''
|
48
|
+
intResInfo[:resourceType] = s
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
41
52
|
# resource information - citation
|
42
53
|
if hResourceInfo.has_key?('citation')
|
43
54
|
hCitation = hResourceInfo['citation']
|
@@ -46,6 +57,14 @@ module Adiwg_ResourceInfo
|
|
46
57
|
end
|
47
58
|
end
|
48
59
|
|
60
|
+
# resource information - resource time period
|
61
|
+
if hResourceInfo.has_key?('resourceTimePeriod')
|
62
|
+
hResPeriod = hResourceInfo['resourceTimePeriod']
|
63
|
+
unless hResPeriod.empty?
|
64
|
+
intResInfo[:timePeriod] = Adiwg_TimePeriod.unpack(hResPeriod)
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
49
68
|
# resource information - point of contact
|
50
69
|
if hResourceInfo.has_key?('pointOfContact')
|
51
70
|
aPOC = hResourceInfo['pointOfContact']
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_source.rb
RENAMED
File without changes
|
File without changes
|
data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_taxonClass.rb
RENAMED
File without changes
|
data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_taxonomy.rb
RENAMED
File without changes
|
File without changes
|
data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_timeInstant.rb
RENAMED
File without changes
|
data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_timePeriod.rb
RENAMED
File without changes
|
File without changes
|
data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_voucher.rb
RENAMED
File without changes
|
@@ -14,11 +14,14 @@
|
|
14
14
|
# ... block in the input.
|
15
15
|
# 0.8.5 2014-10-11 added methods to pass content of readme files
|
16
16
|
# 0.8.6 2014-10-15 added cli option to return entire content mdTranslator response
|
17
|
+
# 0.8.7 2014-10-29 added support for resource time period
|
18
|
+
# 0.9.0 2014-11-06 added resourceType to associatedResource and additionalInformation
|
19
|
+
# ... moved resourceType from metadataInfo to resourceInfo in json
|
17
20
|
|
18
21
|
module ADIWG
|
19
22
|
module Mdtranslator
|
20
23
|
# current mdtranslator version
|
21
|
-
VERSION = "0.
|
24
|
+
VERSION = "0.9.0"
|
22
25
|
end
|
23
26
|
end
|
24
27
|
|
@@ -4,6 +4,8 @@
|
|
4
4
|
# History:
|
5
5
|
# Stan Smith 2014-05-29 original script
|
6
6
|
# Stan Smith 2014-07-08 modify require statements to function in RubyGem structure
|
7
|
+
# Stan Smith 2014-11-06 take initiativeType from internal initiativeType
|
8
|
+
# ... rather than resourceType for 0.9.0
|
7
9
|
|
8
10
|
require 'code_associationType'
|
9
11
|
require 'code_initiativeType'
|
@@ -52,7 +54,7 @@ class MD_AggregateInformation
|
|
52
54
|
end
|
53
55
|
|
54
56
|
# aggregate information - initiative type
|
55
|
-
s = hAssocRes[:
|
57
|
+
s = hAssocRes[:initiativeType]
|
56
58
|
if !s.nil?
|
57
59
|
@xml.tag!('gmd:initiativeType') do
|
58
60
|
initCode.writeXML(s)
|
@@ -13,6 +13,7 @@
|
|
13
13
|
# Stan Smith 2014-05-15 modify to support JSON schema version 0.4.0
|
14
14
|
# Stan Smith 2014-05-21 added aggregate information section
|
15
15
|
# Stan Smith 2014-07-08 modify require statements to function in RubyGem structure
|
16
|
+
# Stan Smith 2014-10-29 add resource time period as a extent temporal element
|
16
17
|
|
17
18
|
require 'code_progress'
|
18
19
|
require 'code_topicCategory'
|
@@ -46,6 +47,7 @@ class MD_DataIdentification
|
|
46
47
|
topicCode = MD_TopicCategoryCode.new(@xml)
|
47
48
|
|
48
49
|
# classes used by MD_Metadata
|
50
|
+
intMetadataClass = InternalMetadata.new
|
49
51
|
citationClass = CI_Citation.new(@xml)
|
50
52
|
rPartyClass = CI_ResponsibleParty.new(@xml)
|
51
53
|
mInfoClass = MD_MaintenanceInformation.new(@xml)
|
@@ -310,6 +312,23 @@ class MD_DataIdentification
|
|
310
312
|
end
|
311
313
|
|
312
314
|
# data identification - extent
|
315
|
+
# if resource time period, represent the time period as
|
316
|
+
# a temporal element in the first extent
|
317
|
+
needTag = true
|
318
|
+
hTimePeriod = hDataId[:timePeriod]
|
319
|
+
if !hTimePeriod.empty?
|
320
|
+
hTempEle = intMetadataClass.newTemporalElement
|
321
|
+
hTempEle[:timePeriod] = hTimePeriod
|
322
|
+
hExt = intMetadataClass.newExtent
|
323
|
+
hExt[:extDesc] = 'Temporal span of the resource (data or project)'
|
324
|
+
hExt[:extTempElements] << hTempEle
|
325
|
+
@xml.tag!('gmd:extent') do
|
326
|
+
extentClass.writeXML(hExt)
|
327
|
+
end
|
328
|
+
needTag = false
|
329
|
+
end
|
330
|
+
|
331
|
+
# add the remaining geographic, temporal, and veritcal extents
|
313
332
|
aExtents = hDataId[:extents]
|
314
333
|
if !aExtents.empty?
|
315
334
|
aExtents.each do |hExtent|
|
@@ -317,7 +336,7 @@ class MD_DataIdentification
|
|
317
336
|
extentClass.writeXML(hExtent)
|
318
337
|
end
|
319
338
|
end
|
320
|
-
elsif $showAllTags
|
339
|
+
elsif $showAllTags && needTag
|
321
340
|
@xml.tag!('gmd:extent')
|
322
341
|
end
|
323
342
|
|
@@ -21,6 +21,7 @@
|
|
21
21
|
# ... metadata: {resourceInfo: {citation: {citOlResources[0]: {olResURI:}}}}
|
22
22
|
# Stan Smith 2014-10-10 modified to pass minimum metadata input test
|
23
23
|
# ... test were added to handle a missing metadata > metadataInfo block in the input
|
24
|
+
# Stan Smith 2014-11-06 changed hierarchy level to load values from resourceInfo > resourceType
|
24
25
|
|
25
26
|
require 'code_characterSet'
|
26
27
|
require 'code_scope'
|
@@ -137,21 +138,16 @@ class MI_Metadata
|
|
137
138
|
@xml.tag!('gmd:parentIdentifier')
|
138
139
|
end
|
139
140
|
|
140
|
-
# metadata information -
|
141
|
+
# metadata information - hierarchy level - defaults to 'dataset',
|
142
|
+
# values taken from resourceInfo > resourceType
|
141
143
|
fileHierarchy = false
|
142
|
-
|
143
|
-
if
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
aHierarchy.each do |hierarchy|
|
148
|
-
@xml.tag!('gmd:hierarchyLevel') do
|
149
|
-
scopeCode.writeXML(hierarchy)
|
150
|
-
end
|
151
|
-
end
|
144
|
+
s = hResInfo[:resourceType]
|
145
|
+
if s != ''
|
146
|
+
fileHierarchy = true
|
147
|
+
@xml.tag!('gmd:hierarchyLevel') do
|
148
|
+
scopeCode.writeXML(s)
|
152
149
|
end
|
153
150
|
end
|
154
|
-
end
|
155
151
|
if !fileHierarchy
|
156
152
|
@xml.tag!('gmd:hierarchyLevel') do
|
157
153
|
scopeCode.writeXML('dataset')
|