Skip to content

Commit

Permalink
Changes for ESS-DIVE suite v1.1.0
Browse files Browse the repository at this point in the history
Merge branch 'develop'
  • Loading branch information
gothub committed Feb 24, 2022
2 parents af58149 + 17f2f48 commit a7e610b
Show file tree
Hide file tree
Showing 68 changed files with 4,595 additions and 449 deletions.
5 changes: 3 additions & 2 deletions build.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Ant build properties files for the metadig-checks build

# MetaDIG checks version
metadig-checks.version=0.2.6
metadig-checks.version=0.4.0

build=build
dist=dist
Expand All @@ -12,4 +12,5 @@ data=data
stagescript=stageFiles.py
# The suites to include in the distribution tar file
#suites=arctic-data-center.xml,ess-dive.xml,FAIR-suite.xml,knb-suite.xml
suites=FAIR-suite.xml
#suites=FAIR-suite.xml
suites=ess-dive-1.1.0.xml
3,532 changes: 3,532 additions & 0 deletions data/ess-dive-projects.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<mdq:check xmlns:mdq="https://nceas.ucsb.edu/mdqe/v1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://nceas.ucsb.edu/mdqe/v1 ../schemas/schema1.xsd">
<id>coverage.contentType.present.1</id>
<name>Coverage Content Type</name>
<id>entity.attributeCoverageContentType.present.1</id>
<name>Attribute Coverage Content Type</name>
<description>Check that a coverage content type exists.</description>
<type>Interoperable</type>
<level>REQUIRED</level>
Expand All @@ -17,7 +17,7 @@ def call():
# A coverage content type is not present
if 'coverageContentType' not in globals() or coverageContentType is None:
output = "A coverage content type was not found."
output = "No coverage content type was found."
status = "FAILURE"
return False
Expand Down Expand Up @@ -48,13 +48,9 @@ def call():
</xpath>
</selector>
<dialect>
<name>DataCite 3.1</name>
<name>DataCite 4</name>
<xpath>boolean(/*[local-name() = 'resource'])</xpath>
</dialect>
<dialect>
<name>Dryad Data Package and Data File Modules</name>
<xpath>boolean(/*[local-name() = 'DryadDataFile' or local-name() = 'DryadDataPackage'])</xpath>
</dialect>
<dialect>
<name>Ecological Metadata Language</name>
<xpath>boolean(/*[local-name() = 'eml'])</xpath>
Expand Down
8 changes: 2 additions & 6 deletions src/checks/entity.attributeDefinition.present.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def call():
# Check if definitions are present for each attribute.
if not attributeDefinitionPresent:
output = "No attributes definitions are present."
output = "No attributes were found so unable to check attribute defintions."
status = "FAILURE"
return False
Expand Down Expand Up @@ -111,13 +111,9 @@ def call():
</subSelector>
</selector>
<dialect>
<name>DataCite 3.1</name>
<name>DataCite 4</name>
<xpath>boolean(/*[local-name() = 'resource'])</xpath>
</dialect>
<dialect>
<name>Dryad Data Package and Data File Modules</name>
<xpath>boolean(/*[local-name() = 'DryadDataFile' or local-name() = 'DryadDataPackage'])</xpath>
</dialect>
<dialect>
<name>Ecological Metadata Language</name>
<xpath>boolean(/*[local-name() = 'eml'])</xpath>
Expand Down
8 changes: 2 additions & 6 deletions src/checks/entity.attributeDefinition.sufficient.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def call():
# Check if definitions are present for each attribute.
if not attributeDefinitionPresent:
output = "No attribute definitions are present, so unable to check if definitions are sufficient."
output = "No attribute definitions were found, so unable to check if definitions are sufficient."
status = "FAILURE"
return False
Expand Down Expand Up @@ -124,13 +124,9 @@ def call():
</subSelector>
</selector>
<dialect>
<name>DataCite 3.1</name>
<name>DataCite 4</name>
<xpath>boolean(/*[local-name() = 'resource'])</xpath>
</dialect>
<dialect>
<name>Dryad Data Package and Data File Modules</name>
<xpath>boolean(/*[local-name() = 'DryadDataFile' or local-name() = 'DryadDataPackage'])</xpath>
</dialect>
<dialect>
<name>Ecological Metadata Language</name>
<xpath>boolean(/*[local-name() = 'eml'])</xpath>
Expand Down
8 changes: 2 additions & 6 deletions src/checks/entity.attributeDomain.present.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def call():
NoneType = type(None)
# Check if a measurementScale is present for each attribute.
if not attributesPresent:
output = "No attributes are present so attribute measurement domain cannot be checked."
output = "No attributes were found so attribute measurement domain cannot be checked."
status = "FAILURE"
return False
Expand Down Expand Up @@ -108,13 +108,9 @@ def call():
</subSelector>
</selector>
<dialect>
<name>DataCite 3.1</name>
<name>DataCite 4</name>
<xpath>boolean(/*[local-name() = 'resource'])</xpath>
</dialect>
<dialect>
<name>Dryad Data Package and Data File Modules</name>
<xpath>boolean(/*[local-name() = 'DryadDataFile' or local-name() = 'DryadDataPackage'])</xpath>
</dialect>
<dialect>
<name>Ecological Metadata Language</name>
<xpath>boolean(/*[local-name() = 'eml'])</xpath>
Expand Down
16 changes: 16 additions & 0 deletions src/checks/entity.attributeEnumeratedDomains.present.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ library(metadig)
# Find the <attribute> elements that have enumerated domains in them
idxs <- which(!is.na(enumerated_domains))
if(length(idxs) == 0) {
failure(paste0("No entity attribute enumerated domains found."))
}
for (i in idxs) {
# Check the <code> element
for (code in codes[i]) {
Expand Down Expand Up @@ -66,4 +70,16 @@ success("All enumerated domain descriptions found had codes and definitions.")
<xpath>./measurementScale/nominal/nonNumericDomain/enumeratedDomain/codeDefinition/definition</xpath>
</subSelector>
</selector>
<dialect>
<name>DataCite 4</name>
<xpath>boolean(/*[local-name() = 'resource'])</xpath>
</dialect>
<dialect>
<name>Ecological Metadata Language</name>
<xpath>boolean(/*[local-name() = 'eml'])</xpath>
</dialect>
<dialect>
<name>ISO 19115 and ISO 19115-2 / ISO 19139 and ISO 19139-2</name>
<xpath>boolean(/*[local-name() = 'MI_Metadata' or local-name() = 'MD_Metadata'])</xpath>
</dialect>
</mdq:check>
8 changes: 2 additions & 6 deletions src/checks/entity.attributeMeasurementScale.present.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def call():
# Check if a measurementScale is present for each attribute.
if not attributesPresent:
output = "No attributes present, unable to check if attributes have a measurement scale defined."
output = "No attributes were found so unable to check if attributes have a measurement scale defined."
status = "FAILURE"
return False
Expand Down Expand Up @@ -86,13 +86,9 @@ def call():
</subSelector>
</selector>
<dialect>
<name>DataCite 3.1</name>
<name>DataCite 4</name>
<xpath>boolean(/*[local-name() = 'resource'])</xpath>
</dialect>
<dialect>
<name>Dryad Data Package and Data File Modules</name>
<xpath>boolean(/*[local-name() = 'DryadDataFile' or local-name() = 'DryadDataPackage'])</xpath>
</dialect>
<dialect>
<name>Ecological Metadata Language</name>
<xpath>boolean(/*[local-name() = 'eml'])</xpath>
Expand Down
6 changes: 5 additions & 1 deletion src/checks/entity.attributeName.differs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def call():
# For each entity, check that the attributes defined for it have unique names
if(not attributeDefinitionPresent):
output = "No attribute definitions found, unable to check if attribute names differ from definitions."
output = "No attributes were found, unable to check if attribute names differ from definitions."
status = "FAILURE"
return False
Expand Down Expand Up @@ -113,6 +113,10 @@ def call():
</xpath>
</subSelector>
</selector>
<dialect>
<name>DataCite 4</name>
<xpath>boolean(/*[local-name() = 'resource'])</xpath>
</dialect>
<dialect>
<name>Ecological Metadata Language</name>
<xpath>boolean(/*[local-name() = 'eml'])</xpath>
Expand Down
6 changes: 5 additions & 1 deletion src/checks/entity.attributeNames.unique.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def call():
# The check fails if no attributes are found.
if(len(entities) == 0):
output = "No attributes found, unable to check for duplicate attribute names."
output = "No attributes were found, unable to check for duplicate attribute names."
status = "FAILURE"
return False
Expand Down Expand Up @@ -93,6 +93,10 @@ def call():
</xpath>
</subSelector>
</selector>
<dialect>
<name>DataCite 4</name>
<xpath>boolean(/*[local-name() = 'resource'])</xpath>
</dialect>
<dialect>
<name>Ecological Metadata Language</name>
<xpath>boolean(/*[local-name() = 'eml'])</xpath>
Expand Down
8 changes: 2 additions & 6 deletions src/checks/entity.attributePrecision.present.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def call():
# Check if a measurement precision is present for each attribute.
if not attributesPresent:
output = "No attributes present, unable to check if attribute measurement precision is defined."
output = "No attributes were found so unable to check if attribute measurement precision is defined."
status = "FAILURE"
return False
Expand Down Expand Up @@ -111,13 +111,9 @@ def call():
</subSelector>
</selector>
<dialect>
<name>DataCite 3.1</name>
<name>DataCite 4</name>
<xpath>boolean(/*[local-name() = 'resource'])</xpath>
</dialect>
<dialect>
<name>Dryad Data Package and Data File Modules</name>
<xpath>boolean(/*[local-name() = 'DryadDataFile' or local-name() = 'DryadDataPackage'])</xpath>
</dialect>
<dialect>
<name>Ecological Metadata Language</name>
<xpath>boolean(/*[local-name() = 'eml'])</xpath>
Expand Down
10 changes: 3 additions & 7 deletions src/checks/entity.attributeStorageType.present.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ def call():
# Check if an attribute storage type is present for each attribute.
if not attributesPresent:
output = "No attributes are present, so unable to check for attribute storage type."
output = "No attributes were found, so unable to check for attribute storage type."
status = "FAILURE"
return False
# If attributes are present, they can have a storage type (in EML), so fail if none are found.
if not attributeStorageTypePresent:
output = "No attribute storage types are present."
output = "No attribute storage types were found."
status = "FAILURE"
return False
Expand Down Expand Up @@ -100,13 +100,9 @@ def call():
</subSelector>
</selector>
<dialect>
<name>DataCite 3.1</name>
<name>DataCite 4</name>
<xpath>boolean(/*[local-name() = 'resource'])</xpath>
</dialect>
<dialect>
<name>Dryad Data Package and Data File Modules</name>
<xpath>boolean(/*[local-name() = 'DryadDataFile' or local-name() = 'DryadDataPackage'])</xpath>
</dialect>
<dialect>
<name>Ecological Metadata Language</name>
<xpath>boolean(/*[local-name() = 'eml'])</xpath>
Expand Down
8 changes: 2 additions & 6 deletions src/checks/entity.attributeUnits.present.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def call():
# Check if measurement units are present for each attribute.
if not attributesPresent:
output = "No attributes present."
output = "No attributes were found so unable to check attribute units."
status = "FAILURE"
return False
Expand Down Expand Up @@ -113,13 +113,9 @@ def call():
</subSelector>
</selector>
<dialect>
<name>DataCite 3.1</name>
<name>DataCite 4</name>
<xpath>boolean(/*[local-name() = 'resource'])</xpath>
</dialect>
<dialect>
<name>Dryad Data Package and Data File Modules</name>
<xpath>boolean(/*[local-name() = 'DryadDataFile' or local-name() = 'DryadDataPackage'])</xpath>
</dialect>
<dialect>
<name>Ecological Metadata Language</name>
<xpath>boolean(/*[local-name() = 'eml'])</xpath>
Expand Down
6 changes: 5 additions & 1 deletion src/checks/entity.checksum.present.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def call():
# Check if measurement units are present for each attribute.
if not entitiesPresent:
output = "No data entities are present, so cannot check for entity checksums."
output = "No data entities were found so unable to check for entity checksums."
status = "FAILURE"
return False
Expand Down Expand Up @@ -103,6 +103,10 @@ def call():
<xpath>./entityName</xpath>
</subSelector>
</selector>
<dialect>
<name>DataCite 4</name>
<xpath>boolean(/*[local-name() = 'resource'])</xpath>
</dialect>
<dialect>
<name>Ecological Metadata Language</name>
<xpath>boolean(/*[local-name() = 'eml'])</xpath>
Expand Down
8 changes: 2 additions & 6 deletions src/checks/entity.description.present.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def call():
# Check if a entity description is present for each attribute.
if not entityPresent:
output = "No entities are present so cannot check their descriptions."
output = "No entities were found so unable to check their descriptions."
status = "FAILURE"
return False
Expand Down Expand Up @@ -104,13 +104,9 @@ def call():
</subSelector>
</selector>
<dialect>
<name>DataCite 3.1</name>
<name>DataCite 4</name>
<xpath>boolean(/*[local-name() = 'resource'])</xpath>
</dialect>
<dialect>
<name>Dryad Data Package and Data File Modules</name>
<xpath>boolean(/*[local-name() = 'DryadDataFile' or local-name() = 'DryadDataPackage'])</xpath>
</dialect>
<dialect>
<name>Ecological Metadata Language</name>
<xpath>boolean(/*[local-name() = 'eml'])</xpath>
Expand Down
16 changes: 4 additions & 12 deletions src/checks/entity.distributionURL.resolvable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def call():
# An entity distribution URL is not present
if 'distributionUrl' not in globals() or distributionUrl is None:
output = "An entity distribution URL was not found."
output = "No entity distribution URL was found."
status = "FAILURE"
return False
Expand All @@ -47,7 +47,7 @@ def call():
if(len(distributionUrl) > 1):
output = u"The entity distribution URL '{}' was found (first of {} URLs)".format(url, len(distributionUrl))
else:
output = "The entity distribution URL '{}' was found".format(url)
output = u"The entity distribution URL '{}' was found".format(url)
# Now check if the entity identifier is a resolvable url as is. Do not attempt to use any resolver service,
# just use the bare URL.
Expand All @@ -58,7 +58,7 @@ def call():
status = "SUCCESS"
return True
else:
output = "{}, but is not resolvable.".format(output)
output = u"{}, but is not resolvable.".format(output)
status = "FAILURE"
return False
]]></code>
Expand All @@ -71,13 +71,9 @@ def call():
</xpath>
</selector>
<dialect>
<name>DataCite 3.1</name>
<name>DataCite 4</name>
<xpath>boolean(/*[local-name() = 'resource'])</xpath>
</dialect>
<dialect>
<name>Dryad Data Package and Data File Modules</name>
<xpath>boolean(/*[local-name() = 'DryadDataFile' or local-name() = 'DryadDataPackage'])</xpath>
</dialect>
<dialect>
<name>Ecological Metadata Language</name>
<xpath>boolean(/*[local-name() = 'eml'])</xpath>
Expand All @@ -86,8 +82,4 @@ def call():
<name>ISO 19115 and ISO 19115-2 / ISO 19139 and ISO 19139-2</name>
<xpath>boolean(/*[local-name() = 'MI_Metadata' or local-name() = 'MD_Metadata'])</xpath>
</dialect>
<dialect>
<name>ISO 19115-1 / ISO 19115-3</name>
<xpath>boolean(/*[local-name() = 'MD_Metadata'])</xpath>
</dialect>
</mdq:check>
Loading

0 comments on commit a7e610b

Please sign in to comment.