UniRegensburg / unsere-app-fur-die-universitat-regensburg-bib-buddy

Bib Buddy - deine App für eine konzentrierte, offene Literaturarbeit!
0 stars 0 forks source link

Adding multiple authors to a book #104

Closed SarahKurek closed 3 years ago

SarahKurek commented 3 years ago

As a user I want to add multiple authors to a book.

claudia3 commented 3 years ago

@LuisMossburger Only one author is saved even if there are multiple authors for a book and it is in the data: sample ISBN: 9781942788331 only one author is shown: Nicole Forsgren. the rest of the authors of that book are: Kim, Gene and Humble, Jez. marcrel:aut has three entries -> 3 authors

`<?xml version="1.0"?> <rdf:RDF xmlns:bibo="http://purl.org/ontology/bibo/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:frbr="http://purl.org/vocab/frbr/core#" xmlns:isbd="http://iflastandards.info/ns/isbd/elements/" xmlns:marcrel="http://id.loc.gov/vocabulary/relators/" xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:rdagr1="http://rdvocab.info/Elements/" xmlns:rdau="http://rdaregistry.info/Elements/u/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">

RDF description of Accelerate Portland Oregon : IT Revolution 2018 Agile software development Nicole Forsgren, Jez Humble and Gene Kim 2018 Operations research Includes bibliographical references (pages 237-242) and index the science behind DevOps : building and scaling high performing technology organizations Computer software industry 9781942788331 Accelerate First edition Accelerate your organization to win in the marketplace. How can we apply technology to drive business value? For years, we've been told that the performance of software delivery teams doesn't matter?that it can't provide a competitive advantage to our companies. Through four years of groundbreaking research to include data collected from the State of DevOps reports conducted with Puppet, Dr. Nicole Forsgren, Jez Humble, and Gene Kim set out to find a way to measure software delivery performance?and what drives it?using rigorous statistical methods. This book presents both the findings and the science behind that research, making the information accessible for readers to apply in their own organizations. Readers will discover how to measure the performance of their teams, and what capabilities they should invest in to drive higher performance. This book is ideal for management at every level-- xxix, 257 Seiten IT Revolution 1042816145 Portland Oregon Information technology the science behind DevOps : building and scaling high performing technology organizations Management `
claudia3 commented 3 years ago

In AuthorRetriever.java why that in a for loop? authorList = persons;

  public List<Author> extractAuthors(Document xmlMetadata) {
    NodeList[] relevantPersons = {
        xmlMetadata.getElementsByTagName("marcrel:aut"), // "authors"
        xmlMetadata.getElementsByTagName("dcterms:contributor"), // "contributors"
        xmlMetadata.getElementsByTagName("dcterms:creator"), // "creator"
        xmlMetadata.getElementsByTagName("marcrel:cmp") // "creator"
    };

    NodeList authorList = null;
    for (NodeList persons : relevantPersons) {
      if (persons.getLength() > 0) {
        authorList = persons; // TODO Luis please have a look at that
      }
    }

    return makeAuthorList(authorList);
  }
LuisMossburger commented 3 years ago

The for loop is used because we have cases (like this one here) where we have creators, authors, contributors etc. We have to make a priorization like librarians do. In "NodeList[] relevantPersons" all persons are saved based on their contribution type to the book. We then loop all contributionTypes and use only persons of one contribution type with the highest possible priority as the "primary authors" for the book.

It can well be that not all persons of a book are retrieved from the API and this is expected behavior. Librarians can mark multiple people as contributors, but may only mark one or two as the "primary" authors. For that matter we have implemented the priority "author" - "contributor" - "creator" - "composer". However, in this case you have found a bug nonetheless - we need a break statement inside the "if statement". Since you are creating a PR right now, would you mind using the code below and push that? :)

public List<Author> extractAuthors(Document xmlMetadata) {
    NodeList[] relevantPersons = {
        xmlMetadata.getElementsByTagName("marcrel:aut"), // "authors"
        xmlMetadata.getElementsByTagName("dcterms:contributor"), // "contributors"
        xmlMetadata.getElementsByTagName("dcterms:creator"), // "creator"
        xmlMetadata.getElementsByTagName("marcrel:cmp") // "composer"
    };

    NodeList authorList = null;
    for (NodeList persons : relevantPersons) {
      if (persons.getLength() > 0) {
        authorList = persons;
        break;
      }
    }

    return makeAuthorList(authorList);
  }
claudia3 commented 3 years ago

The for loop is used because we have cases (like this one here) where we have creators, authors, contributors etc. We have to make a priorization like librarians do. In "NodeList[] relevantPersons" all persons are saved based on their contribution type to the book. We then loop all contributionTypes and use only persons of one contribution type with the highest possible priority as the "primary authors" for the book.

It can well be that not all persons of a book are retrieved from the API and this is expected behavior. Librarians can mark multiple people as contributors, but may only mark one or two as the "primary" authors. For that matter we have implemented the priority "author" - "contributor" - "creator" - "composer". However, in this case you have found a bug nonetheless - we need a break statement inside the "if statement". Since you are creating a PR right now, would you mind using the code below and push that? :)

public List<Author> extractAuthors(Document xmlMetadata) {
    NodeList[] relevantPersons = {
        xmlMetadata.getElementsByTagName("marcrel:aut"), // "authors"
        xmlMetadata.getElementsByTagName("dcterms:contributor"), // "contributors"
        xmlMetadata.getElementsByTagName("dcterms:creator"), // "creator"
        xmlMetadata.getElementsByTagName("marcrel:cmp") // "composer"
    };

    NodeList authorList = null;
    for (NodeList persons : relevantPersons) {
      if (persons.getLength() > 0) {
        authorList = persons;
        break;
      }
    }

    return makeAuthorList(authorList);
  }

Ok I will do that.