DCAT-US writer: conditional fields
hmaier-fws opened this issue · comments
Issue
Add support for DCAT-US schema conditional fields.
Related issues: #251, #264
For information on the DCAT-US schema see:
- https://resources.data.gov/schemas/dcat-us/v1.1/schema/dataset.json
- https://resources.data.gov/resources/dcat-us
- https://github.com/adiwg/mdTranslator/blob/feature/dcat-us-writer/notes.md
Conditional fields:
- license (see PR #274)
- rights (see PR #274)
- spatial (see PR #274)
- temporal (see PR #274)
- distribution (see PR #274)
Proposed mapping of mdJSON to DCAT-US conditional fields.
license
Field Name | DCAT Name | Condition | mdJson Source |
---|---|---|---|
License | dcat:license | [add resourceInfo.constraint.reference to mdEditor] if exists resourceInfo.constraint.reference[0] |
resourceInfo.constraint.reference[0] |
else | https://creativecommons.org/publicdomain/zero/1.0/ [allows author to identify a license to use, or default to CC0 if none provided, CC0 would cover international usage as opposed to publicdomain] [others: http://www.usa.gov/publicdomain/label/1.0/, http://opendatacommons.org/licenses/pddl/1.0] |
rights
Field Name | DCAT Name | Condition | mdJson Source |
---|---|---|---|
Rights | dcat:rights | if constraint.accessLevel in {"restricted public", "non-public"} | resourceInfo.constraint.releasibility.statement + " " + each constraint.releasibility.dessiminationConstraint[0, n] |
spatial
Field Name | DCAT Name | Condition | mdJson Source |
---|---|---|---|
Spatial | dcat:spatial | if exists resourceInfo.extents[0].geographicExtents[0].boundingBox | boundingBox.eastLongitude + "," + boundingBox.southLatitude + "," + boundingBox.westLongitude + "," + boundingBox.northLatitude [decimal degrees] |
else | if exists resourceInfo.extents[0].geographicExtents[0].geographicElement[0].type = "point" then geographicElement[0].coordinate[1] + "," + geographicElement[0].coordinate[0] [lat, long decimal degrees] |
temporal
Field Name | DCAT Name | Condition | mdJson Source |
---|---|---|---|
Temporal | dcat:temporal | if exists resourceInfo.extent[0].temporalExtent[0] then if exists tempororalExtent[0].timePeriod.startDate and exists temporaralExtent[0].timePeriod.endDate |
timePeriod[0].startDate + "/" + timePeriod.endDate |
if exists tempororalExtent[0].timePeriod.startDate and not exists temporaralExtent[0].timePeriod.endDate | tempororalExtent[0].timePeriod.startDate | ||
if not exists temporalExtent[0].timePeriod.startDate and exists temporaralExtent[0].timePeriod.endDate | tempororalExtent[0].timePeriod.endDate [may need revisiting relative to decision on date only formatting] |
distribution
Temporal is incorrectly mapped for mdJSON, though correct for ISO. At this point, I believe we are only considering mdJSON-DCAT. Should be resourceInfo.timePeriod{ }.
Rights logic won't work. There is no "accessLevel" in mdJSON. Following the logic that Hilmar suggested in DCAT.md of using MD_ClassificationCode, possibly utilizing codes "unclassified" and "restricted". However, I don't see a suitable code to imply "non-public". We may consider extending the codelist to explicitly identify these codes, or just add non-public to the list. Modified logic would like this:
if constraint[0] exists, and for any constraint[ ]
if security.classification = "unclassified" or "public" then rights = "Public"
else if security.classification = "restricted" or "restrictedPublic" then rights = "Restricted Public"
else if security.classification = "nonPublic" = then rights = "Non Public"