europmc

package module
v0.0.0-...-61a7952 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 17, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

README

Simple library for parsing openXML papers from EuroPMC

Simple library of structure definitions and helper functions to allow the reading of meta-data from EuroPMC open access papers downloaded in openXML format.

License

This library is copyright Content Mine Ltd 2018, and released under the Apache 2.0 License.

Documentation

Overview

Package provides definitions for loading and reading open access XML papers from EuroPMC.

Index

Constants

View Source
const EUROPMC_API_URL string = "https://www.ebi.ac.uk/europepmc/webservices/rest"

Base URL for EuroPMC REST API

Variables

This section is empty.

Functions

func FullTextURL

func FullTextURL(pmcid string) string

func SupplementaryFilesURL

func SupplementaryFilesURL(pmcid string) string

Types

type ArticleID

type ArticleID struct {
	XMLName xml.Name `xml:"article-id"`
	Type    string   `xml:"pub-id-type,attr"`
	ID      string   `xml:",chardata"`
}

type ArticleMeta

type ArticleMeta struct {
	XMLName           xml.Name          `xml:"article-meta"`
	IDs               []ArticleID       `xml:"article-id"`
	TitleGroup        ArticleTitleGroup `xml:"title-group"`
	ContributorGroups []ContribGroup    `xml:"contrib-group"`
	Permissions       Permissions       `xml:"permissions"`
	KeywordGroup      KeywordGroup      `xml:"kwd-group"`
}

type ArticleTitleGroup

type ArticleTitleGroup struct {
	XMLName          xml.Name `xml:"title-group"`
	ArticleTitle     string   `xml:"article-title"`
	AlternativeTitle string   `xml:"alt-title"`
}

type ContribGroup

type ContribGroup struct {
	XMLName      xml.Name      `xml:"contrib-group"`
	Contributors []Contributor `xml:"contrib"`
}

type Contributor

type Contributor struct {
	Name ContributorName `xml:"name"`
}

type ContributorName

type ContributorName struct {
	Surname    string `xml:"surname"`
	GivenNames string `xml:"given-names"`
}

func (*ContributorName) String

func (author *ContributorName) String() string

type Front

type Front struct {
	XMLName     xml.Name    `xml:"front"`
	JournalMeta JournalMeta `xml:"journal-meta"`
	ArticleMeta ArticleMeta `xml:"article-meta"`
}

type JournalMeta

type JournalMeta struct {
	XMLName    xml.Name          `xml:"journal-meta"`
	TitleGroup JournalTitleGroup `xml:"journal-title-group"`
}

type JournalTitleGroup

type JournalTitleGroup struct {
	XMLName      xml.Name `xml:"journal-title-group"`
	JournalTitle string   `xml:"journal-title"`
}

type KeywordGroup

type KeywordGroup struct {
	XMLName  xml.Name `xml:"kwd-group"`
	Title    string   `xml:"title"`
	Language string   `xml:"lang,attr"`
	Keywords []string `xml:"kwd"`
}

type License

type License struct {
	XMLName xml.Name `xml:"license"`
	Link    string   `xml:"href,attr"`
	Text    string   `xml:"license-p"`
}

type OpenXMLPaper

type OpenXMLPaper struct {
	XMLName xml.Name `xml:"article"`
	Front   Front    `xml:"front"`
}

func FetchFullText

func FetchFullText(pmcid string) (*OpenXMLPaper, error)

func LoadPaperXMLFromFile

func LoadPaperXMLFromFile(path string) (OpenXMLPaper, error)

func (OpenXMLPaper) ArticleID

func (paper OpenXMLPaper) ArticleID(id_type string) *string

func (OpenXMLPaper) FirstAuthor

func (paper OpenXMLPaper) FirstAuthor() *ContributorName

func (OpenXMLPaper) JournalTitle

func (paper OpenXMLPaper) JournalTitle() string

func (OpenXMLPaper) Keywords

func (paper OpenXMLPaper) Keywords() []string

func (OpenXMLPaper) LicenseURL

func (paper OpenXMLPaper) LicenseURL() string

func (OpenXMLPaper) PMCID

func (paper OpenXMLPaper) PMCID() *string

func (OpenXMLPaper) PMID

func (paper OpenXMLPaper) PMID() *string

func (OpenXMLPaper) Title

func (paper OpenXMLPaper) Title() string

type Permissions

type Permissions struct {
	XMLName            xml.Name `xml:"permissions"`
	CopyrightStatement string   `xml:"copyright-statement"`
	CopyrightYear      string   `xml:"copyright-year"`
	License            License  `xml:"license"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL