Islandora / documentation

Contains islandora's documentation and main issue queue.
MIT License
104 stars 71 forks source link

Meta-Issue: Dynamic Citations #935

Open dannylamb opened 6 years ago

dannylamb commented 6 years ago

This is a meta-issue to track the development of a dynamic citation generation feature. Please refer to this issue in any subsequent issues to link the two.

Scholar in 7.x had the ability to generate citations in various formats, driven by object metadata. We should port this functionality forward to CLAW, but maybe with less xslt's...


[Editing to add use case wording - RL 2021-10-22] Title (Goal) Dynamically generated citations
Primary Actor Collection Manager, End User, Evaluator
Scope Metadata
Story "As a site user, I would like to generate citations in popular citation formats for items in the repository. As a site administrator, I would like to configure a site to provide dynamic citations, including providing custom mappings for my metadata fields and selecting options that should be available to a user.
Natkeeran commented 5 years ago

Related drupal module: https://www.drupal.org/case-study/bibliography-and-citation-module-for-drupal-8

elizoller commented 5 years ago

Has anyone played around with that bibcite module?

I tried installing it and the documentation is pretty minimal. From what I can tell, you have to create Reference entities which can then be exported in a variety of formats (you can also import reference entities). One could possibly create/edit/delete reference entities programmatically with the create/edit/delete of repository item nodes (and programmatically map fields to the reference entity fields) and relate the reference via an entity relationship. That feels like its duplicating a lot of data though. Is anyone seeing a way we could using existing fields (like say, those in islandora_defaults)? Or is there a better way to use this module?

alxp commented 5 years ago

I used Bibcite pretty extensively while making the journal install profile that powers https://journaloflmmontgomerystudies.ca/

I found it pretty useful if you want to import citations from an outside source like Refworks, and if you want to be able to easily use the styles provided.

I was able to do a little cover use of its serializer to get it to use fields from my own Article node type rather than having to put everything in to its own custom entity type which I mostly found cumbersome to deal with.

A quick sample:

From: https://github.com/roblib/journal/blob/master/docroot/profiles/journal/modules/custom/journal_cite_this/src/Plugin/Block/CiteThisBlock.php

    $citation_tools = new CitationTools();
    $citation_metadata = $citation_tools->getCitationMetadataForArticle($node);

    $citation_metadata['type'] = 'journal_article';

    $r = Reference::create($citation_metadata);
    $serializer = \Drupal::service('serializer');
    $data = $serializer->normalize($r, 'csl');

    $text_citation = [
      '#theme' => 'bibcite_citation',
      '#data' => $data,
    ];

For our Islandora RDM project we decided to not use Bibcite because we only intend to have one citation format, the format given in Datacite. So I just have a Twig template for a basic data set citation which renders a Citation view mode in a block.

elizoller commented 5 years ago

I was just looking at your twig template which I saw referenced in the blog post on islandora.ca. Excellent. Since I'm coming from a use case of having a variety of citation formats and a variety of content types, I'll need something more robust. Thanks for the suggestion on connecting a custom content type to bibcite!