adiwg / mdTranslator

Metadata translation tool built using Ruby
https://www.adiwg.org/mdTranslator/
The Unlicense
14 stars 12 forks source link

DCAT-US writer: conditional fields #268

Open hmaier-fws opened 11 months ago

hmaier-fws commented 11 months ago

Issue

Add support for DCAT-US schema conditional fields.

Related issues: #251, #264

For information on the DCAT-US schema see:

Conditional fields:

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

Moved to new issue

dwalt commented 11 months ago

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{ }.

dwalt commented 11 months ago

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"