[VUFIND-951] Google Scholar Tags Created: 28/Jan/14  Updated: 15/Jan/20  Resolved: 15/Jan/20

Status: Resolved
Project: VuFind®
Components: Record
Affects versions: None
Fix versions: 6.1

Type: Improvement Priority: Minor
Reporter: Demian Katz Assignee: Mario Trojan
Resolution: Fixed Votes: 3
Labels: Roadmap2019
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original estimate: Not Specified


 Description   
Luke O'Sullivan shared this on the mailing list:

---

I have added google scholar tags to our vufind based repository. I took an approach similar to that used when generating openurl links:

    /**
     * Get Google Scholar Tags
     *
     * @return array
     */
    public function getGoogleScholarTags()
    {
        $meta = array();
        $format = $this->getOpenURLFormat();
        $pubDate = $this->getPublicationDates();
        $pubDate = empty($pubDate) ? '' : $pubDate[0];
        $meta[] = array("name" => "citation_title", "content" => $this->getTitle());
        $meta[] = array(
            "name" => "citation_author",
            "content" => $this->getPrimaryAuthor()
        );
        foreach ($this->getSecondaryAuthors() as $author) {
                $meta[] = array("name" => "citation_author", "content" => $author);
        }
        $meta[] = array(
            "name" => "citation_publication_date",
            "content" => $pubDate
        );

        switch ($format) {
        case 'Edited book':
        case 'Authored book':
        case 'Book':
            $meta[] = array(
                "name" => "citation_isbn",
                "content" => $this->getCleanISBN()
            );
            break;
        case 'Journal article':
        case 'Article':
            $meta[] = array(
                "name" => "citation_issn",
                "content" => $this->getCleanISSN()
            );
            $meta[] = array(
                "name" => "citation_volume",
                "content" => $this->getContainerVolume()
            );
            $meta[] = array(
                "name" => "citation_issue",
                "content" => $this->getContainerIssue()
            );
            $meta[] = array(
                "name" => "citation_firstpage",
                "content" => $this->getContainerStartPage()
            );
            $meta[] = array(
                "name" => "citation_journal_title",
                "content" => $this->getContainerTitle()
            );
            break;
        case 'Journal':
            $meta[] = array(
                "name" => "citation_issn",
                "content" => $this->getCleanISSN()
            );
        default:
            break;
        }

        return $meta;
    }

In core.phtml we then do

$tags = $this->record($this->driver)->getGoogleScholarTags();
foreach ($tags as $tag) {
if (!empty($tag['content'])) {
$this->headMeta()->appendName($tag['name'], $tag['content']);
}
}

---

We may want to consider making this a configurable option, though if so, it should be off by default -- most VuFind instances are not serving up the sort of content indexed by Google Scholar, but for sites using it as an institutional repository front end, this would be appropriate.

 Comments   
Comment by Mario Trojan [ 08/Oct/19 ]
Google Scholar contacted us as well, and they sent us the following specification:
https://scholar.google.com/intl/en/scholar/inclusion.html#indexing

So there are 4 kinds of metadata that Google Scholar supports:
- Highwire Press tags (e.g. citation_title, as used in the example code in this issue)
- Eprints tags (e.g. eprints.title)
- BE Press tags (e.g. bepress_citation_title)
(- Dublin core tags - as last resort)

Is there any specific reason why you preferred Highwire Press tags over Eprints tags / BE Press tags?

(/edit: forgot to mention PRISM as well)
Comment by Demian Katz [ 08/Oct/19 ]
[~accountid:6260396a9e7c190069e78587], this code was shared by [~accountid:626039523b1ee3006b1a5372] more than five years ago. Luke is no longer working with VuFind (he has moved on to other projects), so I'm not sure if he'll see your question in order to answer it... but if I had to guess, I'd say that it may be that five years ago, the other options either did not exist or were not as well documented. It does not necessarily reflect an intentional preference (though it's possible that it does).

In any case, if you think adding standard support for this would be valuable, I'd welcome a pull request to introduce a configurable option, so we can resolve this ticket! If, on the other hand, you think this is best left to local customization, we can leave this open for reference.
Comment by Demian Katz [ 15/Jan/20 ]
See https://github.com/vufind-org/vufind/pull/1529
Generated at Fri Apr 19 17:18:11 UTC 2024 using Jira 1001.0.0-SNAPSHOT#100250-rev:2b88e55752dc82be8616a67bc2b73a87c8e22b48.