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

sbJson 2.0 dates #70

Closed
2 tasks done
stansmith907 opened this issue Mar 9, 2017 · 5 comments
Closed
2 tasks done

sbJson 2.0 dates #70

stansmith907 opened this issue Mar 9, 2017 · 5 comments

Comments

@stansmith907
Copy link
Contributor

stansmith907 commented Mar 9, 2017

Mapping of sbJson dates to mdTranslator internal data structure:

  • reader complete
  • writer complete
{
   "dates": [
      {
         "type":"Publication",
         "dateString":"2012-01-01",
         "label": "Publication Date"
      },
      {
         "type":"Repository Created",
         "dateString":"2012",
         "label":"Repository Created"
      }
   ]
}

Definition: This can be the Start Date, the End Date, the date of publication or award, or any general date ("Info Date") associated with the record. There must be at least one date associated with any record.

Mapping...

  • type: The type of date.
    Map to: [schema][metadata][resourceInfo][citation][dates][n].dateType
    view mdTools
  • dateString: The date. Note that this dateString must be in the format: YYYY, YYYY-MM, or YYYY-MM-DD or the date will not be saved.
    Map to: [schema][metadata][resourceInfo][citation][dates][n].date
    view mdTools
  • label: The human readable label for the date type.
    Map to: [schema][metadata][resourceInfo][citation][dates][n].description
    view mdTools

Mapping to mdTranslator

   def newBase
      intObj = {
         metadata: {
            resourceInfo: {
               citation: {
                  title: nil,
                  alternateTitles: [],
                  dates: [
                     {
                        date: '2012-01-01',
                        dateResolution: 'YMD',
                        dateType: 'Publication',
                        description: 'Publication Date'
                     },
                     {
                        date: '2012',
                        dateResolution: 'Y',
                        dateType: 'Repository Created',
                        description: 'Repository Created'
                     }
                  ],
                  edition: nil,
                  responsibleParties: [],
                  presentationForms: [],
                  identifiers: [],
                  series: {},
                  otherDetails: [],
                  onlineResources: [],
                  browseGraphics: []
               }
            }
         }
      }
   end

Translation to mdJson

{
   "metadata": {
      "resourceInfo": {
         "citation": {
            "date": [
               {
                  "date": "2012-01-01",
                  "dateType": "Publication",
                  "description": "Publication Date"
               },
               {
                  "date": "2012",
                  "dateType": "Repository Created",
                  "description": "Repository Created"
               }
            ]
         }
      }
   }
}
@jlblcc
Copy link
Member

jlblcc commented Mar 9, 2017

The dateType is a candidate for codelist translation. mdJSON to sbJSON will need codelist translation support to be compatible with SB CVLs.

@stansmith907
Copy link
Contributor Author

Translation map for codes are on the arcticLcc drive. Lei Ann mapped most of these out.

@jlblcc
Copy link
Member

jlblcc commented Jun 7, 2017

ScienceBase Date Vocab: https://www.sciencebase.gov/vocab/categories?max=1000&parentId=4f4e475de4b07f02db47ded1
Update translation code list with the above list.

@stansmith907
Copy link
Contributor Author

Include resource timePeriod start and end dates in sbJson dates

@stansmith907
Copy link
Contributor Author

For iso dateType(s) that do not map to scienceBase date types use type = 'Info' and place iso dateType in label element:

{
   "dates": [
      {
         "type": "Info",
         "label": "expiry",
         "dateString": "1957"
      }
   ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants