Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests for validation of DCAT-US records #5

Merged
merged 39 commits into from
Apr 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
41fa8e5
add pycache folders.
rshewitt Apr 17, 2023
342fb3f
set pyenv local version.
rshewitt Apr 17, 2023
11d391e
updated.
rshewitt Apr 17, 2023
8678f22
add jsonschema dependency.
rshewitt Apr 17, 2023
dfc1f33
add testing data.
rshewitt Apr 17, 2023
af4cfe2
add schemas
rshewitt Apr 17, 2023
21b5e32
add dcat-us validation test.
rshewitt Apr 17, 2023
69c6145
housekeeping.
rshewitt Apr 17, 2023
bc5e0cc
add schema fixtures.
rshewitt Apr 17, 2023
a5e8913
housekeeping.
rshewitt Apr 17, 2023
39517b1
create utilities for json-types.
rshewitt Apr 17, 2023
c723896
removed unused import.
rshewitt Apr 17, 2023
1cdabda
removed unused fixture.
rshewitt Apr 17, 2023
de9bcfb
deleted uneeded files.
rshewitt Apr 17, 2023
a3ee199
added fixtures to module to fix ruff unused import issue.
rshewitt Apr 17, 2023
bc57ebc
caught validation error exception instead of bare.
rshewitt Apr 17, 2023
c0fd918
reorganized fixures.
rshewitt Apr 17, 2023
caf2da3
reorganized fixtures.
rshewitt Apr 17, 2023
feef811
reorganize dcat-us validation parametrize tests.
rshewitt Apr 18, 2023
a1f2f5a
add error message. not currently being used.
rshewitt Apr 18, 2023
a3c0959
add print for error message.
rshewitt Apr 18, 2023
eb27bfb
reorganized.
rshewitt Apr 19, 2023
e96ef05
update coverate dir.
rshewitt Apr 19, 2023
1985c5f
reoganize and format.
rshewitt Apr 19, 2023
226c099
reorganize.
rshewitt Apr 19, 2023
7791bd4
reverse value.
rshewitt Apr 19, 2023
199aeaa
validate_json_schema function to utils, refactored implementation
robert-bryson Apr 20, 2023
59239d1
add valid flag.
rshewitt Apr 21, 2023
118a3eb
add valid flags.
rshewitt Apr 21, 2023
a4c6338
reorganized.
rshewitt Apr 21, 2023
545fe0a
refactor output.
rshewitt Apr 21, 2023
6d95501
refactor assertions.
rshewitt Apr 21, 2023
fabf4a0
removed unneeded file.
rshewitt Apr 25, 2023
e155312
remove previous version of schema.
rshewitt Apr 25, 2023
218ff9e
update from draft 4 to 2020-12.
rshewitt Apr 25, 2023
b437cf1
fix boolean comparison for ruff.
rshewitt Apr 25, 2023
a355fd9
replaced validate function with Draft202012Validator. Add error parser.
rshewitt Apr 25, 2023
20ba0c8
removed unused imports.
rshewitt Apr 25, 2023
80b1826
refactored validator.
rshewitt Apr 26, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ jobs:

steps:
- uses: actions/checkout@v3
- uses: chartboost/ruff-action@v1
- uses: chartboost/ruff-action@v1
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,10 @@ pytest.xml
pytest-coverage.txt
.coverage
.pytest_cache
.DS_Store
.DS_Store
__pycache__/
venv/

# previous versions of schemas
**/catalog_d4.json
**/dataset_d4.json
155 changes: 155 additions & 0 deletions data/dcatus/jsons/arm.data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
{
"conformsTo": "https://project-open-data.cio.gov/v1.1/schema",
"describedBy": "https://project-open-data.cio.gov/v1.1/schema/catalog.json",
"@context": "https://project-open-data.cio.gov/v1.1/schema/catalog.jsonld",
"@type": "dcat:Catalog",
"dataset": [
{
"accessLevel": "public",
"bureauCode": [
"018:001"
],
"license": "https://project-open-data.cio.gov/unknown-license",
"identifier": "ncepgfsbrwpprof",
"contactPoint": {
"hasEmail": "mailto:adc@arm.gov",
"fn": "ARM Data Center"
},
"description": "No description found",
"programCode": [
"018:001"
],
"distribution": [
{
"accessURL": "http://www.archive.arm.gov/discovery/#v/results/s/s::ncepgfsbrwpprof",
"format": "cdf"
}
],
"modified": "2019-06-27 12:41:27",
"publisher": {
"name": "Atmospheric Radiation Measurement Data Center",
"subOrganizationOf": {
"name": "DOE Biological and Environmental Research (BER)",
"subOrganizationOf": {
"name": "DOE Office of Science user facilities",
"subOrganizationOf": {
"name": "U.S. Government"
}
}
}
},
"@type": "dcat:Dataset",
"keyword": [
"ARM",
"ORNL",
"ADC",
"ARM Data Center",
"Climate",
"Atmospheric Data",
"ncepgfs",
"National Centers for Environment Prediction Global Forecast System",
"derivmod"
],
"title": "NCEP GFS: vertical profiles of met quantities at standard pressures, at Barrow"
},
{
"accessLevel": "public",
"bureauCode": [
"018:001"
],
"license": "https://project-open-data.cio.gov/unknown-license",
"identifier": "10.5439/1027266",
"contactPoint": {
"hasEmail": "mailto:adc@arm.gov",
"fn": "ARM Data Center"
},
"description": "No description found",
"programCode": [
"018:001"
],
"distribution": [
{
"accessURL": "http://www.archive.arm.gov/discovery/#v/results/s/s::1swfanalskyrad1long",
"format": "cdf"
}
],
"modified": "2019-06-27 12:41:27",
"publisher": {
"name": "Atmospheric Radiation Measurement Data Center",
"subOrganizationOf": {
"name": "DOE Biological and Environmental Research (BER)",
"subOrganizationOf": {
"name": "DOE Office of Science user facilities",
"subOrganizationOf": {
"name": "U.S. Government"
}
}
}
},
"@type": "dcat:Dataset",
"keyword": [
"ARM",
"ORNL",
"ADC",
"ARM Data Center",
"Climate",
"Atmospheric Data",
"swfluxanal",
"Shortwave Flux Analysis",
"cloud",
"swfluxanal",
"Shortwave Flux Analysis",
"radio"
],
"title": "Short Wave Flux Analysis: 1-min resolution on SKYAD data, Long algorithm"
},
{
"accessLevel": "public",
"bureauCode": [
"018:001"
],
"license": "https://project-open-data.cio.gov/unknown-license",
"identifier": "avhrr12",
"contactPoint": {
"hasEmail": "mailto:adc@arm.gov",
"fn": "ARM Data Center"
},
"description": "No description found",
"programCode": [
"018:001"
],
"distribution": [
{
"accessURL": "http://www.archive.arm.gov/discovery/#v/results/s/s::avhrr12",
"format": "hdfjpg"
}
],
"modified": "2019-06-27 12:41:27",
"publisher": {
"name": "Atmospheric Radiation Measurement Data Center",
"subOrganizationOf": {
"name": "DOE Biological and Environmental Research (BER)",
"subOrganizationOf": {
"name": "DOE Office of Science user facilities",
"subOrganizationOf": {
"name": "U.S. Government"
}
}
}
},
"@type": "dcat:Dataset",
"keyword": [
"ARM",
"ORNL",
"ADC",
"ARM Data Center",
"Climate",
"Atmospheric Data",
"avhrr",
"Advanced Very High Resolution Radiometer",
"satellite"
],
"title": "AVHRR: albedo and brightness temp., NOAA-12 Satellite"
}
]
}
158 changes: 158 additions & 0 deletions data/dcatus/jsons/collection-1-parent-2-children.data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
{
"conformsTo": "https://project-open-data.cio.gov/v1.1/schema",
"describedBy": "https://project-open-data.cio.gov/v1.1/schema/catalog.json",
"@context": "https://project-open-data.cio.gov/v1.1/schema/catalog.jsonld",
"@type": "dcat:Catalog",
"dataset": [

{
"@type": "dcat:Dataset",
"title": "Addressing AWOL",
"description": "The U.S. Office of Personnel Management (OPM)'s Partnership and Labor Relations holds Roundtables periodically as an ongoing effort to develop a highly skilled cadre of Employee and Labor Relations practitioners. Distinguished speakers present on a wide range of topics of interest for this community. These training opportunities are interactive and allow the participants to ask questions of the presenters. This presentation covers Absence Without Leave (AWOL) and various aspects of handling leave abuse from placing an employee on leave restriction to taking a disciplinary or adverse action. The session also contains federal case law regarding this topic.",
"modified": "2011-12-15",
"accessLevel": "public",
"identifier": "OPM-ERround-0001-AWOL",
"landingPage": "http://www.opm.gov/policy-data-oversight/employee-relations/training/#url=Roundtables",
"license": "http://www.usa.gov/publicdomain/label/1.0/",
"publisher": {
"@type": "org:Organization",
"name": "U.S. Office of Personnel Management"
},
"isPartOf": "OPM-ERround-0001",
"contactPoint": {
"@type": "vcard:Contact",
"fn": "LaShann Freeman",
"hasEmail": "mailto:lashann.freeman@opm.gov"
},
"distribution": [
{
"@type": "dcat:Distribution",
"mediaType": "application/pdf",
"title": "Addressing AWOL",
"downloadURL": "http://www.opm.gov/policy-data-oversight/employee-relations/training/presentationaddressingawol.pdf"
},
{
"@type": "dcat:Distribution",
"accessURL": "https://www.youtube.com/watch?v=08bK8zHH9No",
"format": "video",
"title": "Addressing AWOL"
}
],
"keyword": [
"AWOL",
"Absence without Leave",
"LWOP",
"Leave without Pay",
"disciplinary procedures",
"employee relations",
"leave abuse",
"leave restriction",
"practitioners",
"roundtables",
"training",
"webcast"
],
"bureauCode": [
"027:00"
],
"programCode": [
"027:000"
],
"language": [
"en-US"
]
},
{
"@type": "dcat:Dataset",
"title": "Employee Relations Roundtables",
"description": "The U.S. Office of Personnel Management (OPM)'s Partnership and Labor Relations holds Roundtables periodically as an ongoing effort to develop a highly skilled cadre of Employee and Labor Relations practitioners. Distinguished speakers present on a wide range of topics of interest for this community. These training opportunities are interactive and allow the participants to ask questions of the presenters.",
"modified": "2014-02-09",
"accessLevel": "public",
"identifier": "OPM-ERround-0001",
"landingPage": "http://www.opm.gov/policy-data-oversight/employee-relations/training/#url=Roundtables",
"license": "http://www.usa.gov/publicdomain/label/1.0/",
"publisher": {
"@type": "org:Organization",
"name": "U.S. Office of Personnel Management"
},
"contactPoint": {
"@type": "vcard:Contact",
"fn": "LaShann Freeman",
"hasEmail": "mailto:lashann.freeman@opm.gov"
},
"keyword": [
"employee relations",
"practitioners",
"roundtables",
"training",
"webcast"
],
"bureauCode": [
"027:00"
],
"programCode": [
"027:000"
],
"language": [
"en-US"
]
},
{
"@type": "dcat:Dataset",
"title": "Linking Employee Relations and Retirement",
"description": "The U.S. Office of Personnel Management (OPM)'s Partnership and Labor Relations holds Roundtables periodically as an ongoing effort to develop a highly skilled cadre of Employee and Labor Relations practitioners. Distinguished speakers present on a wide range of topics of interest for this community. These training opportunities are interactive and allow the participants to ask questions of the presenters. This presentation is on different types of Federal retirement (e.g., regular, early, or disability retirement). Included are laws and regulatory provisions regarding retirement, the role of the U.S. Office of Personnel Management (OPM) and the importance of employee relations in cases involving medical issues, disability retirement, Office of Workers' Compensation Programs (OWCP), and reasonable accommodation.",
"modified": "2011-12-15",
"accessLevel": "public",
"identifier": "OPM-ERround-0001-Retire",
"landingPage": "http://www.opm.gov/policy-data-oversight/employee-relations/training/#url=Roundtables",
"license": "http://www.usa.gov/publicdomain/label/1.0/",
"publisher": {
"@type": "org:Organization",
"name": "U.S. Office of Personnel Management"
},
"isPartOf": "OPM-ERround-0001",
"contactPoint": {
"@type": "vcard:Contact",
"fn": "LaShann Freeman",
"hasEmail": "mailto:lashann.freeman@opm.gov"
},
"distribution": [
{
"@type": "dcat:Distribution",
"mediaType": "application/pdf",
"title": "Linking Employee Relations and Retirement",
"downloadURL": "http://www.opm.gov/policy-data-oversight/employee-relations/training/presentationemployeerelationsretirement.pdf"
},
{
"@type": "dcat:Distribution",
"accessURL": "https://www.youtube.com/watch?v=epGxaVa9E_c",
"mediaType": "text/html",
"format": "video",
"title": "Linking Employee Relations and Retirement"
}
],
"keyword": [
"Federal retirement",
"OCWP",
"Office of Workers Compensation Programs",
"disability retirement",
"employee relations",
"medical issues",
"practitioners",
"reasonable accommodation",
"roundtables",
"training",
"webcast"
],
"bureauCode": [
"027:00"
],
"programCode": [
"027:000"
],
"language": [
"en-US"
]
}
]
}
Loading