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 id #54

Closed
2 tasks done
stansmith907 opened this issue Mar 4, 2017 · 1 comment
Closed
2 tasks done

sbJson 2.0 id #54

stansmith907 opened this issue Mar 4, 2017 · 1 comment

Comments

@stansmith907
Copy link
Contributor

stansmith907 commented Mar 4, 2017

Mapping of sbJson id to mdTranslator internal data structure:

  • reader complete
  • writer complete
{
   "id":"<unique id>"
}

Definition: The unique ScienceBase id of the item. ScienceBase assigns its own universally unique identifier to every item and uses it consistently throughout the architecture for all references. The UUID may be expressed as an HTTP URI (universal resource identifier) in some circumstances, but the basic ID is listed as a UUID string in the core model.

  • Map to [schema][metadata][metadataInfo][metadataIdentifier].identifier
    view mdTools
  • Map to [schema][metadata][resourceInfo][citation][identifier[0].identifier
    view mdTools

Mapping to mdTranslator

   def newBase
      intObj = {
         metadata: {
            metadataInfo: {
               metadataIdentifier: {
                  identifier: '<unique id>',
                  namespace: 'gov.sciencebase.catalog',
                  description: 'US Geological Survey ScienceBase identifier',
                  version: nil,
                  citation: {}

               },
            },
            resourceInfo: {
               citation: {
                  identifier: [
                     {
                        identifier: '<unique id>',
                        namespace: 'gov.sciencebase.catalog',
                        description: 'US Geological Survey ScienceBase identifier',
                        version: nil,
                        citation: {}
                     }
                  ]
               }
            }
         }
      }
   end

Translation to mdJson:

{
   "metadata": {
      "metadataInfo": {
         "metadataIdentifier": {
            "identifier": "<unique id>",
            "nameSpace": "gov.sciencebase.catalog",
            "description": "US Geological Survey ScienceBase identifier"
         }
      },
      "resourceInfo": {
         "citation": {
            "identifier": [
               {
                  "identifier": "<unique id>",
                  "nameSpace": "gov.sciencebase.catalog",
                  "description": "US Geological Survey ScienceBase identifier"
               }
            ]
         }
      }
   }
}
@stansmith907
Copy link
Contributor Author

For writer:
use metadataIdentifier
else resourceInfo > citation > identifier [0]
else UUID

For reader:
place id in metadataIdentifier

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