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

<references> nodes should be turned into @id #5

Open
cboettig opened this issue Dec 21, 2017 · 1 comment
Open

<references> nodes should be turned into @id #5

cboettig opened this issue Dec 21, 2017 · 1 comment

Comments

@cboettig
Copy link
Member

Currently package generates JSON-LD such as:

"creator": {
        "@id": "clarence.lehman",
        "individualName": {
          "givenName": "Clarence",
          "surName": "Lehman"
        }
      },
      "contact": {
        "references": "clarence.lehman"
      }

This should really be turned into:

"creator": {
        "@id": "clarence.lehman",
        "individualName": {
          "givenName": "Clarence",
          "surName": "Lehman"
        }
      },
      "contact": {
        "@id": "clarence.lehman"
      }

Or perhaps more formally:

     "contact": {
        "@id": "clarence.lehman"
       "@type": "@id"
      }

Going in reverse, some care will need to be taken to put the <references> tag back in only when the @type is @id or the @id is the only property.

@cboettig
Copy link
Member Author

This also applies to <describes>, as used in additionalMetadata. Note the mapping here is slightly different: <describes>abc123<describes> becomes: "describes": "abc123", keeping the element name; while references becomes @id. describes needs to be typed as @id so that this functions properly as linked data.

Note that expanding references will also break the strict test of matching numbers of elements, since there's no unique way to collapse back into references, so these will always be embedded.

In contrast, describes should always be collapsed back to the id instead of embedded.

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

No branches or pull requests

1 participant