Skip to content

Commit 6b04ba1

Browse files
committed
fixed some issues
1 parent 18c328c commit 6b04ba1

File tree

3 files changed

+5
-13
lines changed

3 files changed

+5
-13
lines changed

schemas-analyze/src/main/java/org/cedar/schemas/analyze/Analyzers.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ public static Analysis analyze(Discovery discovery) {
6464
}
6565
return Analysis.newBuilder()
6666
.setIdentification(analyzeIdentifiers(discovery))
67+
//.setRelationships(analyzeRelationships()) // FIXME -- this would require access to the larger ParsedRecord + substantial code changes
6768
.setTemporalBounding(analyzeTemporalBounding(discovery))
6869
.setSpatialBounding(analyzeSpatialBounding(discovery))
6970
.setTitles(analyzeTitles(discovery))
@@ -90,7 +91,7 @@ public static IdentificationAnalysis analyzeIdentifiers(Discovery metadata) {
9091
.setParentIdentifierExists(parentIdInfo.exists)
9192
.setParentIdentifierString(parentIdInfo.value)
9293
.setHierarchyLevelNameExists(hierarchyInfo.exists)
93-
.setMatchesIdentifiers((hierarchyInfo.exists && hierarchyInfo.value.equals("granule") && parentIdInfo.exists) || (hierarchyInfo.exists && !hierarchyInfo.value.equals("granule")) || !hierarchyInfo.exists)
94+
.setIsGranule(hierarchyInfo.exists && hierarchyInfo.value.equals("granule") && parentIdInfo.exists)
9495
.build();
9596
}
9697

schemas-analyze/src/test/groovy/org/cedar/schemas/analyze/AnalyzersSpec.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class AnalyzersSpec extends Specification {
6565
parentIdentifierExists : true,
6666
parentIdentifierString : 'gov.super.important:PARENT-ID',
6767
hierarchyLevelNameExists: true,
68-
matchesIdentifiers : true
68+
isGranule : true
6969
],
7070
temporalBounding: [
7171
beginDescriptor : ValidDescriptor.VALID,

schemas-core/src/main/resources/avro/psi/analysis.avsc

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,6 @@
8484
],
8585
"default": null,
8686
"doc": "Resolves to true if metadata content indicates a record is a granule. That is, a parent identifier is present and the hierarchy level name is 'granule'."
87-
},
88-
{
89-
"name": "matchesIdentifiers",
90-
"type": [
91-
"null",
92-
"boolean"
93-
],
94-
"default": null,
95-
"doc": "Resolves to true if 'granule' specified as hierarchy level and parent id provided OR if hierarchy level not 'granule' (parent id value irrelevant here -- record is assumed a collection)."
9687
}
9788
]
9889
}
@@ -119,7 +110,7 @@
119110
},
120111
{
121112
"name": "relationships",
122-
"doc": "Summary of associated relationship RecordTypes and corresponding counts"
113+
"doc": "Summary of associated relationship RecordTypes and corresponding counts",
123114
"type": {
124115
"type": "array",
125116
"items": {
@@ -129,7 +120,7 @@
129120
{
130121
"name": "type",
131122
"type": [
132-
null,
123+
"null",
133124
"RelationshipType"
134125
],
135126
"default": null,

0 commit comments

Comments
 (0)