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 link #58

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

sbJson 2.0 link #58

stansmith907 opened this issue Mar 5, 2017 · 3 comments

Comments

@stansmith907
Copy link
Contributor

stansmith907 commented Mar 5, 2017

Mapping of sbJson link to mdTranslator internal data structure:

  • reader complete
  • writer complete
"link":
{
    "rel":"self",
    "url":"<full url of item or search>",
    "nextlink":
    {
        "rel":"next",
        "url":"<url of next result>"
    },
    "prevlink":
    {
        "rel":"prev",
        "url":"<url of previous result>"
    },
    "relatedItems":
    {
        "rel":"related",
        "url":"<url of related items list>"
    }
}

Definition...

  • rel: "rel" tells you what you are looking at. For items this will always be "self".
    Map to resource citation onlineResources description:
    [schema][metadata][resourceInfo][citation][onlineResources][n].olResDesc
    view mdTools
  • url: (none)
    Map to resource citation onlineResources uri:
    [schema][metadata][resourceInfo][citation][onlineResources][n].olResUri
    view mdTools
  • nextLink: (not mapped)
  • prevLink: (not mapped)
  • set onlineResources function = 'navigation'
    [schema][metadata][resourceInfo][citation][onlineResources][n].olResFunction
    view mdTools

Mapping to mdTranslator

   def newBase
      intObj = {
         metadata: {
            resourceInfo: {
               citation: {
                  onlineResources: [
                     {
                        olResURI: '<full url of item or search>',
                        olResProtocol: nil,
                        olResName: nil,
                        olResDesc: 'self',
                        olResFunction: 'navigation'
                     }
                  ]
               }
            }
         }
      }
   end

Translation to mdJson

{
   "metadata": {
      "resourceInfo": {
         "citation": {
            "onlineResource": [
               {
                  "uri": "<full url of item or search>",
                  "protocol": "",
                  "name": "",
                  "description": "self",
                  "function": "navigation"
               }
            ]
         }
      }
   }
}
@jlblcc
Copy link
Member

jlblcc commented Mar 6, 2017

I'm not sure we need to handle this object at all. AFAIK, this is always auto-generated by ScienceBase. We can output the onlineResource in the writer using the resource's ScienceBase identifier, if one is available.

@stansmith907
Copy link
Contributor Author

Good point. I was reading this as the next and previous were generated depending on user navigation, but the actual link may be generated as well.

@stansmith907
Copy link
Contributor Author

The entire link{} object is auto generated. We will not need to read or write this section.

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