Skip to content

Instantly share code, notes, and snippets.

@HughP
Last active June 13, 2020 21:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HughP/95d2c6606b15332fd58fd57277cff80f to your computer and use it in GitHub Desktop.
Save HughP/95d2c6606b15332fd58fd57277cff80f to your computer and use it in GitHub Desktop.
JSON+LD from datacite DOI description and usage
<script type='application/ld+json'>
{
  "@context": "http://schema.org",
  "@type": "Dataset",
  "@id": "https://doi.org/10.7910/dvn/icfngt",
  "identifier": {
    "@type": "PropertyValue",
    "propertyID": "DOI",
    "value": "https://doi.org/10.7910/dvn/icfngt"
  },
  "url": "https://dataverse.harvard.edu/citation?persistentId=doi:10.7910/DVN/ICFNGT",
  "name": "Replication Data for: Parties, Legislators, and the Origins of Proportional Representation",
  "author": {
    "name": "Cox, Gary W. (Stanford University); Fiva, Jon H. (BI Norwegian Business School); Smith, Daniel M. (Harvard University)"
  },
  "datePublished": "2017",
  "schemaVersion": "http://datacite.org/schema/kernel-4",
  "publisher": {
    "@type": "Organization",
    "name": "Harvard Dataverse"
  }
}
</script>

Source

https://search.google.com/structured-data/testing-tool/u/0/#url=https%3A%2F%2Fsearch.datacite.org%2Fworks%2F10.7910%2Fdvn%2Ficfngt

How I would improve this description

The author field is a singular data point instead of being expressed as an array with organizational affiliations in schema parlance. It doesn't have any sdxxx fields like schema.org version or who is publishing this schema.org metadata or the metadata license.

Here is a second more descriptive one from the datacite blog: https://blog.datacite.org/schema-org-register-dois/

  <script type="application/ld+json">
      {"@context":"http://schema.org","@type":"BlogPosting","@id":"https://doi.org/10.5438/0000-00cc","name":"Using Schema.org for DOI Registration","url":"https://blog.datacite.org/schema-org-register-dois/","author":[{"@type":"Person","@id":"https://orcid.org/0000-0003-1419-2405","givenName":"Martin","familyName":"Fenner","name":"Martin Fenner","affiliation":{"@id":"https://ror.org/04wxnsj81","name":"DataCite","@type":"Organization"}}],"publisher":{"@type":"Organization","name":"DataCite"},"dateCreated":"2017-01-09","datePublished":"2017-01-09","dateModified":"2017-01-09","keywords":"doi, schema.org, featured","version":"1.0","description":"Three weeks ago we started assigning DOIs to every post on this blog (Fenner, 2016c). The process we implemented uses a new command line utility and integrates well with our the publishing workflow, with (almost) no extra effort compared to how we...","license":"https://creativecommons.org/licenses/by/4.0/legalcode","image":"/images/2016/12/schema-org.png","isPartOf":{"@type":"Blog","@id":"https://doi.org/10.5438/0000-00SS","name":"DataCite Blog"},"citation":[{"@type":"CreativeWork","@id":"https://doi.org/10.5438/0000-00SS"},{"@type":"CreativeWork","@id":"http://dublincore.org/documents/2012/06/14/dces"},{"@type":"CreativeWork","@id":"https://doi.org/10.5438/TNHX-54CG"},{"@type":"CreativeWork","@id":"https://doi.org/10.5438/55E5-T5C0"},{"@type":"CreativeWork","@id":"https://doi.org/10.5438/4K3M-NYVG"}]}
    </script>
    
    ```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment