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

Add Datacite Content negotiation for schema.org metadata to dataset view #29

Open
jordanpadams opened this issue Jun 29, 2023 · 2 comments
Assignees
Labels

Comments

@jordanpadams
Copy link
Member

jordanpadams commented Jun 29, 2023

💡 Description

Add the following javascript to all dataset view pages:

$(document).ready(function() {
  var identifier = "https://doi.org/10.5284/1015681"; //for example 10.5284/1015681
  if (identifier === undefined) {
    return;
  }
  var doi = new URL(identifier);
  var url = "https://data.crosscite.org";
  url += '/application/vnd.schemaorg.ld+json/' + doi.pathname;

  $.ajax({
    url: url,
    dataType: 'text', // don't convert JSON to Javascript object
    success: function(data) {
      $('<script>')
         .attr('type', 'application/ld+json')
         .text(data)
         .appendTo('head');
    },
    error: function (error) {
      console.log(error.responseJSON);
    }
  });
});

https://gist.github.com/kjgarza/34ca6a866b4437bc1c07d84f208a01c4

Note: The JSP code will need to replace the DOI above with the DOI on the landing page (https://doi.org/10.5284/1015681). This should only be added to pages that have the actual DOIs (e.g. ignore for collections that point to parent DOI).

Most likely tightly coupled with NASA-PDS/pds-api#45

@jordanpadams
Copy link
Member Author

@c-suh not sure if this will work or not with the way our pages are displayed, but give it a shot...

@jordanpadams
Copy link
Member Author

This is, unfortunately, not as easy as it looks based upon the original way we were getting this DOI information from the backend. Deferring until probably never.

@jordanpadams jordanpadams moved this from ToDo to 🧊 Icebox in EN Portfolio Backlog Jun 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: 🧊 Icebox
Development

No branches or pull requests

3 participants