adiwg / mdTranslator

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

sbJson writer support for external contact identifiers #304

Open jwaspin opened 10 months ago

jwaspin commented 10 months ago

Verified sbJSON supports identifiers:

sbJSON: contacts[]>orcId i. Logic: where contactType = “individual” and “orcId” element exists ii. contacts block

  1. identifier: orcId
  2. namespace: “ORCID”
  3. version: (not supported)
  4. description: “Open Researcher and Contributor Id”
  5. authority{}: (not supported)

sbJSON: contacts[]>organization

i. Logic: where contactType = “organization” and “organization” block element exists = true ii. contacts block

  1. identifier: directoryId
  2. namespace: displayText
  3. version: (not supported)
  4. description: displayText
  5. authority{}: (not supported)
jwaspin commented 10 months ago

Example

Contact Type: Person

mdJson

{
  ...
  "name": "person name",
  "isOrganization": false,
  "externalIdentifier": [
    {
      "identifier": "example-orcid",
      "namespace": "ORCID",
      "description": “Open Researcher and Contributor Id”
    }
  ]
  ...
}

sbJson


{
  ...
  "name": "person name",
  "contactType": "person",
  "orcId": "example-orcid",
  ...
}
jwaspin commented 10 months ago

Example

Contact Type: Organization

mdJson

{
  ...
  "name": "org name",
  "isOrganization": true,
  "externalIdentifier": [
    {
      "identifier": "example-org-orcid",
      "namespace": "ROR",
      "description": “Research Organization Registry identifier”
    }
  ]
  ...
}

sbJson


{
  ...
  "name": "org name",
  "contactType": "organization",
  "ror": "example-org-orcid"
  ...
}
dwalt commented 10 months ago

The sbJSON organization example is incorrect. There is no ORCID associated with an organization. The code should trap for any contact with a contactType = "organization". The contactName should be mapped to displayText. The logic comments should reflect the inverse mapping of mdJSON to sbJSON from the perspective of a writer. Example: directoryId = identifier

jwaspin commented 10 months ago

From https://www.usgs.gov/sciencebase-instructions-and-documentation/item-core-model#contacts

contacts
Datatype: Array of contact objects
The contacts of an item. This is an collection of basic typed contact objects, which have the fields: type, name, highlighted. The type is the type of contact, e.g., Author, Contact, Data Owner, Participant, Principle Investigator, Project Chief, Associate Project Chief, Task Leader, this is a string. The name is the name of the contact, it is a string. Highlighted is whether or not the contact is highlighted, it is a boolean.

CONTACT OBJECT
Most fields in the contact object are self explanatory, but some are explained below. Check out the JSON object containing one person and one organization for full list of fields.

name (Datatype: String) The name of the contact.
contactType (Datatype: String) The type of contact, always "person" or "organization"
type (Datatype: String) An editable type to describe the person or organization.
email (Datatype: String) The email address of a person. Not included in organizations.
firstName¹ (Datatype: String) 
middleName¹ (Datatype: String)
lastName¹ (Datatype: String)
jobTitle¹ (Datatype: String)
active (Datatype: Boolean) Whether the person or organization is active.
organization¹ (Datatype: Object with one field: displayText which describes the organization) Person types only.
primaryLocation (Datatype: primaryLocation object) 
note² (Datatype: String)
aliases² (Datatype: Array of Strings)
logoUrl² (Datatype: URI)

¹ Only included on contactType "person"
​​​​​​​² Only included on contactType "organization"
jwaspin commented 10 months ago

@dwalt I'm not sure I understand what you're saying about this mapping. I'm looking at this from the mdJson -> sbJson perspective. In terms of sbJson -> mdJson I'm not sure what to look for in sbJson, since I'm not sure what the "external identifier" looks like in sbJson.

  1. Is there a mapping for both people and organizations, or does this only apply to one or the other?
  2. Since an organization is not supposed to have a nested organization object, I'm not sure what you mean by mapping the contact name to displayText. In the case of a person it does not make sense to me to map the person's name to the displayText for the organization object.
  3. I don't see anything about directoryId in the sbJson schema, so I'm not sure I understand where that goes.
dwalt commented 10 months ago

@jwaspin What you are likely viewing is publicly accessible documentation of the core sbJSON model available here: https://www.usgs.gov/sciencebase-instructions-and-documentation/item-core-model#contacts. There are extensions to the core available to USGS users, which is probably what I used. I would suggest requesting assistance.

jwaspin commented 9 months ago

The decision for this was to not do anything for an organization, only for a "person" type of contact.